<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/rstudio-ide-custom-theme-support/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://blog.rstudio.com/2018/10/29/rstudio-ide-custom-theme-support/"> RStudio Blog</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>We’re excited to announce that RStudio v1.2 has added support for custom editor themes. Custom editor themes will allow you to adjust the background color of the editor and syntax highlighting of code in RStudio to better suit your own personal style.</p>
<p>New editor themes can be added to RStudio by importing a tmTheme or sharing an existing rstheme file. The tmTheme file format was first introduced for the TextMate editor, and has since become a standard theme format. The rstheme format is specific to RStudio.</p>
<h2>Importing a Custom Theme</h2>
<p>Before you can add a theme to RStudio, you’ll have to find a theme in the right format. This <a rel="nofollow" href="https://tmtheme-editor.herokuapp.com/" target="_blank">online tmTheme editor</a> will allow you to create your own tmThemes or download an existing theme from a large collection of themes. If you are interested in writing your own theme be sure to read this <a rel="nofollow" href="https://rstudio.github.io/rstudio-extensions/rstudio-theme-creation.html" target="_blank">RStudio Extensions article about writing themes</a>.</p>
<p>Once you have a tmTheme or rstheme file for your favorite theme or themes, you can import it to RStudio. Follow the instructions below to import a theme.</p>
<ol>
<li>
<p>In the menu bar, open the “Tools” menu.</p>
</li>
<li>
<p>From the drop down menu, choose “Global Options”.<br>
<img align="center" src="https://i2.wp.com/blog.rstudio.com/images/2018-10-29-import-theme-steps-1-and-2.png?w=456&ssl=1" data-recalc-dims="1"></p>
</li>
<li>
<p>In the pane on the left hand side of the options window, click “Appearance”.</p>
</li>
<li>
<p>To import a theme, click on the “Add…” button.<br>
<img align="center" src="https://i1.wp.com/blog.rstudio.com/images/2018-10-29-import-theme-steps-3-and-4.png?w=456&ssl=1" data-recalc-dims="1"></p>
</li>
<li>
<p>In the file browser, navigate to the location where you’ve saved your theme file.<br>
<img align="center" src="https://i1.wp.com/blog.rstudio.com/images/2018-10-29-import-theme-step-5.png?w=456&ssl=1" data-recalc-dims="1"></p>
</li>
<li>
<p>If prompted to install R packages, select “Yes”.<br>
<img align="center" src="https://i1.wp.com/blog.rstudio.com/images/2018-10-29-import-theme-step-6.png?w=456&ssl=1" data-recalc-dims="1"></p>
</li>
<li>
<p>You should now see your newly added theme in the list of editor themes. Simply click the “Apply” button to apply your theme to RStudio.<br>
<img align="center" src="https://i1.wp.com/blog.rstudio.com/images/2018-10-29-import-theme-step-7.png?w=456&ssl=1" data-recalc-dims="1"></p>
</li>
</ol>
<p><img align="center" src="https://i2.wp.com/blog.rstudio.com/images/2018-10-29-night-owl.png?w=456&ssl=1" data-recalc-dims="1"></p>
<p>The theme pictured in these examples is called Night Owlish, and was adapted from the Night Owl theme by RStudio’s own Mara Averick. It can be found on <a rel="nofollow" href="https://github.com/batpigandme/night-owlish" target="_blank">her github page</a>.</p>
<h2>Removing a Custom Theme</h2>
<p>If you accidentally added a theme, or you want to add an updated version, you can remove the theme from RStudio. To do so, follow the instructions below.</p>
<ol>
<li>
<p>As above, navigate to the Appearance Preferences Pane in the Global Options.</p>
</li>
<li>
<p>If the theme you wish to remove is the active theme, be sure to switch to a different theme first.</p>
</li>
<li>
<p>Select the theme you wish to remove from the list of themes and click the “Remove” button.<br>
<img align="center" src="https://i0.wp.com/blog.rstudio.com/images/2018-10-29-remove-theme-step-1.png?w=456&ssl=1" data-recalc-dims="1"></p>
</li>
<li>
<p>Select “Yes” when prompted for confirmation.<br>
<img align="center" src="https://i0.wp.com/blog.rstudio.com/images/2018-10-29-remove-theme-step-2.png?w=456&ssl=1" data-recalc-dims="1"></p>
</li>
</ol>
<h2>Sharing Themes</h2>
<p>If you’ve found (or made) a really cool theme that you want to share, you can do so just by sharing the tmTheme or rstheme file. Then the recipient can import it as per the instructions in the <a rel="nofollow" href="https://blog.rstudio.com/2018/10/29/rstudio-ide-custom-theme-support/#importing-a-custom-theme" target="_blank">Importing a Custom Theme section</a>. There is no difference between sharing the tmTheme file, or the rstheme file that is generated after the theme gets imported to RStudio, unless you or someone else has made changes to the rstheme file itself.</p>
<p>rstheme files can be found in the <code>.R</code> directory under your home directory. On Windows, the path is <code>C:\Users\</code>