I've customized a dark theme for Rstudio. The color I've used for comments has odd behavior in .Rmd (R Markdown) documents. It displays nice and bright normally, until I click inside a chunk, then the color dims. It's a small issue, but irritating, and makes the text harder to read. As I scroll down the document, previously dim sections will return to being bright, then return to being dim when I click in the chunk. I have also altered the chunk highlighting for better visibility.
In addition, when selecting themes under Global Options, I need to click on the theme twice for it to display in the example box. For some reason, it seems my system isn't handling the themes as expected.
I'm new to styles/themes/CSS, but I thought there might be an issue with the order my edits were written in.
The edits for the chunk highlighting and comment color are on lines:
101
81
Here is the theme file in question
https://github.com/captaincaed/rstudio/blob/main/vibrant_ink_SB_2.rstheme
Here is a Windows error log (seems to open best in Word, may open in a browser as well)
https://github.com/captaincaed/rstudio/blob/main/Recording_20210119_1453.mht
RStudio
Version 1.4.1103
Windows 10
Thanks in advance!
Related
I'm having trouble soft wrapping .R source files in the text editor in Rstudio Version 1.4.1717. I have tried to follow advice given online but it dosn't seem to change anything on my screen. It seems it should be fairly simple using the advice here:
Disable horizontal scroll in the Source of RStudio
and here:
wrap code in R Studio text editor
I have tried various things like ticking and unticking "soft wrap R source files check box", selecting all text in the text editor before re-trying, closing and restarting Rstudio etc...but still doesn't seem to work. I'm not sure if I'm missing something really obvious?!
Update: I managed to get it working if I start a new file (File > New File > R script). Please see here:
R studio image
However, this does not seem to work for R scripts that I had already created. The bottom right of the source window, does indeed say "R Script".
Update 2
I managed to get this working if I copy pasted the entire R script to a new file ((File > New File > R script), as opposed to re-saving the current file as a newer version (using File > Save As...")
When I went to save the file, a pop-up box appeared which asked me "Choose Encoding" for which I selected the default. I wonder if the previous file had a different encoding which meant the text wrapping could not work properly? Strangely, much earlier versions of the file did NOT have any problems when when using the wrap text functionality. So it seems that something happened to one of the recent versions that is causing the issue.
Do you remember to click apply before the ok button after checking the box?
You need not restart RStudio to get the change effected.
This is similar to the recent issue posed by jtr13 where the order of sections in the page sidebar have changed, however I'm missing sections from the page entirely. Rmd files 02- though 09- don't have their respective html files showing up.
I've installed and rerendered using 0.10 and the developer version on GitHub, but haven't seen the page (being hosted on GitHub) update.
I've resolved the issue myself by looking more closely at the commit where the disappearance happened. In the middle of one of the Rmd files, I had placed:
----
Other Variables
----
to try to represent a new section with a horizontal rule without it being numbered. This was likely interpreted during the render as a new section/YAML and subsequently turned the later page sections into code confetti.
For markdown there is a shortcut like typing a number(1,2,3,4..) in command mode (Esc) and then giving an Enter
The thing is that your cursor gets before the "###" (if you used 3) where you also need to click the End key to be able to write.
Is there a way to overcome the last action as it is very annoying.
What you already have is a one click solution, which is going to be hard to beat. The only improvement I can think of is to override the functionality that's inserting the markdown headings for you. You could extend it to also place the cell in edit mode and move the cursor to the end. This would be placed in your custom.js file, which you place here: ~/.jupyter/custom/custom.js.
I'm using RStudio 1.1.383 and R 3.4.3 and I'm trying to apply a theme under Options > Appearance only to the background text area of the source pane and the console pane. This is exactly what happens when I apply a theme on my desktop computer (Win10), but when I apply a theme on my laptop (also Win10), it applies the theme to the entire GUI except for the top menu bar (i.e. File, Edit, Code, etc). The result looks jarring. Why might themes be behaving differently between my two computers which use identical setups? Is there an option that I might have selected somewhere on one and not the other that would cause the theme to apply to just the text area of a couple panes in one case and the entire GUI in the other?
This is a change in RStudio v1.1 -- now, when a 'dark' editor theme is selected, the entire IDE will be themed to match that.
If you'd prefer to have a dark editor theme with a light IDE theme, that's unfortunately not possible in v1.1. You might want to file a feature request at https://github.com/rstudio/rstudio/issues.
I am trying to alter an RStudio Editor Themes so that I can set my own colors. I'm using RStudio version 0.99.473 on Windows 10.
I've reviewed Any way to change colors in Rstudio to something other than default options? which was extremely helpful as well as Editing R Studio them in cashe.css theme file (ACE editor?)
I am trying to identify what the different .ace_ items in the RStudio Editor Theme CSS files (ACE editor code) correspond to. The CSS files are found in /www/rstudio/ within RStudio's install path. An example of the script is found on GitHub for the Tomorrow theme.
In particular, I'm looking to see how to color variables (that I define) differently from functions. For example in x <- rnorm(10,0,10), I'd like x and rnorm to be colored differently. Not sure if that's possible.
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.
I think you are looking for customising the RStudio theme and I think in that case
You can check out the following link:
This website gives you several options to customize
https://tmtheme-editor.herokuapp.com/#!/editor/theme/Azure
This is how it works
Once you are done customizing download them.
Later you can add the theme in the "add" options while setting a theme in your RStudio
Hope this was helpful
Happy Coding :)
I found (2022) the theme files in
C:\Users\<my user>\AppData\Roaming\RStudio\themes