VS Code keyboard shortcuts

VS Code is designed to be driven from the keyboard. Two shortcuts unlock everything else: the Command Palette (Ctrl+Shift+P) finds any command by name and shows its key binding, and Quick Open (Ctrl+P) jumps to any file. Multi-cursor editing is where the real speed gains live.

Practise VS Code shortcuts

42 VS Code shortcuts for Windows. You get 10 prompts: press the real keys on your keyboard (or pick from four answers on a phone). Anything you miss comes back sooner in your daily review.

VS Code shortcut cheat sheet

General

ActionWindowsMac
Command Palette
Quick Open file
Open settings
Keyboard Shortcuts editor
Toggle sidebar
Toggle integrated terminal
Zen mode

Editing

ActionWindowsMac
Toggle line comment
Toggle block comment
Format documentCtrl+Shift+I on Linux
Move line up or down
Copy line down
Delete line
Insert line below
Indent or outdent lineCtrl+[ outdents

Multi-cursor

ActionWindowsMac
Add next match to selection
Select all matches
Add cursor above or below
Add cursor at click
Cursor at end of each selected line
Expand selection

Navigation

ActionWindowsMac
Go to line
Go to symbol in file
Go to definition
Peek definition
Go back
Jump to matching bracket
Show problems panel

Search & refactor

ActionWindowsMac
Find
Replace
Search across files
Rename symbol
Quick Fix
Trigger suggestion

Editor groups

ActionWindowsMac
Split editor
Close editor
Reopen closed editor
Toggle word wrap

Debug

ActionWindowsMac
Start or continue debugging
Toggle breakpoint
Step over
Step into

Source: VS Code Docs: Default keyboard shortcuts; VS Code keyboard shortcut reference PDFs (Windows, macOS, Linux). Defaults for the current version as documented by Microsoft; custom keymaps and non-US keyboard layouts can differ.

Can't find it? Ask about VS Code

Type a task in plain words and get the shortcut for Windows, with a note if the app lacks one.

0/300

Quick answers

VS Code shortcut questions

How do I comment out multiple lines in VS Code?

Select the lines and press Ctrl+/ on Windows and Linux or Cmd+/ on a Mac to toggle line comments. Shift+Alt+A (Shift+Option+A) toggles a block comment.

What is the VS Code format shortcut?

Shift+Alt+F on Windows, Shift+Option+F on a Mac and Ctrl+Shift+I on Linux format the whole document using the configured formatter.

Also practise: Windows · Mac · Excel · Word · PowerPoint