Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Notepad ++ not recognizing R language

Tags:

I was reviewing a .rmd file of a colleague for an R script today and realized the style functionality was not working. I am new to this way of R coding and so wanted it in what I am used to reading and so renamed the script a .r so that the style functionality would be enabled.

The style format appeared but then I realized at some point it was no longer working again. Now I can't get Notepad++ to recognize my R scripts (those with a .r in the file naming convention) and can't figure out why.

Should R be a choice in the language selection drop down menu?

When I go to -> Settings -> Style Configurator the recent Style is selected but the colors for the comments (for instance) don't match. They should be green and they are not. I am using Notepadd++ 6.5.5. I would update but our IT department makes it very difficult to do this.

like image 898
Josh R. Avatar asked Jul 11 '16 23:07

Josh R.


People also ask

How do I run an R code from Notepad ++?

I navigate to the folder and double-click on the R script (which has a . R extension) to open it in Notepad++. I place the cursor in the first line of code and press F8 to run the line. NppToR will now open R, with the working directory set to the folder with the script.


2 Answers

Remove R key from REBOL section in the file ‘langs.xml’ (path: user\AppData\Roaming\Notepad++\langs.xml )

Line 301 by default is:

<Language name=“rebol” ext=" r reb" commentLine=";" commentStart="" commentEnd="">

The messed up part is ext=" r reb". It should just say ext=“reb” Change that, save the file and you are all set.

See:

https://notepad-plus-plus.org/community/topic/14363/r-file-association-messed-up

like image 54
Miklos Kallo Avatar answered Sep 28 '22 13:09

Miklos Kallo


1.Check if checkbox Enable Global foreground colour is off in settings -> -> Style Configurator -> global stylers -> global override .
2.Try changing color theme.
3.Check R's lang syntax colors in Style Configurator.

like image 25
BladeMight Avatar answered Sep 28 '22 12:09

BladeMight