Tiny Shortcuts

Keyboard shortcut cheat sheets & symbol picker

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.

Columns

Showing all 110 shortcuts.

General 5 shortcuts

ActionWindowsMacLinux
Show the Command PaletteCtrl+Shift+P or F1Shift+Cmd+P or F1Ctrl+Shift+P or F1
Quick Open: go to a file by nameCtrl+PCmd+PCtrl+P
New windowCtrl+Shift+NShift+Cmd+NCtrl+Shift+N
Open user settingsCtrl+CommaCmd+CommaCtrl+Comma
Open the keyboard shortcuts editorCtrl+K then Ctrl+SCmd+K then Cmd+SCtrl+K then Ctrl+S

Basic editing 21 shortcuts

ActionWindowsMacLinux
Cut the line (with nothing selected)Ctrl+XCmd+XCtrl+X
Copy the line (with nothing selected)Ctrl+CCmd+CCtrl+C
Move the line upAlt+Up arrowOption+Up arrowAlt+Up arrow
Move the line downAlt+Down arrowOption+Down arrowAlt+Down arrow
Copy the line upShift+Alt+Up arrowShift+Option+Up arrowCtrl+Shift+Alt+Up arrowDiffers on Linux
Copy the line downShift+Alt+Down arrowShift+Option+Down arrowCtrl+Shift+Alt+Down arrowDiffers on Linux
Delete the lineCtrl+Shift+KShift+Cmd+KCtrl+Shift+K
Insert a line belowCtrl+EnterCmd+ReturnCtrl+Enter
Insert a line aboveCtrl+Shift+EnterShift+Cmd+ReturnCtrl+Shift+Enter
Jump to the matching bracketCtrl+Shift+BackslashShift+Cmd+BackslashCtrl+Shift+Backslash
Indent the lineCtrl+Right bracketCmd+Right bracketCtrl+Right bracket
Outdent the lineCtrl+Left bracketCmd+Left bracketCtrl+Left bracket
Go to the start of the fileCtrl+HomeCmd+Up arrowCtrl+Home
Go to the end of the fileCtrl+EndCmd+Down arrowCtrl+End
Toggle a line commentCtrl+SlashCmd+SlashCtrl+Slash
Toggle a block commentShift+Alt+AShift+Option+ACtrl+Shift+ADiffers on Linux
Toggle word wrapAlt+ZOption+ZAlt+Z
Fold (collapse) the regionCtrl+Shift+Left bracketOption+Cmd+Left bracketCtrl+Shift+Left bracket
Unfold (expand) the regionCtrl+Shift+Right bracketOption+Cmd+Right bracketCtrl+Shift+Right bracket
Fold all regionsCtrl+K then Ctrl+0Cmd+K then Cmd+0Ctrl+K then Ctrl+0
Unfold all regionsCtrl+K then Ctrl+JCmd+K then Cmd+JCtrl+K then Ctrl+J

Multi-cursor & selection 13 shortcuts

ActionWindowsMacLinux
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+ClickOption+ClickAlt+Click
Add a cursor aboveCtrl+Alt+Up arrowOption+Cmd+Up arrowShift+Alt+Up arrowDiffers on Linux
Add a cursor belowCtrl+Alt+Down arrowOption+Cmd+Down arrowShift+Alt+Down arrowDiffers on Linux
Undo the last cursor operationCtrl+UCmd+UCtrl+U
Add a cursor at the end of each selected lineShift+Alt+IShift+Option+IShift+Alt+I
Select the current lineCtrl+LCmd+LCtrl+L
Select all occurrences of the current selectionCtrl+Shift+LShift+Cmd+LCtrl+Shift+L
Select all occurrences of the current wordCtrl+F2Cmd+F2Ctrl+F2
Add the next occurrence to the selectionCtrl+DCmd+DCtrl+D
Skip: move the last selection to the next occurrenceCtrl+K then Ctrl+DCmd+K then Cmd+DCtrl+K then Ctrl+D
Expand the selectionShift+Alt+Right arrowControl+Shift+Cmd+Right arrowShift+Alt+Right arrow
Shrink the selectionShift+Alt+Left arrowControl+Shift+Cmd+Left arrowShift+Alt+Left arrow
Column (box) selectionShift+Alt+DragShift+Option+DragShift+Alt+Drag

Search & replace 7 shortcuts

ActionWindowsMacLinux
FindCtrl+FCmd+FCtrl+F
ReplaceCtrl+HOption+Cmd+FCtrl+H
Find the next matchF3Cmd+GF3
Find the previous matchShift+F3Shift+Cmd+GShift+F3
Select all matches of the findAlt+EnterOption+ReturnAlt+Enter
Search across filesCtrl+Shift+FShift+Cmd+FCtrl+Shift+F
Replace across filesCtrl+Shift+HShift+Cmd+HCtrl+Shift+H

Code & language features 12 shortcuts

