VS Code Keyboard Shortcuts

Same commands for Windows and macOS. Chords follow the current official cheat sheets.

macOS: ⌘ Command, ⌥ Option, ⌃ Control, ⇧ Shift

Command Windows macOS
Show Command PaletteCtrl+Shift+PF1⇧⌘PF1
Quick Open, Go to File…Ctrl+P⌘P
New window/instanceCtrl+Shift+N⇧⌘N
Close window/instanceCtrl+Shift+W⌘W
User SettingsCtrl+,⌘,
Keyboard ShortcutsCtrl+KCtrl+S⌘K⌘S
Cut line (empty selection)Ctrl+X⌘X
Copy line (empty selection)Ctrl+C⌘C
Move line up/downAlt+↑Alt+↓⌥↓⌥↑
Copy line up/downShift+Alt+↓Shift+Alt+↑⇧⌥↓⇧⌥↑
Delete lineCtrl+Shift+K⇧⌘K
Insert line belowCtrl+Enter⌘Enter
Insert line aboveCtrl+Shift+Enter⇧⌘Enter
Jump to matching bracketCtrl+Shift+\⇧⌘\
Indent/outdent lineCtrl+]Ctrl+[⌘]⌘[
Go to beginning/end of lineHomeEndHomeEnd
Go to beginning of fileCtrl+Home⌘↑
Go to end of fileCtrl+End⌘↓
Scroll line up/downCtrl+↑Ctrl+↓⌃PgUp⌃PgDn
Scroll page up/downAlt+PgUpAlt+PgDn⌘PgUp⌘PgDn
Fold (collapse) regionCtrl+Shift+[⌥⌘[
Unfold (uncollapse) regionCtrl+Shift+]⌥⌘]
Fold (collapse) all subregionsCtrl+KCtrl+[⌘K⌘[
Unfold (uncollapse) all subregionsCtrl+KCtrl+]⌘K⌘]
Fold (collapse) all regionsCtrl+KCtrl+0⌘K⌘0
Unfold (uncollapse) all regionsCtrl+KCtrl+J⌘K⌘J
Add line commentCtrl+KCtrl+C⌘K⌘C
Remove line commentCtrl+KCtrl+U⌘K⌘U
Toggle line commentCtrl+/⌘/
Toggle block commentShift+Alt+A⇧⌥A
Toggle word wrapAlt+Z⌥Z
Show all SymbolsCtrl+T⌘T
Go to Line...Ctrl+G⌃G
Go to File...Ctrl+P⌘P
Go to Symbol...Ctrl+Shift+O⇧⌘O
Show Problems panelCtrl+Shift+M⇧⌘M
Go to next error or warningF8F8
Go to previous error or warningShift+F8⇧F8
Navigate editor group historyCtrl+Shift+Tab⌃⇧Tab
Go back / forwardAlt+←Alt+→⌃-⌃⇧-
Toggle Tab moves focusCtrl+M⌃⇧M
FindCtrl+F⌘F
ReplaceCtrl+H⌥⌘F
Find next/previousF3Shift+F3⌘G⇧⌘G
Select all occurrences of Find matchAlt+Enter⌥Enter
Add selection to next Find matchCtrl+D⌘D
Move last selection to next Find matchCtrl+KCtrl+D⌘K⌘D
Toggle case-sensitive / regex / whole wordWhile the find box is focused. macOS chord is the editor default; the macOS cheat sheet omits it.Alt+CAlt+RAlt+W⌥⌘C⌥⌘R⌥⌘W
Insert cursorAlt+Click⌥+click
Insert cursor above / belowCtrl+Alt+↑Ctrl+Alt+↓⌥⌘↑⌥⌘↓
Undo last cursor operationCtrl+U⌘U
Insert cursor at end of each line selectedShift+Alt+I⇧⌥I
Select current lineCtrl+L⌘L
Select all occurrences of current selectionCtrl+Shift+L⇧⌘L
Select all occurrences of current wordCtrl+F2⌘F2
Expand selectionShift+Alt+→⌃⇧⌘→
Shrink selectionShift+Alt+←⌃⇧⌘←
Column (box) selectionShift+Alt+drag⇧⌥+drag
Column (box) selection with arrow keysCtrl+Shift+Alt+arrow⇧⌥⌘+arrow
Column (box) selection page up/downCtrl+Shift+Alt+PgUpCtrl+Shift+Alt+PgDn⇧⌥⌘PgUp⇧⌥⌘PgDn
Trigger suggestionCtrl+SpaceCtrl+I⌃Space⌘I
Trigger parameter hintsCtrl+Shift+Space⇧⌘Space
Format documentShift+Alt+F⇧⌥F
Format selectionCtrl+KCtrl+F⌘K⌘F
Go to DefinitionF12F12
Peek DefinitionAlt+F12⌥F12
Open Definition to the sideCtrl+KF12⌘KF12
Quick FixCtrl+.⌘.
Show ReferencesShift+F12⇧F12
Rename SymbolF2F2
Trim trailing whitespaceCtrl+KCtrl+X⌘K⌘X
Change file languageCtrl+KM⌘KM
Close editorCtrl+F4Ctrl+W⌘W
Close folderCtrl+KF⌘KF
Split editorCtrl+\⌘\
Focus into 1st, 2nd or 3rd editor groupCtrl+1Ctrl+2Ctrl+3⌘1⌘2⌘3
Focus into previous/next editor groupCtrl+KCtrl+←Ctrl+KCtrl+→⌘K⌘←⌘K⌘→
Move editor left/rightCtrl+Shift+PgUpCtrl+Shift+PgDn⌘K⇧⌘←⌘K⇧⌘→
Move active editor groupCtrl+K←Ctrl+K→⌘K←⌘K→
New FileCtrl+N⌘N
Open File...Ctrl+O⌘O
SaveCtrl+S⌘S
Save As...Ctrl+Shift+S⇧⌘S
Save AllCtrl+KS⌥⌘S
CloseCtrl+F4⌘W
Close AllCtrl+KCtrl+W⌘K⌘W
Reopen closed editorCtrl+Shift+T⇧⌘T
Keep preview mode editor openCtrl+KEnter⌘KEnter
Open nextCtrl+Tab⌃Tab
Open previousCtrl+Shift+Tab⌃⇧Tab
Copy path of active fileCtrl+KP⌘KP
Reveal active file in Explorer / FinderCtrl+KR⌘KR
Show active file in new window/instanceCtrl+KO⌘KO
Toggle full screenF11⌃⌘F
Toggle editor layout (horizontal/vertical)Shift+Alt+0⌥⌘0
Zoom in/outCtrl+=Ctrl+-⌘=⇧⌘-
Toggle Sidebar visibilityCtrl+B⌘B
Show Explorer / Toggle focusCtrl+Shift+E⇧⌘E
Show SearchCtrl+Shift+F⇧⌘F
Show Source ControlCtrl+Shift+G⌃⇧G
Show DebugCtrl+Shift+D⇧⌘D
Show ExtensionsCtrl+Shift+X⇧⌘X
Replace in filesCtrl+Shift+H⇧⌘H
Toggle Search detailsCtrl+Shift+J⇧⌘J
Show Output panelCtrl+Shift+U⇧⌘U
Open Markdown previewCtrl+Shift+V⇧⌘V
Open Markdown preview to the sideCtrl+KV⌘KV
Zen Mode (Esc Esc to exit)Ctrl+KZ⌘KZ
Toggle breakpointF9F9
Start/ContinueF5F5
StopShift+F5⇧F5
Step into/outF11Shift+F11F11⇧F11
Step overF10F10
Show hoverCtrl+KCtrl+I⌘K⌘I
Show integrated terminalCtrl+`⌃`
Create new terminalCtrl+Shift+`⌃⇧`
Copy selectionCtrl+C⌘C
Paste into active terminalmacOS chord is the editor default; the macOS cheat sheet omits it.Ctrl+V⌘V
Scroll up/downCtrl+↑Ctrl+↓⌘↑⌘↓
Scroll page up/downShift+PgUpShift+PgDnPgUpPgDn
Scroll to top/bottomCtrl+HomeCtrl+End⌘Home⌘End

Defaults from the official Visual Studio Code cheat sheets. Your own keybindings are not listed. Windows PDF · macOS PDF