define rstudio editor theme in project file?

Apologies if this has been already answered elsewhere. Is there a way to define RStudio's theme in a R project file? It's a minor thing, but I frequently work on different computers and every time I open a project I have to re-define the editor's theme manually. Was wondering whether there is a way to automatically take care of it. I could imagine that if falls outside of the scope of what project files are originally meant for.

Many thanks!

This isn't a current feature, although an issue has been filed in the GitHub repo.

1 Like

I see. Many thanks. Could there be a work-around with a Rprofile.site file? Just wondering....

Unfortunately Rprofile.site or .Rprofile won't work because the code executed there is executed outside of the RStudio context. The rstudioapi::applyTheme() function allows you to programmatically change the RStudio theme, but again, it will not run from .Rprofile. More discussion can be found in this issue.

2 Likes

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.