This plugin contains some simple features that helping writing R languages:
- Indentation corrections
- Useful commands
- More comprehensive syntax coloring
- Showing functions' parameters in Symbol List (
cmd+r
)
It corrects the strange behavior when for
, while
, if
, else
and repeat
are used without braces. In this situation, original indentation rule does not indent the next line. e.g.:
Original:
for (i in (1:10))
cat('Hello, baby!')
Now:
for (i in (1:10))
cat('Hello, baby!')
It corrects the extra indentation in case like:
Original:
if (baby==1){
cat("Hello baby!")
} else {
cat("Hello dady!\n")
}
Now:
if (baby==1){
cat("Hello baby!")
} else {
cat("Hello dady!\n")
}
Comment does not affect indentation. e.g.,
Original:
for (i in (1:10)){
1+1
#it is is comment!{
1+1
}
Now:
for (i in (1:10)){
1+1
#it is is comment!{
1+1
}
Keybinding: Cmd-Enter
- Send the selection to R
- If no syntax is selected, it sends the whole line where the cursor stays at.
- See settings to choose default R application to send to.
Keybinding: Cmd-Alt-Enter
- Send the selection to R session in terminal
- An R session needs to be running on terminal.
- If no syntax is selected, it sends the whole line where the cursor stays at.
- Useful for people working on server
Keybinding: Cmd-\
- Change working directory to where the current working script stays
Keybinding: Cmd-.
- Tell R to source the working script
Kepmaps are changable by editing Default (OSX).sublime-keymap
.
Default primary application: R64
Default secondary application: Terminal
- Type
Rapp Switcher
in Command Palette to switch betweenR
,R64
andTerminal
. - Or edit
Rsublime.sublime-settings
to change settings