Mac: option + cmd + I
Windows/Linux: ctrl + alt + I
Mac: cmd + shift + M
Windows/Linux: ctrl + shift + M
Mac: cmd + return/enter
Windows/Linux: ctrl + enter
Mac: cmd + shift + K
Windows/Linux: ctrl + shift + K
Mac: option + -
Windows/Linux: alt + -
Mac: cmd + shift + F
Windows/Linux: ctrl + shift + F
Mac: cmd + I
Windown/Linux: ctrl + I
Mac: cmd + F
Windows/Linux: ctrl + F
Mac: cmd + +
Windows/Linux: ctrl + +
Mac: cmd + -
Windows/Linux: ctrl + -
Mac: cmd + Z
Windows/Linux: ctrl + Z
Mac: cmd + X
Windows/Linux: ctrl + X
Mac: cmd + C
Windows/Linux: ctrl + C
Mac: cmd + V
Windows/Linux: ctrl + V
Mac: cmd + S
Windows/Linux: ctrl + S
… and more
Contains add-ins to format code nicely!
# how to install
install.packages("styler")
Restart R and you’ll find the options under Addins! I use style selection the most.
In RStudio, go to the Tools menu and then Keyboard Shortcuts Help or visit this link.
In RStudio, go to the Tools menu and then Modify Keyboard Shortcuts.
You can create your own shortcuts but it is complicated. Here is a nice blospost about it!
8. Comment (and uncomment) out code
Mac: cmd + shift + C
Windown/Linux: ctrl + shift + C