Altering RStudio Editor Theme

依然范特西╮ 提交于 2019-12-05 11:38:24

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

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

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

RStudio has a tutorial. Although not specific to your question about coloring variables, I did edit the highlighting of matched brackets in my theme so that they are more visible. Here's how:

Select a theme from this theme editor and save it to your machine as a .tmTheme file. Add the theme in RStudio. RStudio automatically creates an .rstheme file from that. I found the rstheme file in my Users/Eric/Documents/.R/rstudio/themes folder (Windows machine). Open the file in Notepad++ (or your favorite text editor) and find the .ace entry that matches the one you want to change (for me, specifically, .ace_bracket from the RStudio tutorial I mentioned earlier). This will have an rgba value similar to: background-color: rgba(238, 252, 81, 0.8); Note that the last value is the alpha (transparency) value and should be between 0 and 1. The values I used give me a nice bright yellow that is easily seen.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!