
Console
| macOS | Action | |
|---|---|---|
| Ctrl+2 | Move cursor to console | |
| Ctrl+L | Clean console | |
| Command+Left | Move cursor to beginning of line | |
| Command+Right | Move cursor to end of line | |
| Up/Down | Navigate command history | |
| Command+Up | Popup command history | |
| Esc | Interrupt currently executing command | |
| Ctrl+Shift+H | Change working directory |
Source
| macOS | Action | |
|---|---|---|
| Ctrl+. | Goto file/function | |
| Ctrl+1 | Move cursor to source editor | |
| Command+Shift+N | New document (except on chrome/windows) | |
| Command+Option+Shift+N | New document (Chrome only) | |
| Command+O | Open document | |
| Command+S | Save active document | |
| Command+W | Close active document (except on Chrome) | |
| Command+Option+W | Close active document (Chrome only) | |
| Command+Shift+W | Close all open documents | |
| Command+Shift+K | Preview HTML (markdown and HTML) | |
| Command+Shift+K | Compile notebook/compile PDF (TeX and Sweave) | |
| Command+Option+I | Insert chunk (Sweave and Knitr) | |
| Command+Shift+R | Insert code section | |
| Command+Enter | Run current line/selection | |
| Option+Enter | Run current line/selection (retain cursor position) | |
| Command+Shift+P | Re-run previous region | |
| Command+Option+R | Run current document | |
| Command+Option+B | Run from document beginning to current line | |
| Command+Option+E | Run from current line to document end | |
| Command+Option+F | Run from current line to document end | |
| Command+Option+T | Run the current code section | |
| Command+Option+P | Run previous sweave/Rmd code | |
| Command+Option+C | Run the current Sweave/Rmd chunk | |
| Command+Option+N | Run the next Sweave/Rmd chunk | |
| Command+Shift+O | Source a file | |
| Command+Shift+S | Source the current document | |
| Command+Shift+Enter | Source the current document (with echo) | |
| Command+Option+L | Fold selected | |
| Command+Shift+Option+L | Unfold selected | |
| Commad+Option+O | Fold all | |
| Commad+Shift+Option+O | Unfold all | |
| Commad+Shift+Option+G | Go to line | |
| Commad+Shift+Option+J | Jump to | |
| Ctrl+Shift+. | Switch to tab | |
| Ctrl+F11 | Previous tab | |
| Ctrl+F12 | Next tab | |
| Ctrl+Shift+F11 | First tab | |
| Ctrl+Shift+F12 | Last tab | |
| Command+F9 | Navigate back | |
| Command+F10 | Navigate forward | |
| Command+Option+X | Extract function from selection | |
| Command+Option+V | Extract variable from selection | |
| Command+I | Reindent lines | |
| Command+Shift+C | Comment/uncomment current line/selection | |
| Command+Shift+/ | Reflow comment | |
| Command+Shift+A | Reformat selection | |
| Command+Shift+Shift+P | Show diagnostics | |
| Option+Up/Down | Move lines Up/Down | |
| Command+Option+Up/Down | Copy lines Up/Down | |
| Ctrl+P | Jump to matching Brace/Paren | |
| Ctrl+Shift+E | Expand to matching Brace/Paren | |
| Command+Shift+Option+E | Select to matching Brace/Paren | |
| Ctrl+Option+Up | Add cursor above current cursor | |
| Command+Option+Down | Add cursor beow current cursor | |
| Ctrl+Option+Shift+Up | Move active cursor up | |
| Ctrl+Option+Shift+Down | Move Active Cursor Down | |
| Command+F | Find and replace | |
| Commad+G | Find next | |
| Commad+Shift+F3 | Find previous | |
| Command+E | Use selection for find | |
| Command+Shift+J | Replace and find | |
| Command+Shift+F | Find in files | |
| F7 | Check spelling |
Completions (Console and Source)
| macOS | Action | |
|---|---|---|
| Tab/Command+Space | Attempt completion | |
| Up/Down | Navigate candidates | |
| Enter/Tab/Right | Accept selected candidate | |
| Esc | Dismiss completion popup |
Views
| macOS | Action | |
|---|---|---|
| Command+1 | Move focus to Source Editor | |
| Command+2 | Move focus to Console | |
| Command+3 | Move focus to Help | |
| Command+4 | Show History | |
| Command+5 | Show files | |
| Command+6 | Show plots | |
| Command+7 | Show packages | |
| Command+8 | Show environment | |
| Command+9 | Show git/svn | |
| Command+0 | Show build | |
| Command+F8 | Sync editor & pdf preview | |
| Option+Shift+K | Reference |
Build
| macOS | Action | |
|---|---|---|
| Command+Shift+B | Build and reload | |
| Command+Shift+L | Load all (devtools) | |
| Command+Shift+T | Test package (desktop) | |
| Command+Option+F7 | Test package (web) | |
| Command+Shift+E | Check package | |
| Command+Shift+D | Document package |
Debug
| macOS | Action | |
|---|---|---|
| Shift+F9 | Toggle breakpoint | |
| F10 | Execute next line | |
| Shift+F4 | Step into function | |
| Shift+F6 | Finish function/loop | |
| Shift+F5 | Continue | |
| Shift+F8 | Stop debugging |
Plots
| macOS | Action | |
|---|---|---|
| Command+Option+F11 | Previous plot | |
| Command+Option+F12 | Next plot |
Git / SVN
| macOS | Action | |
|---|---|---|
| Ctrl+Option+D | Diff active source document | |
| Ctrl+Option+M | Commit changes | |
| Ctrl+Up/Down | Scroll diff view | |
| Spacebar | Stage/unstage(Git) | |
| Enter | Stage/unstage and move to next (Git) |
Session
| macOS | Action | |
|---|---|---|
| Command+Q | Quit Session (desktop only) | |
| Command+Shift+F10 | Restart R Session |
Editing (Console and Source)
| macOS | Action | |
|---|---|---|
| Command+Z | Undo | |
| Command+Shift+Z | Redo | |
| Command+X | Cut | |
| Command+C | Copy | |
| Command+V | Paste | |
| Command+A | Select all | |
| Command+Left/Right | Jump to word | |
| Command+Home/End/Command+Up/Down | Jump to start/end | |
| Command+D | Delete line | |
| Shift+Arrow | Select | |
| Option+Shift+Left/Right | Select word | |
| Command+Shift+Left | Select to line start | |
| Command+Shift+RIght | Select to line end | |
| Shift+Page Up/Shift+Page down | Select page up/down | |
| Command+Shift+Home/End | Select page start/end | |
| Option+Backspace | Delete word left | |
| Tab | Indent | |
| Shift+Tab | Outdent | |
| Ctrl+U | Yank line up to cursor | |
| Ctrl+K | Yank line after cursor | |
| Ctrl+Y | Insert currently yanked text | |
| Option+- | Insert assignment operator | |
| Command+Shift+M | Insert pipe operator | |
| F1 | Show help for function at cursor | |
| F2 | Show source code for function at cursor | |
| Command+Option+U | Find usages for symbol at cursor (C++) |