How to Customize your RStudio Theme (Finally) | by Brad Lindblad | Towards Data Science

When my brain is tapped out after a grueling morning of data sciencing, my browser will invariably point to a smorgasbord of websites that RescueTime will classify as “entertainment.” From the Hot Network Questions page on Stack Overflow (“Question: why do demons heal faster than angels?”) to looking into Hadley’s commits for the last six months.
After I feel like I’ve seen the entire internet, I’ll sometimes start fiddling with my IDE theme, as if changing the hex color of my function calls will actually improve my work. It’s not that my current font or color scheme aren’t perfectly fine, it’s the juicy rationalization that I’ll actually work faster if I have some dope ligatures.
I reinforce my obsession with these minutia by reminding myself what Oliver Wendell Holmes said way back in the 19th century; supposedly regarding his Win95 settings:
“A moment’s insight is sometimes worth a life’s experience”
So maybe, all of this sharpening of the axe, so to speak, is actually beneficial. Maybe, it makes us more suseptible to positive black swans. There, that’s a healthy rationalization!
I work in RStudio a lot, and while there’s been excellent themes and styles available for most IDEs and text editors like Sublime, Atom, Visual Studio Code for years, we RStudio peeps have been limited in this area. We’ve had a few basic themes and that’s about it.
Welp, that all changed a few months ago. RStudio v1.2xxx Preview was released in October and has a host of new features, including:
D3 capabilities
Ability to run R jobs in the background
More SQL functionality
Cool plumbr API tools
But for us, the sweetest feature is the ability to import our own themes! This article will quickly run through how we can duplicate the Panda syntax theme in RStudio.
Let’s get to it.
RStudio now lets you upload .tmThemes and .rsThemes files. I hacked together a Panda-like theme and put it in a repo for you to download. I’ve also included an awesome font called “Fira Code iScript” in the repo, which we’ll get to later. Download the files with this git command:
git clone https://github.com/bradlindblad/rstudio-panda.git
Fira Code iScript is an excellent font put together by Ken Crocken which is a mash up of Fira Code and Script12. This font applies the Script12 typeface wherever there are italics, and Fira code everywhere else. To install it, double click on the .tff files you downloaded and then install the fonts in your system, which will be different for each OS.
It will end up looking like this:
Pretty cool, eh? To use this font in RStudio, follow these steps:
Open up RStudio, if you haven’t already
Navigate to Tools > Global Options > Appearance
Use the Editor Font box to select Fira Code iScript
Note that you can install pretty much any font you want by following this process.
Next we’ll install the panda theme. Follow along:
Navigate to Tools > Global Options > Appearance
Under the Editor Theme box, click Add
Navigate to the panda.thTheme file that you cloned
Hit Open
Now all you need is a quick restart and you’re rocking a new sweet theme! This is what it looks like in my system (Linux Mint 19, Dark):
Nice!
If the panda theme doesn’t do it for you, you can make your own with this online editor. This allows you to make any kind of custom theme you want. You just need to download the theme from the website and upload it to RStudio like we did above.
Good luck in your procrastinations!