Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Altering RStudio Editor Theme

I am trying to alter an RStudio Editor Themes so that I can set my own colors. I'm using RStudio version 0.99.473 on Windows 10.

I've reviewed Any way to change colors in Rstudio to something other than default options? which was extremely helpful as well as Editing R Studio them in cashe.css theme file (ACE editor?)

I am trying to identify what the different .ace_ items in the RStudio Editor Theme CSS files (ACE editor code) correspond to. The CSS files are found in /www/rstudio/ within RStudio's install path. An example of the script is found on GitHub for the Tomorrow theme.

In particular, I'm looking to see how to color variables (that I define) differently from functions. For example in x <- rnorm(10,0,10), I'd like x and rnorm to be colored differently. Not sure if that's possible.

like image 209
Jim Smith Avatar asked Nov 01 '16 22:11

Jim Smith


People also ask

How do I edit a theme in R?

Change RStudio themesNavigate to Tools → Global options → Appearance and switch the theme in the Editor Theme option. By default, you will have the Textmate theme activated. There is a wide in-built variety of themes to choose, from light to dark themes.

What is the default RStudio editor theme?

RStudio provides support for three global themes that customize the RStudio IDE's user interface: Classic, Modern and Sky. By default, the Modern theme is selected. The dark theme is a superset to the Modern and Sky themes that is activated whenever the Editor theme uses a dark palette.

How do I make my own RStudio theme?

To create a new theme for RStudio, you can write a tmTheme and import it to RStudio, write an rstheme, or write a tmTheme and then modify the rstheme that RStudio will generate for you.


1 Answers

For what it's worth, the newest versions of RStudio come with a preference that allow you to ensure that function calls are colored differently from variables -- from RStudio v1.0.44, we have the option

  • Highlight R function calls

RStudio Options

With this option active, function calls will be highlighted differently (for example, with Tomorrow Night Bright):

Image Example of Highlighting

Hopefully, user-customizable themes will become part of the next RStudio release.

like image 152
Kevin Ushey Avatar answered Sep 27 '22 16:09

Kevin Ushey