Any way to change colors in Rstudio to something other than default options?
Unfortunately there's not currently a way to do this. RStudio's themes are based on themes for the ACE text editor, which it embeds. It can generate internal themes based on ACE themes, so if you have an ACE theme you'd really like to use with RStudio, you can submit a pull request to RStudio (which is hosted on GitHub) for consideration.
i am new to R Studio and i would like to share how i was able to customize the color scheme of R Studio:
How to change the color of comments in Rstudio
- Rstudio Pane Appearance > Set editor theme to monokai
- Right click on editor pane > Inspect > find the specific file name (i.e. 838C7F60FB885BB7E5EED7F698E453B9.cache.css)
- Open drive C > open Progam Files folder > open Rstudio folder
- Open www folder > rstudio folder > find the 838C7F60FB885BB7E5EED7F698E453B9.cache.css (name of the theme you want to change)
- Make a backup copy of the original
- Change .ace_comment {color: #75715E} to .ace_comment {color: #F92672} > save to another location (don't change file name)
- Copy the recently saved code and paste it in rstudio folder (step 4) > replace the original 838C7F60FB885BB7E5EED7F698E453B9.cache.css file with the modified 838C7F60FB885BB7E5EED7F698E453B9.cache.csss file
- Click continue
- Quit Rstudio
- Open Rstudio
- Check if the color of comment has changed from nightsand(#75715E) to orchid(#F92672)
Not able to add a comment. Having read all the replies and comments, and tried a few things seems interesting. Here is what works for me.
I am using RStudio 1.0.136. According to all the posts, right click on the Editor -> Inspect. The Web Inspector comes up and shows the Elements tab. Then click the Sources tab, select "Only enable for this session", click "Enable Debugging" button. You will see the code for the theme xxxxxxx.cache.css file. If nothing in the editor, try the left top "Show Navigator" button right under the "Elements" menu. Select the .css file in the list and it should open.
My line number seems dim. So changed color: #222;
to color: #818222;
in this section: (forgive my bad color sense). And you can see the color change right away! How amazing!
.ace_gutter {
background-color: #3d3d3d;
background-image: -moz-linear-gradient(left, #3D3D3D, #333);
background-image: -ms-linear-gradient(left, #3D3D3D, #333);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#3D3D3D), to(#333));
background-image: -webkit-linear-gradient(left, #3D3D3D, #333);
background-image: -o-linear-gradient(left, #3D3D3D, #333);
background-image: linear-gradient(left, #3D3D3D, #333);
background-repeat: repeat-x;
border-right: 1px solid #4d4d4d;
text-shadow: 0px 1px 1px #4d4d4d;
color: #818222;
}
@skan mentioned selected words are too dim. I have the same problem. So here I found it:
.ace_marker-layer .ace_selected-word {
border-radius: 4px;
border: 8px solid #ff475d;
box-shadow: 0 0 4px black;
}
I changed border: 8px solid #ff475d;
. It is now very bright, or may be too bright. Anyway, it works. Thanks for every one. And hope this can help.
This is for current session only. Now you know which .css to modify and what you should do, it will be easy to modify the original .css file to keep it permanent.
There's a much faster way to deal with this and 100% doable.
Open RStudio with your favourite Editor theme and open an
.R
scriptInspect the Source layout (Right-click>Inspect) and Ctrl + f an unique class selector such as
.ace_comment
. In the matched CSS rules box in the side pane copy an attribute as unique as possible (i.e.color: #0088FF;
I use Cobalt theme).Go to RStudio's install path and dive into
/www/rstudio/
. As jorloff rightly said, you'll find a bunch of files like this:VERYUGLYNAME.cache.css
. Open all of them with your favourite text editor as administrator.Find in files: Ctrl+ Shift + f (in sublime text) and type the unique attribute value you previously chosed. BOOM, there you have it.
Now delight yourself editing your crazy style, but remember to back it up first!
As Jonathan said, RStudio's editor is based on ACE themes, so all clases have the ace_
prefix. Take your time inspecting and understanding the editor hierarchy. I recommend you to take some time inspecting the html code to understand its structure. The editor starts in id="rstudio_source_text_editor"
I'm using RStudio Desktop 0.99.892 Release for Windows