Visual Studio Code keyboard shortcuts

Visual Studio Code is the most widely used code editor in the world, powering everything from web development to data science. Its command-driven design means nearly every feature is reachable from the keyboard. Learning its core shortcuts turns minutes of mousing through menus into split-second keystrokes. This cheat sheet covers 81 default shortcuts for Windows and Mac.

General

Open Command PaletteCtrl+Shift+PCmd+Shift+P
Quick Open fileCtrl+PCmd+P
New windowCtrl+Shift+NCmd+Shift+N
Close windowCtrl+Shift+WCmd+Shift+W
Open SettingsCtrl+,Cmd+,
Open Keyboard Shortcuts editorCtrl+K Ctrl+SCmd+K Cmd+S

Basic Editing

Cut line (empty selection)Ctrl+XCmd+X
Copy line (empty selection)Ctrl+CCmd+C
Move line up/downAlt+Up/DownOption+Up/Down
Copy line up/downShift+Alt+Up/DownShift+Option+Up/Down
Delete lineCtrl+Shift+KCmd+Shift+K
Insert line belowCtrl+EnterCmd+Enter
Insert line aboveCtrl+Shift+EnterCmd+Shift+Enter
Indent lineCtrl+]Cmd+]
Outdent lineCtrl+[Cmd+[
Toggle line commentCtrl+/Cmd+/
Toggle block commentShift+Alt+AShift+Option+A
Jump to matching bracketCtrl+Shift+\Cmd+Shift+\
UndoCtrl+ZCmd+Z
RedoCtrl+YCmd+Shift+Z

Multi-Cursor & Selection

Insert cursor at click positionAlt+ClickOption+Click
Add cursor above/belowCtrl+Alt+Up/DownCmd+Option+Up/Down
Select next occurrence of selectionCtrl+DCmd+D
Select all occurrences of selectionCtrl+Shift+LCmd+Shift+L
Undo last cursor operationCtrl+UCmd+U
Insert cursor at end of each selected lineShift+Alt+IShift+Option+I
Select current lineCtrl+LCmd+L
Expand selectionShift+Alt+RightCtrl+Shift+Cmd+Right
Shrink selectionShift+Alt+LeftCtrl+Shift+Cmd+Left
Column (box) selection with mouseShift+Alt+DragShift+Option+Drag

Search & Replace

FindCtrl+FCmd+F
ReplaceCtrl+HCmd+Option+F
Find nextF3Cmd+G
Find previousShift+F3Cmd+Shift+G
Select all matches of find termAlt+EnterOption+Enter
Search across all filesCtrl+Shift+FCmd+Shift+F
Replace across all filesCtrl+Shift+HCmd+Shift+H

Code Navigation

Go to lineCtrl+GCtrl+G
Go to symbol in workspaceCtrl+TCmd+T
Go to symbol in fileCtrl+Shift+OCmd+Shift+O
Go to definitionF12F12
Peek definitionAlt+F12Option+F12
Find all referencesShift+F12Shift+F12
Navigate backAlt+LeftCtrl+-
Navigate forwardAlt+RightCtrl+Shift+-
Go to next problem (error/warning)F8F8
Cycle through open editorsCtrl+TabCtrl+Tab

Refactoring & IntelliSense

Rename symbolF2F2
Quick FixCtrl+.Cmd+.
Format documentShift+Alt+FShift+Option+F
Format selectionCtrl+K Ctrl+FCmd+K Cmd+F
Trigger suggestionCtrl+SpaceCtrl+Space
Trigger parameter hintsCtrl+Shift+SpaceCmd+Shift+Space
Trim trailing whitespaceCtrl+K Ctrl+XCmd+K Cmd+X

Editor & File Management

New fileCtrl+NCmd+N
Save fileCtrl+SCmd+S
Save AsCtrl+Shift+SCmd+Shift+S
Save all filesCtrl+K SCmd+Option+S
Close editorCtrl+WCmd+W
Reopen closed editorCtrl+Shift+TCmd+Shift+T
Split editorCtrl+\Cmd+\
Focus editor group 1/2/3Ctrl+1/2/3Cmd+1/2/3

Display & Panels

Toggle full screenF11Ctrl+Cmd+F
Toggle sidebar visibilityCtrl+BCmd+B
Show ExplorerCtrl+Shift+ECmd+Shift+E
Show Source ControlCtrl+Shift+GCtrl+Shift+G
Show Run and DebugCtrl+Shift+DCmd+Shift+D
Show ExtensionsCtrl+Shift+XCmd+Shift+X
Show Problems panelCtrl+Shift+MCmd+Shift+M
Zoom inCtrl+=Cmd+=
Zoom outCtrl+-Cmd+-
Toggle Zen ModeCtrl+K ZCmd+K Z

Integrated Terminal

Toggle integrated terminalCtrl+`Ctrl+`
Create new terminalCtrl+Shift+`Ctrl+Shift+`

Debugging

Start / continue debuggingF5F5
Run without debuggingCtrl+F5Ctrl+F5
Stop debuggingShift+F5Shift+F5
Toggle breakpointF9F9
Step overF10F10
Step intoF11F11
Step outShift+F11Shift+F11

Put your top Visual Studio Code shortcuts on real keys

The five Visual Studio Code actions most worth binding to a physical macropad key:

Ctrl+Shift+PCmd+Shift+P Open Command Palette The gateway to every VS Code command; the single most pressed chord in the editor.
Ctrl+`Ctrl+` Toggle integrated terminal Developers bounce between code and terminal dozens of times an hour.
Shift+Alt+FShift+Option+F Format document One physical key to clean up a whole file before every commit.
F12F12 Go to definition Core code-reading move; a dedicated key makes jumping through a codebase effortless.
Ctrl+Shift+FCmd+Shift+F Search across all files Project-wide search is the start of almost every investigation.

I hand-build small-batch programmable macropads (QMK/VIA) in Barcelona. One press, any shortcut, any app.

See the macropads

Visual Studio Code shortcut FAQs

How do I see all keyboard shortcuts in Visual Studio Code?
Open the Keyboard Shortcuts editor with Ctrl+K Ctrl+S on Windows or Cmd+K Cmd+S on Mac. It lists every command, its current binding, and lets you search and rebind anything.
What is the most important shortcut in VS Code?
The Command Palette (Ctrl+Shift+P on Windows, Cmd+Shift+P on Mac). It gives keyboard access to every command in the editor, so you can run anything without memorizing its dedicated shortcut.
How do I use multiple cursors in VS Code?
Hold Alt (Option on Mac) and click to place extra cursors, or press Ctrl+D (Cmd+D) repeatedly to select the next occurrence of the current word and edit them all at once.
Can I change keyboard shortcuts in VS Code?
Yes. Every binding is customizable in the Keyboard Shortcuts editor, and you can install keymap extensions that replicate Sublime Text, IntelliJ, Vim, and other editors.
How do I open the terminal in VS Code?
Press Ctrl+` (backtick) on both Windows and Mac to toggle the integrated terminal. Ctrl+Shift+` creates a new terminal instance.