Tools
VS Code Keyboard Shortcuts Cheat Sheet
The shortcuts below are written for Windows and Linux. On macOS, swap Ctrl for Cmd and Alt for Option unless a row says otherwise.
Put it into practice with the matching tool.
Test a regex pattern →Advertisement
Essentials
Ctrl+Shift+PCommand palette — run any command by nameCtrl+PGo to file by nameCtrl+,Open settingsCtrl+K Ctrl+SOpen the keyboard shortcuts listCtrl+`Toggle the integrated terminalCtrl+BToggle the sidebarCtrl+K ZZen mode — hide everything but the editorNavigation
Ctrl+GGo to line numberCtrl+Shift+OGo to a symbol in the current fileCtrl+TGo to a symbol across the whole projectF12Go to definitionAlt+F12Peek definition without leaving the fileShift+F12Find all referencesAlt+← / Alt+→Navigate back and forwardCtrl+TabSwitch between open editorsMulti-cursor & selection
Alt+ClickAdd a cursor at the click positionCtrl+Alt+↑ / ↓Add a cursor on the line above or belowCtrl+DSelect the next occurrence of the selectionCtrl+Shift+LSelect every occurrence at onceCtrl+UUndo the last cursor actionShift+Alt+dragColumn (box) selectionCtrl+LSelect the whole lineShift+Alt+→Expand the selection to the enclosing blockEditing
Alt+↑ / Alt+↓Move the current line up or downShift+Alt+↑ / ↓Duplicate the line up or downCtrl+Shift+KDelete the lineCtrl+EnterInsert a line below without splittingCtrl+/Toggle a line commentShift+Alt+AToggle a block commentShift+Alt+FFormat the documentCtrl+K Ctrl+FFormat just the selectionF2Rename the symbol everywhereCtrl+.Quick fix / code actionsCtrl+SpaceTrigger suggestionsSearch & replace
Ctrl+FFind in the current fileCtrl+HReplace in the current fileCtrl+Shift+FSearch across all filesCtrl+Shift+HReplace across all filesAlt+EnterSelect all find matchesAlt+C / Alt+W / Alt+RToggle case-sensitive, whole word, regexF3 / Shift+F3Next and previous matchPanels & layout
Ctrl+\Split the editorCtrl+1 / Ctrl+2Focus editor group one, two, …Ctrl+WClose the editorCtrl+K Ctrl+WClose every editorCtrl+Shift+EExplorerCtrl+Shift+GSource controlCtrl+Shift+XExtensionsCtrl+Shift+MProblems panelCtrl+Shift+UOutput panelDebugging & folding
F5Start or continue debuggingF9Toggle a breakpointF10 / F11Step over / step intoShift+F11Step outCtrl+Shift+F5Restart the debug sessionCtrl+Shift+[ / ]Fold / unfold the regionCtrl+K Ctrl+0Fold everythingCtrl+K Ctrl+JUnfold everythingVS Code in practice
The three shortcuts that matter most
The Command Palette — Ctrl+Shift+P on Windows and Linux, Cmd+Shift+P on macOS — runs any command by name, so you never need to remember where a menu item lives. Quick Open, Ctrl+P, jumps to any file by typing part of its name; add : and a number to go to a line, or @ to jump to a symbol in the file. Go to Definition, F12, and Peek Definition, Alt+F12, navigate code without losing your place. Learn these three and the rest can be found through the palette.
Multi-cursor editing
Ctrl+D (Cmd+D on macOS) selects the next occurrence of the current word, adding a cursor each time, so you can rename several occurrences at once; Ctrl+Shift+L selects them all. Alt+Click adds cursors anywhere, and Ctrl+Alt+Up or Down (Option+Cmd on macOS) adds cursors on the lines above or below. For renaming a variable across files, F2 (Rename Symbol) is safer than text selection because it understands code.
Moving lines and code
Alt+Up and Alt+Down move the current line or selection; add Shift to copy it instead. Ctrl+/ toggles line comments. Ctrl+Shift+K deletes a line. Ctrl+] and Ctrl+[ indent and outdent. Shift+Alt+F formats the document using the configured formatter, and enabling "Format on Save" makes it automatic. Ctrl+. opens quick fixes and refactorings suggested by the language server.
Customising shortcuts
Open Keyboard Shortcuts with Ctrl+K then Ctrl+S to search, view and rebind any command; the "Record Keys" option finds which command a key combination runs. If you are used to another editor, keymap extensions reproduce shortcuts from Vim, Sublime, IntelliJ and others. Shortcuts differ between operating systems, so when following a tutorial, check the palette for the command name rather than the key combination.
Learning gradually
Learn two or three shortcuts at a time and use them deliberately for a week. The Command Palette shows each command's shortcut next to its name, so using the palette is itself a way to discover them. Help → Keyboard Shortcuts Reference opens an official printable PDF for your platform.

