VS Code keyboard shortcuts
Visual Studio Code's default keybindings in three columns, with the places where Linux differs from Windows marked. Filter by action or keys, then print or download.
Showing all 110 shortcuts.
General 5 shortcuts
| Action | Windows | Mac | Linux |
|---|---|---|---|
| Show the Command Palette | Ctrl+Shift+P or F1 | Shift+Cmd+P or F1 | Ctrl+Shift+P or F1 |
| Quick Open: go to a file by name | Ctrl+P | Cmd+P | Ctrl+P |
| New window | Ctrl+Shift+N | Shift+Cmd+N | Ctrl+Shift+N |
| Open user settings | Ctrl+Comma | Cmd+Comma | Ctrl+Comma |
| Open the keyboard shortcuts editor | Ctrl+K then Ctrl+S | Cmd+K then Cmd+S | Ctrl+K then Ctrl+S |
Basic editing 21 shortcuts
| Action | Windows | Mac | Linux |
|---|---|---|---|
| Cut the line (with nothing selected) | Ctrl+X | Cmd+X | Ctrl+X |
| Copy the line (with nothing selected) | Ctrl+C | Cmd+C | Ctrl+C |
| Move the line up | Alt+Up arrow | Option+Up arrow | Alt+Up arrow |
| Move the line down | Alt+Down arrow | Option+Down arrow | Alt+Down arrow |
| Copy the line up | Shift+Alt+Up arrow | Shift+Option+Up arrow | Ctrl+Shift+Alt+Up arrowDiffers on Linux |
| Copy the line down | Shift+Alt+Down arrow | Shift+Option+Down arrow | Ctrl+Shift+Alt+Down arrowDiffers on Linux |
| Delete the line | Ctrl+Shift+K | Shift+Cmd+K | Ctrl+Shift+K |
| Insert a line below | Ctrl+Enter | Cmd+Return | Ctrl+Enter |
| Insert a line above | Ctrl+Shift+Enter | Shift+Cmd+Return | Ctrl+Shift+Enter |
| Jump to the matching bracket | Ctrl+Shift+Backslash | Shift+Cmd+Backslash | Ctrl+Shift+Backslash |
| Indent the line | Ctrl+Right bracket | Cmd+Right bracket | Ctrl+Right bracket |
| Outdent the line | Ctrl+Left bracket | Cmd+Left bracket | Ctrl+Left bracket |
| Go to the start of the file | Ctrl+Home | Cmd+Up arrow | Ctrl+Home |
| Go to the end of the file | Ctrl+End | Cmd+Down arrow | Ctrl+End |
| Toggle a line comment | Ctrl+Slash | Cmd+Slash | Ctrl+Slash |
| Toggle a block comment | Shift+Alt+A | Shift+Option+A | Ctrl+Shift+ADiffers on Linux |
| Toggle word wrap | Alt+Z | Option+Z | Alt+Z |
| Fold (collapse) the region | Ctrl+Shift+Left bracket | Option+Cmd+Left bracket | Ctrl+Shift+Left bracket |
| Unfold (expand) the region | Ctrl+Shift+Right bracket | Option+Cmd+Right bracket | Ctrl+Shift+Right bracket |
| Fold all regions | Ctrl+K then Ctrl+0 | Cmd+K then Cmd+0 | Ctrl+K then Ctrl+0 |
| Unfold all regions | Ctrl+K then Ctrl+J | Cmd+K then Cmd+J | Ctrl+K then Ctrl+J |
Multi-cursor & selection 13 shortcuts
| Action | Windows | Mac | Linux |
|---|---|---|---|
| Add a cursor where you click. On some Linux desktops Alt+Click is taken; switch it to Ctrl+Click with the editor.multiCursorModifier setting. | Alt+Click | Option+Click | Alt+Click |
| Add a cursor above | Ctrl+Alt+Up arrow | Option+Cmd+Up arrow | Shift+Alt+Up arrowDiffers on Linux |
| Add a cursor below | Ctrl+Alt+Down arrow | Option+Cmd+Down arrow | Shift+Alt+Down arrowDiffers on Linux |
| Undo the last cursor operation | Ctrl+U | Cmd+U | Ctrl+U |
| Add a cursor at the end of each selected line | Shift+Alt+I | Shift+Option+I | Shift+Alt+I |
| Select the current line | Ctrl+L | Cmd+L | Ctrl+L |
| Select all occurrences of the current selection | Ctrl+Shift+L | Shift+Cmd+L | Ctrl+Shift+L |
| Select all occurrences of the current word | Ctrl+F2 | Cmd+F2 | Ctrl+F2 |
| Add the next occurrence to the selection | Ctrl+D | Cmd+D | Ctrl+D |
| Skip: move the last selection to the next occurrence | Ctrl+K then Ctrl+D | Cmd+K then Cmd+D | Ctrl+K then Ctrl+D |
| Expand the selection | Shift+Alt+Right arrow | Control+Shift+Cmd+Right arrow | Shift+Alt+Right arrow |
| Shrink the selection | Shift+Alt+Left arrow | Control+Shift+Cmd+Left arrow | Shift+Alt+Left arrow |
| Column (box) selection | Shift+Alt+Drag | Shift+Option+Drag | Shift+Alt+Drag |
Search & replace 7 shortcuts
| Action | Windows | Mac | Linux |
|---|---|---|---|
| Find | Ctrl+F | Cmd+F | Ctrl+F |
| Replace | Ctrl+H | Option+Cmd+F | Ctrl+H |
| Find the next match | F3 | Cmd+G | F3 |
| Find the previous match | Shift+F3 | Shift+Cmd+G | Shift+F3 |
| Select all matches of the find | Alt+Enter | Option+Return | Alt+Enter |
| Search across files | Ctrl+Shift+F | Shift+Cmd+F | Ctrl+Shift+F |
| Replace across files | Ctrl+Shift+H | Shift+Cmd+H | Ctrl+Shift+H |
Code & language features 12 shortcuts
| Action | Windows | Mac | Linux |
|---|---|---|---|
| Trigger suggestions | Ctrl+Space or Ctrl+I | Control+Space or Cmd+I | Ctrl+Space or Ctrl+I |
| Show parameter hints | Ctrl+Shift+Space | Shift+Cmd+Space | Ctrl+Shift+Space |
| Format the document | Shift+Alt+F | Shift+Option+F | Ctrl+Shift+IDiffers on Linux |
| Format the selection | Ctrl+K then Ctrl+F | Cmd+K then Cmd+F | Ctrl+K then Ctrl+F |
| Go to definition | F12 | F12 | F12 |
| Peek definition | Alt+F12 | Option+F12 | Ctrl+Shift+F10Differs on Linux |
| Open the definition to the side | Ctrl+K then F12 | Cmd+K then F12 | Ctrl+K then F12 |
| Quick Fix | Ctrl+Period | Cmd+Period | Ctrl+Period |
| Show references | Shift+F12 | Shift+F12 | Shift+F12 |
| Rename symbol | F2 | F2 | F2 |
| Trim trailing whitespace | Ctrl+K then Ctrl+X | Cmd+K then Cmd+X | Ctrl+K then Ctrl+X |
| Change the file's language mode | Ctrl+K then M | Cmd+K then M | Ctrl+K then M |
Editors & files 16 shortcuts
| Action | Windows | Mac | Linux |
|---|---|---|---|
| New file | Ctrl+N | Cmd+N | Ctrl+N |
| Open file | Ctrl+O | Cmd+O | Ctrl+O |
| Save | Ctrl+S | Cmd+S | Ctrl+S |
| Save as | Ctrl+Shift+S | Shift+Cmd+S | Ctrl+Shift+S |
| Save all | Ctrl+K then S | Option+Cmd+S | —No default shortcutDiffers on Linux |
| Close the editor | Ctrl+F4 or Ctrl+W | Cmd+W | Ctrl+WDiffers on Linux |
| Close all editors | Ctrl+K then Ctrl+W | Cmd+K then Cmd+W | Ctrl+K then Ctrl+W |
| Reopen the closed editor | Ctrl+Shift+T | Shift+Cmd+T | Ctrl+Shift+T |
| Split the editor | Ctrl+Backslash | Cmd+Backslash | Ctrl+Backslash |
| Focus the first editor group. 2 and 3 focus the second and third groups. | Ctrl+1 | Cmd+1 | Ctrl+1 |
| Open the next editor | Ctrl+Tab | Control+Tab | Ctrl+Tab |
| Open the previous editor | Ctrl+Shift+Tab | Control+Shift+Tab | Ctrl+Shift+Tab |
| Keep a preview editor open | Ctrl+K then Enter | Cmd+K then Return | Ctrl+K then Enter |
| Copy the path of the active file | Ctrl+K then P | Cmd+K then P | Ctrl+K then P |
| Reveal the active file in Explorer or Finder | Ctrl+K then R | Cmd+K then R | Ctrl+K then R |
| Close the folder | Ctrl+K then F | Cmd+K then F | Ctrl+K then F |
Display 14 shortcuts
| Action | Windows | Mac | Linux |
|---|---|---|---|
| Toggle the sidebar | Ctrl+B | Cmd+B | Ctrl+B |
| Show the Explorer | Ctrl+Shift+E | Shift+Cmd+E | Ctrl+Shift+E |
| Show Source Control | Ctrl+Shift+G | Control+Shift+G | Ctrl+Shift+G |
| Show Run and Debug | Ctrl+Shift+D | Shift+Cmd+D | Ctrl+Shift+D |
| Show Extensions | Ctrl+Shift+X | Shift+Cmd+X | Ctrl+Shift+X |
| Toggle the panel | Ctrl+J | Cmd+J | Ctrl+J |
| Show the Output panel | Ctrl+Shift+U | Shift+Cmd+U | Ctrl+K then Ctrl+HDiffers on Linux |
| Open the Markdown preview | Ctrl+Shift+V | Shift+Cmd+V | Ctrl+Shift+V |
| Open the Markdown preview to the side | Ctrl+K then V | Cmd+K then V | Ctrl+K then V |
| Zen mode (press Esc twice to leave) | Ctrl+K then Z | Cmd+K then Z | Ctrl+K then Z |
| Toggle full screen | F11 | Control+Cmd+F | F11 |
| Zoom in | Ctrl+Equals | Cmd+Equals | Ctrl+Equals |
| Zoom out | Ctrl+Minus | Cmd+Minus or Shift+Cmd+Minus | Ctrl+Minus |
| Toggle the editor layout (horizontal or vertical) | Shift+Alt+0 | Option+Cmd+0 | Shift+Alt+0 |
Debugging 7 shortcuts
| Action | Windows | Mac | Linux |
|---|---|---|---|
| Start or continue | F5 | F5 | F5 |
| Stop | Shift+F5 | Shift+F5 | Shift+F5 |
| Toggle a breakpoint | F9 | F9 | F9 |
| Step over | F10 | F10 | F10 |
| Step into | F11 | F11 | F11 |
| Step out | Shift+F11 | Shift+F11 | Shift+F11 |
| Show the hover | Ctrl+K then Ctrl+I | Cmd+K then Cmd+I | Ctrl+K then Ctrl+I |
Integrated terminal 6 shortcuts
| Action | Windows | Mac | Linux |
|---|---|---|---|
| Show the integrated terminal | Ctrl+Grave accent | Control+Grave accent | Ctrl+Grave accent |
| Create a new terminal | Ctrl+Shift+Grave accent | Control+Shift+Grave accent | Ctrl+Shift+Grave accent |
| Copy the selection in the terminal. On Windows, Ctrl+C copies only when text is selected; otherwise it interrupts the running program. | Ctrl+C | Cmd+C | Ctrl+Shift+CDiffers on Linux |
| Paste into the terminal | Ctrl+V | Cmd+V | Ctrl+Shift+VDiffers on Linux |
| Scroll the terminal to the top | Ctrl+Home | Cmd+Home | Shift+HomeDiffers on Linux |
| Scroll the terminal to the bottom | Ctrl+End | Cmd+End | Shift+EndDiffers on Linux |
No shortcut on this sheet matches. Try other words, or search every sheet.
Chords and Linux differences
Some VS Code shortcuts are chords: press Ctrl+K, let go, then press the second key. The sheet joins the two steps with “then”. Most Linux bindings match Windows, but a few change because Linux desktops use those keys: Format Document is Ctrl+Shift+I and Go Back is Ctrl+Alt+- on Linux. Those cells say Differs on Linux.
Everything here is a default. Keymap extensions, Vim emulation and your own keybindings can change any of them; open the keyboard shortcuts editor with Ctrl+K Ctrl+S (Cmd+K Cmd+S) to see what is bound on your machine.
Printing and saving
Print gives you a two-column sheet without the rest of the site; pick Save as PDF in the print dialog to keep a copy. Filter first to print only what you need, or download the sheet as a Markdown table for your notes.
Sources: Microsoft's printable keyboard references for Windows, macOS and Linux.
Questions
How do I select every occurrence of a word?
Put the cursor on the word and press Ctrl+Shift+L (Shift+Cmd+L on a Mac) to add a cursor at every match. To take matches one at a time, press Ctrl+D (Cmd+D) repeatedly, and Ctrl+K Ctrl+D to skip one.
Why does Format Document do nothing?
VS Code needs a formatter for the file's language. Without one it shows a message offering to find one in the Extensions view. Once a formatter is set, Shift+Alt+F (Shift+Option+F on a Mac, Ctrl+Shift+I on Linux) formats the whole file.
How do I find out what a key combination does?
Open the keyboard shortcuts editor with Ctrl+K Ctrl+S (Cmd+K Cmd+S), switch on its record keys option and press the combination: it lists every command bound to those keys. Double-click a command to give it new keys.