Reputation: 16422
Can we get syntax highlighting for R in the Terminal?
Upvotes: 31
Views: 5211
Reputation: 146
Another option now would be to use radian instead of the default R prompt.
Upvotes: 2
Reputation: 16422
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
Upvotes: 36
Reputation: 21502
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
Upvotes: 0