Many people, including myself, might not like editing .r (source) files in R itself. Therefore I present you a very ingenious way of avoiding this.
“NppToR provides R language syntax highlighting, code folding, and auto-completion to Notepad++. In addition, it provides Rgui style code passing between Notepad++ and the Rgui.”
Open NppToR by clicking on . In the settings window we can see/edit which hot-keys to use and adjust a few thing.
An .r file in notepadd++ now look like
Passing it to R ( F8 (lines), ^F8 (file) ) results in the following