RStudio keyboard shortcuts
RStudio's current Posit guide publishes defaults for the command palette, console, source editor, completions, panes, help, builds, debugging, plots, version control, sessions, terminals, and menus. This reference keeps Windows, Linux, and macOS differences explicit.
Windows, macOS, Linux · 204 shortcutsCommand palette and accessibility
Open the searchable command palette and move focus among RStudio panes and accessibility controls.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Show the Command PaletteFirefox on Windows and Linux also documents Ctrl+Alt+Shift+P. | CtrlShiftP | ShiftCmdP | CtrlShiftP |
| Toggle screen reader support | AltShift/ | CtrlOption/ | AltShift/ |
| Speak the text editor location | AltShift1 | CtrlOption1 | AltShift1 |
| Focus console outputAlt+Shift+2 on Windows and Linux, or Ctrl+Option+2 on macOS, is also documented. | Ctrl` | Ctrl` | Ctrl` |
| Toggle Tab key always moves focus | AltShift[ | CtrlOption[ | AltShift[ |
| Focus the next pane | F6 | F6 | F6 |
| Focus the previous pane | ShiftF6 | ShiftF6 | ShiftF6 |
| Focus the main toolbar | AltShiftY | CtrlOptionY | AltShiftY |
Console
Move to the console, clear it, edit the current command line, browse history, and interrupt a running command.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Move the cursor to the Console | Ctrl2 | Ctrl2 | Ctrl2 |
| Clear the console | CtrlL | CtrlL | CtrlL |
| Move the cursor to the beginning of the line | Home | CmdLeft | Home |
| Move the cursor to the end of the line | End | CmdRight | End |
| Navigate command historyDown Arrow moves in the opposite direction. | Up Arrow | Up Arrow | Up Arrow |
| Open the command history popup | CtrlUp | CmdUp | CtrlUp |
| Interrupt the currently executing command | Escape | Escape | Escape |
| Change the working directory | CtrlShiftH | CtrlShiftH | CtrlShiftH |
Source structure and tabs
Fold code, jump to lines or sections, change tab focus, navigate history, and extract symbols from the source editor.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Fold selected code | AltL | OptionCmdL | AltL |
| Unfold selected code | ShiftAltL | OptionShiftCmdL | ShiftAltL |
| Fold all code | AltO | OptionCmdO | AltO |
| Unfold all code | ShiftAltO | OptionShiftCmdO | ShiftAltO |
| Go to a line | ShiftAltG | OptionShiftCmdG | ShiftAltG |
| Jump to | ShiftAltJ | OptionShiftCmdJ | ShiftAltJ |
| Expand selection | CtrlShiftUp | CtrlOptionShiftUp | CtrlShiftUp |
| Shrink selection | CtrlShiftDown | CtrlOptionShiftDown | CtrlShiftDown |
| Go to the next section | CtrlPage Down | CtrlPage Down | CtrlPage Down |
| Go to the previous section | CtrlPage Up | CtrlPage Up | CtrlPage Up |
| Split into lines | CtrlAltA | CtrlAltA | CtrlAltA |
| Edit lines from the start | CtrlAltShiftA | CtrlAltShiftA | CtrlAltShiftA |
| Switch to a tab | CtrlShift. | CtrlShift. | CtrlShift. |
| Go to the previous tabCtrl+Alt+Left on Windows and Linux, or Ctrl+Option+Left on macOS, is also listed. | CtrlF11 | CtrlF11 | CtrlF11 |
| Go to the previous tab on desktop | CtrlShiftTab | CtrlShiftTab | CtrlShiftTab |
| Go to the next tabCtrl+Alt+Right on Windows and Linux, or Ctrl+Option+Right on macOS, is also listed. | CtrlF12 | CtrlF12 | CtrlF12 |
| Go to the next tab on desktop | CtrlTab | CtrlTab | CtrlTab |
| Go to the first tab | CtrlShiftF11 | CtrlShiftF11 | CtrlShiftF11 |
| Go to the last tab | CtrlShiftF12 | CtrlShiftF12 | CtrlShiftF12 |
| Navigate back | CtrlF9 | CmdF9 | CtrlF9 |
| Navigate forward | CtrlF10 | CmdF10 | CtrlF10 |
| Extract a function from the selection | CtrlAltX | OptionCmdX | CtrlAltX |
| Extract a variable from the selection | CtrlAltV | OptionCmdV | CtrlAltV |
| Reindent lines | CtrlI | CmdI | CtrlI |
| Comment or uncomment the current line or selection | CtrlShiftC | ShiftCmdC | CtrlShiftC |
| Reflow a comment | CtrlShift/ | CtrlShift/ | CtrlShift/ |
| Reformat the selection | CtrlShiftA | ShiftCmdA | CtrlShiftA |
| Show diagnostics for the current project | CtrlShiftAltD | OptionShiftCmdD | CtrlShiftAltD |
| Move lines up or downDown moves in the opposite direction. | AltUp | OptionUp | AltUp |
| Copy lines up or downDown moves in the opposite direction. | ShiftAltUp | OptionCmdUp | ShiftAltUp |
| Jump to the matching brace or parenthesis | CtrlP | CtrlP | CtrlP |
| Expand to the matching brace or parenthesis | CtrlShiftAltE | CtrlShiftE | CtrlShiftAltE |
| Add a cursor above the current cursor | CtrlAltUp | CtrlOptionUp | CtrlAltUp |
| Add a cursor below the current cursor | CtrlAltDown | CtrlOptionDown | CtrlAltDown |
| Move the active cursor up | CtrlAltShiftUp | CtrlOptionShiftUp | CtrlAltShiftUp |
| Move the active cursor down | CtrlAltShiftDown | CtrlOptionShiftDown | CtrlAltShiftDown |
Find and editing
Search and replace text, select ranges, delete words, indent code, and insert common R syntax from the editor.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Find and replace | CtrlF | CmdF | CtrlF |
| Find the next matchLinux uses Ctrl+G instead of F3. | F3 | CmdG | F3 |
| Find the previous matchLinux uses Ctrl+Shift+G instead of Shift+F3. | ShiftF3 | ShiftCmdG | ShiftF3 |
| Use the selection for Find | CtrlF3 | CmdE | CtrlF3 |
| Replace and find | CtrlShiftJ | ShiftCmdJ | CtrlShiftJ |
| Find in files | CtrlShiftF | ShiftCmdF | CtrlShiftF |
| Check spelling | F7 | F7 | F7 |
| Rename a symbol in scope | CtrlAltShiftM | OptionShiftCmdM | CtrlAltShiftM |
| Insert an Roxygen skeleton | CtrlShiftAltR | OptionShiftCmdR | CtrlShiftAltR |
| Undo | CtrlZ | CmdZ | CtrlZ |
| Redo | CtrlShiftZ | ShiftCmdZ | CtrlShiftZ |
| Cut | CtrlX | CmdX | CtrlX |
| Copy | CtrlC | CmdC | CtrlC |
| Paste | CtrlV | CmdV | CtrlV |
| Paste with indent | CtrlShiftV | ShiftCmdV | CtrlShiftV |
| Select all | CtrlA | CmdA | CtrlA |
| Jump to the previous or next wordRight moves in the opposite direction. | CtrlLeft | OptionLeft | CtrlLeft |
| Jump to the start or endThe source also lists Ctrl+Up and Ctrl+End on Windows and Linux, and Cmd+Down on macOS. | CtrlHome | CmdUp | CtrlHome |
| Delete a line | CtrlD | CmdD | CtrlD |
| Select with the arrow keys | ShiftArrow keys | ShiftArrow keys | ShiftArrow keys |
| Select a wordRight moves in the opposite direction. | CtrlShiftLeft | OptionShiftLeft | CtrlShiftLeft |
| Select to the line start | AltShiftLeft | ShiftCmdLeft | AltShiftLeft |
| Select to the line end | AltShiftRight | ShiftCmdRight | AltShiftRight |
| Select a page up or downPage Down moves in the opposite direction. | ShiftPage Up | ShiftPage Up | ShiftPage Up |
| Select to the start or endThe source also lists Ctrl+Shift+End and Shift+Alt+Down on Windows and Linux, and Shift+Cmd+Down on macOS. | CtrlShiftHome | ShiftCmdUp | CtrlShiftHome |
| Delete the word to the leftThe source also lists Ctrl+Option+Backspace on macOS. | CtrlBackspace | OptionBackspace | CtrlBackspace |
| Delete the word to the right | Not documented | OptionDelete | Not documented |
| Delete to the line end | Not documented | CtrlK | Not documented |
| Delete to the line start | Not documented | OptionBackspace | Not documented |
| Indent at the beginning of a line | Tab | Tab | Tab |
| Outdent | ShiftTab | ShiftTab | ShiftTab |
| Yank the line up to the cursor | CtrlU | CtrlU | CtrlU |
| Yank the line after the cursor | CtrlK | CtrlK | CtrlK |
| Insert currently yanked text | CtrlY | CtrlY | CtrlY |
| Insert the assignment operator | Alt- | Option- | Alt- |
| Insert the pipe operator | CtrlShiftM | ShiftCmdM | CtrlShiftM |
| Show help for the function at the cursor | F1 | F1 | F1 |
| Show source code for the function at the cursor | F2 | F2 | F2 |
| Find usages for a symbol at the cursorThe source limits this to C++. | CtrlAltU | OptionCmdU | CtrlAltU |
Completions and views
Accept code completions and move focus or zoom among RStudio's source, console, help, files, plots, packages, and panes.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Attempt completionCtrl+Space on Windows and Linux, or Command+Space on macOS, is also documented. | Tab | Tab | Tab |
| Navigate completion candidatesDown Arrow moves in the opposite direction. | Up Arrow | Up Arrow | Up Arrow |
| Accept the selected completionTab and Right Arrow are also documented. | Enter | Enter | Enter |
| Dismiss the completion popup | Escape | Escape | Escape |
| Move focus to the Source Editor | Ctrl1 | Ctrl1 | Ctrl1 |
| Zoom the Source Editor | CtrlShift1 | CtrlShift1 | CtrlShift1 |
| Move focus to the Console | Ctrl2 | Ctrl2 | Ctrl2 |
| Zoom the Console | CtrlShift2 | CtrlShift2 | CtrlShift2 |
| Move focus to Help | Ctrl3 | Ctrl3 | Ctrl3 |
| Zoom Help | CtrlShift3 | CtrlShift3 | CtrlShift3 |
| Move focus to the Terminal | AltShiftM | OptionShiftM | AltShiftM |
| Show History | Ctrl4 | Ctrl4 | Ctrl4 |
| Zoom History | CtrlShift4 | CtrlShift4 | CtrlShift4 |
| Show Files | Ctrl5 | Ctrl5 | Ctrl5 |
| Zoom Files | CtrlShift5 | CtrlShift5 | CtrlShift5 |
| Show Plots | Ctrl6 | Ctrl6 | Ctrl6 |
| Zoom Plots | CtrlShift6 | CtrlShift6 | CtrlShift6 |
| Show Packages | Ctrl7 | Ctrl7 | Ctrl7 |
| Zoom Packages | CtrlShift7 | CtrlShift7 | CtrlShift7 |
| Show Environment | Ctrl8 | Ctrl8 | Ctrl8 |
| Zoom Environment | CtrlShift8 | CtrlShift8 | CtrlShift8 |
| Show Viewer | Ctrl9 | Ctrl9 | Ctrl9 |
| Zoom Viewer | CtrlShift9 | CtrlShift9 | CtrlShift9 |
| Show Git or SVN | CtrlF1 | CmdF1 | CtrlF1 |
| Zoom Git or SVN | CtrlShiftF1 | CtrlShiftF1 | CtrlShiftF1 |
| Show Build | CtrlF2 | CmdF2 | CtrlF2 |
| Zoom Build | CtrlShiftF2 | CtrlShiftF2 | CtrlShiftF2 |
| Show Connections | CtrlF5 | CtrlF5 | CtrlF5 |
| Zoom Connections | CtrlShiftF5 | CtrlShiftF5 | CtrlShiftF5 |
| Zoom Tutorial | CtrlShiftF6 | CtrlShiftF6 | CtrlShiftF6 |
| Show Find in Files results | CtrlF6 | CmdF6 | CtrlF6 |
| Sync the editor and PDF preview | CtrlF8 | CmdF8 | CtrlF8 |
| Zoom the left column | CtrlAltShiftF12 | CtrlOptionShiftF12 | CtrlAltShiftF12 |
| Zoom the right column | CtrlAltShiftF11 | CtrlOptionShiftF11 | CtrlAltShiftF11 |
| Show all panes | CtrlAltShift0 | CtrlAlt0 | CtrlAltShift0 |
| Add a source column | CtrlF7 | CmdF7 | CtrlF7 |
| Open global options | Not documented | Cmd, | Not documented |
| Open project options | Not documented | ShiftCmd, | Not documented |
Help, build, and debug
Open RStudio help, install or check packages, and control the debugger with the current Posit key map.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Show the keyboard shortcut reference | AltShiftK | OptionShiftK | AltShiftK |
| Search R Help | CtrlAltF1 | CtrlOptionF1 | CtrlAltF1 |
| Find in a Help topic | CtrlF | CmdF | CtrlF |
| Open the previous Help topic | ShiftAltF2 | OptionShiftF2 | ShiftAltF2 |
| Open the next Help topic | ShiftAltF3 | OptionShiftF3 | ShiftAltF3 |
| Install and restart | CtrlShiftB | ShiftCmdB | CtrlShiftB |
| Load all development tools | CtrlShiftL | ShiftCmdL | CtrlShiftL |
| Test a package on desktop | CtrlShiftT | ShiftCmdT | CtrlShiftT |
| Test a package on the web | CtrlAltF7 | OptionCmdF7 | CtrlAltF7 |
| Check a package | CtrlShiftE | ShiftCmdE | CtrlShiftE |
| Document a package | CtrlShiftD | ShiftCmdD | CtrlShiftD |
| Toggle a breakpoint | ShiftF9 | ShiftF9 | ShiftF9 |
| Execute the next line | F10 | F10 | F10 |
| Step into a function | ShiftF4 | ShiftF4 | ShiftF4 |
| Finish a function or loop | ShiftF7 | ShiftF7 | ShiftF7 |
| Continue debugging | ShiftF5 | ShiftF5 | ShiftF5 |
| Stop debugging | ShiftF8 | ShiftF8 | ShiftF8 |
Plots, Git, sessions, and terminal
Move between plots, review Git changes, stage files, restart sessions, and switch among RStudio terminal instances.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Show the previous plot | CtrlAltF11 | OptionCmdF11 | CtrlAltF11 |
| Show the next plot | CtrlAltF12 | OptionCmdF12 | CtrlAltF12 |
| Diff the active source document | CtrlAltD | CtrlOptionD | CtrlAltD |
| Commit changes | CtrlAltM | CtrlOptionM | CtrlAltM |
| Scroll the diff viewDown moves in the opposite direction. | CtrlUp | CtrlUp | CtrlUp |
| Stage or unstage in Git | Space | Space | Space |
| Stage or unstage and move to the next item | Enter | Enter | Enter |
| Quit the desktop session | CtrlQ | CmdQ | CtrlQ |
| Restart the R session | CtrlShiftF10 | ShiftCmd0 | CtrlShiftF10 |
| Open a new terminal | ShiftAltR | OptionShiftR | ShiftAltR |
| Move focus to the terminal | ShiftAltM | OptionShiftM | ShiftAltM |
| Go to the previous terminal | ShiftAltF11 | OptionShiftF11 | ShiftAltF11 |
| Go to the next terminal | ShiftAltF12 | OptionShiftF12 | ShiftAltF12 |