8 Keyboard Shortcuts
Keyboard shortcuts tend to make our lives easier. Some that you might already be familiar with in day to day life include quickly saving (Cmd + S or Ctrl + S), or Undo (Cmd + Z or Ctrl + Z).
There are many keyboard shortcuts that you can access in R, this section provides a brief tour of them, and why you might want to use them.
8.5 Table of Common Shortcuts
Below is a small table of tasks you can perform with keyboard
Action | Windows/Linux | Mac |
---|---|---|
Knit document | Ctrl + Shift + K | Cmd + Shift + K |
Insert Chunk | Ctrl + Alt + I | Cmd + Option + I |
Run Current Chunk | Ctrl + Alt + C | Cmd + Option + C |
Jump to Shift+Alt+J | Cmd+Shift+Option+J | |
Show Keyboard Shortcut Reference | Alt+Shift+K | Option+Shift+K |
Create multiple cursors | Ctrl + Alt + Up/Down | option + control + Up/Down |
Delete the current line | Ctrl + D | Cmd + D |
Un/Comment out a line | Ctrl + Shift + C | Cmd + Shift + C |
Reformat Section | Ctrl + Shift + A | Cmd + Shift + A |
8.6 Further Reading
- The https://www.rstudio.com/wp-content/uploads/2016/01/rstudio-IDE-cheatsheet.pdf has an index of shortcuts.
- This [https://support.rstudio.com/hc/en-us/articles/206382178-Customizing-Keyboard-Shortcuts] help file has a guide to customising keyboard shortcuts.