Open Tools → Global Options → Appearance, choose a dark Editor theme, and apply it. RStudio has separate settings for the overall interface and the code editor.
Change the editor and surrounding interface
- Open RStudio and go to the Appearance settings.
- Choose Modern or Sky as the RStudio theme.
- Select a dark editor palette, such as Tomorrow Night or Solarized Dark, if it is listed in your installation.
- Use the preview to check comments, selected text and error highlighting. Click Apply, then OK.
With Modern or Sky, a dark editor palette also activates the dark appearance of the surrounding interface. Older releases may show an additional Classic interface option; switch away from Classic if only your editor becomes dark.
Change back or troubleshoot
Return to Appearance and select a light editor theme to reverse the change. If you modified an imported theme and the changes do not appear, restart RStudio after saving your work. Choose colors and font sizes that are comfortable for you; dark mode is a preference, not a guarantee of reduced eye strain.
For an illustrated reference, see the Appearance screenshot in the linked Posit guide. If you are editing an .rstheme file, it uses CSS; our guide to CSS rules that do not take effect explains selector and cascade problems.
Sources and verification
Instructions checked against Posit documentation. RStudio desktop interaction was not independently executed for this revision.
