Can we get syntax highlighting for R in the Terminal?
4 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
-
How do we get library("colorout") to run each time we open an R session?– NikosCommented Oct 23, 2017 at 21:41
-
2@Nikos add it to your
.Rprofile
;-) See r-bloggers.com/fun-with-rprofile-and-customizing-r-startup– VongoCommented Nov 15, 2019 at 15:15
As hd1 indicated, this is not an R question. You're asking the OSX Terminal.app
to do something it's not capable of. A quick look around Google (happy Zamboni birthday!) shows Vim syntax Highlighting for highlighting within vim
, or https://superuser.com/questions/72057/terminal-emulator-with-custom-color-palette , but dunno if these will run under Darwin.
EDIT: I can't stay away from the search :-) . So check out these threads: https://superuser.com/questions/400360/syntax-highlighting-in-terminal-mac-os-x , http://forums.macrumors.com/showthread.php?t=412609 , and a recommendation to install zsh
, https://apple.stackexchange.com/questions/12161/os-x-terminal-must-have-utilities
-
1
-
@hd1 Oops-- I quoted the wrong thing. The special goody is "oh-my-zsh" or some such enhancement app. Commented Jan 16, 2013 at 15:02
-