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 everything