Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R syntax highlighting in Terminal

Tags:

terminal

r

Can we get syntax highlighting for R in the Terminal?

like image 847
e9t Avatar asked Jan 16 '13 09:01

e9t


People also ask

Can you highlight code in R?

Go to Tool -> Global options -> Code -> Display . Turn on Show syntax highlighting in console input and Highlight R function calls .

How does syntax highlighter work?

Syntax highlighting determines the color and style of source code displayed in the Visual Studio Code editor. It is responsible for colorizing keywords like if or for in JavaScript differently than strings and comments and variable names.


1 Answers

I've finally found a library that meets my needs.
Now I'm much happier with my coding environment.

colorout is an R package that colorizes R output when running in a terminal emulator.The package cannot be on CRAN because it changes code already loaded by R and this is prohibited by the CRAN Repository Policy. The package replaces the functions that output results and messages to R Console, and this is necessary because we cannot colorize the output without replacing these functions. To install it, do the following in R:

install.packages("devtools") devtools::install_github("jalvesaq/colorout") library("colorout") # do something 
like image 144
e9t Avatar answered Oct 02 '22 18:10

e9t