ActionWindowsMacLinux
Trigger suggestionsCtrl+Space or Ctrl+IControl+Space or Cmd+ICtrl+Space or Ctrl+I
Show parameter hintsCtrl+Shift+SpaceShift+Cmd+SpaceCtrl+Shift+Space
Format the documentShift+Alt+FShift+Option+FCtrl+Shift+IDiffers on Linux
Format the selectionCtrl+K then Ctrl+FCmd+K then Cmd+FCtrl+K then Ctrl+F
Go to definitionF12F12F12
Peek definitionAlt+F12Option+F12Ctrl+Shift+F10Differs on Linux
Open the definition to the sideCtrl+K then F12Cmd+K then F12Ctrl+K then F12
Quick FixCtrl+PeriodCmd+PeriodCtrl+Period
Show referencesShift+F12Shift+F12Shift+F12
Rename symbolF2F2F2
Trim trailing whitespaceCtrl+K then Ctrl+XCmd+K then Cmd+XCtrl+K then Ctrl+X
Change the file's language modeCtrl+K then MCmd+K then MCtrl+K then M

Editors & files 16 shortcuts

ActionWindowsMacLinux
New fileCtrl+NCmd+NCtrl+N
Open fileCtrl+OCmd+OCtrl+O
SaveCtrl+SCmd+SCtrl+S
Save asCtrl+Shift+SShift+Cmd+SCtrl+Shift+S
Save allCtrl+K then SOption+Cmd+S—No default shortcutDiffers on Linux
Close the editorCtrl+F4 or Ctrl+WCmd+WCtrl+WDiffers on Linux
Close all editorsCtrl+K then Ctrl+WCmd+K then Cmd+WCtrl+K then Ctrl+W
Reopen the closed editorCtrl+Shift+TShift+Cmd+TCtrl+Shift+T
Split the editorCtrl+BackslashCmd+BackslashCtrl+Backslash
Focus the first editor group. 2 and 3 focus the second and third groups.Ctrl+1Cmd+1Ctrl+1
Open the next editorCtrl+TabControl+TabCtrl+Tab
Open the previous editorCtrl+Shift+TabControl+Shift+TabCtrl+Shift+Tab
Keep a preview editor openCtrl+K then EnterCmd+K then ReturnCtrl+K then Enter
Copy the path of the active fileCtrl+K then PCmd+K then PCtrl+K then P
Reveal the active file in Explorer or FinderCtrl+K then RCmd+K then RCtrl+K then R
Close the folderCtrl+K then FCmd+K then FCtrl+K then F

Display 14 shortcuts

ActionWindowsMacLinux
Toggle the sidebarCtrl+BCmd+BCtrl+B
Show the ExplorerCtrl+Shift+EShift+Cmd+ECtrl+Shift+E
Show Source ControlCtrl+Shift+GControl+Shift+GCtrl+Shift+G
Show Run and DebugCtrl+Shift+DShift+Cmd+DCtrl+Shift+D
Show ExtensionsCtrl+Shift+XShift+Cmd+XCtrl+Shift+X
Toggle the panelCtrl+JCmd+JCtrl+J
Show the Output panelCtrl+Shift+UShift+Cmd+UCtrl+K then Ctrl+HDiffers on Linux
Open the Markdown previewCtrl+Shift+VShift+Cmd+VCtrl+Shift+V
Open the Markdown preview to the sideCtrl+K then VCmd+K then VCtrl+K then V
Zen mode (press Esc twice to leave)Ctrl+K then ZCmd+K then ZCtrl+K then Z
Toggle full screenF11Control+Cmd+FF11
Zoom inCtrl+EqualsCmd+EqualsCtrl+Equals
Zoom outCtrl+MinusCmd+Minus or Shift+Cmd+MinusCtrl+Minus
Toggle the editor layout (horizontal or vertical)Shift+Alt+0Option+Cmd+0Shift+Alt+0

Debugging 7 shortcuts

ActionWindowsMacLinux
Start or continueF5F5F5
StopShift+F5Shift+F5Shift+F5
Toggle a breakpointF9F9F9
Step overF10F10F10
Step intoF11F11F11
Step outShift+F11Shift+F11Shift+F11
Show the hoverCtrl+K then Ctrl+ICmd+K then Cmd+ICtrl+K then Ctrl+I

Integrated terminal 6 shortcuts

ActionWindowsMacLinux
Show the integrated terminalCtrl+Grave accentControl+Grave accentCtrl+Grave accent
Create a new terminalCtrl+Shift+Grave accentControl+Shift+Grave accentCtrl+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+CCmd+CCtrl+Shift+CDiffers on Linux
Paste into the terminalCtrl+VCmd+VCtrl+Shift+VDiffers on Linux
Scroll the terminal to the topCtrl+HomeCmd+HomeShift+HomeDiffers on Linux
Scroll the terminal to the bottomCtrl+EndCmd+EndShift+EndDiffers on Linux

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.