130 Visual Studio Code Keyboard Shortcuts

Learn Visual Studio Code Shortcuts for Windows & Mac

Most used Visual Studio Code Shortcuts

ActionVisual Studio Code Shortcuts WindowsVisual Studio Code Shortcuts Mac
Show Command PaletteCtrl + Shift + P then F1Command + Shift + P then F1
Quick Open, Go to FileCtrl + PCommand + P
New window/instanceCtrl + Shift + NCommand + Shift + N
Close window/instanceCtrl + Shift + WCommand + Shift + W
User SettingsCtrl + ,Command + ,
Keyboard ShortcutsCtrl + K then Ctrl + SCommand + K then Command + S

Basic Editing Shortcuts

ActionVisual Studio Code Shortcuts WindowsVisual Studio Code Shortcuts Mac
Cut line (empty selection)Ctrl + XCommand + X
Copy line (empty selection)Ctrl + CCommand + C
Move line upAlt + Up Arrow keyOption + Up Arrow key
Move line downAlt + Down Arrow keyOption + Down Arrow key
Copy line upShift + Alt + Up Arrow keyShift + Option + Up Arrow key
Copy line downShift + Alt + Down Arrow keyShift + Option + Down Arrow key
Delete lineCtrl + Shift + KCommand + Shift + K
Insert line belowCtrl + EnterCommand + Enter
Insert line aboveCtrl + Shift + EnterCommand + Shift + Enter
Jump to the matching bracketCtrl + Shift + \Command + Shift + \
Indent lineCtrl + ]Command + ]
Outdent lineCtrl + [Command + [
Go to the beginning of the lineHomeHome
Go to the end of the lineEndEnd
Go to the beginning of the fileCtrl + HomeCommand + Home
Go to end of the fileCtrl + EndCommand + End
Scroll line upCtrl + Up Arrow keyCommand + Up Arrow key
Scroll line downCtrl + Down Arrow keyCommand + Down Arrow key
Scroll page upAlt + Page Up keyOption + Page Up key
Scroll page downAlt + Page Down keyOption + Page Down key
Fold (collapse) regionCtrl + Shift + [Command + Shift + [
Unfold (uncollapse) regionCtrl + Shift + ]Command + Shift + ]
Fold (collapse) all subregionsCtrl + K then Ctrl + [Command + K then Command + [
Unfold (uncollapse) all subregionsCtrl + K then Ctrl + ]Command + K then Command + ]
Fold (collapse) all regionsCtrl + K then Ctrl + 0Command + K then Command + 0
Unfold (uncollapse) all regionsCtrl + K then Ctrl + JCommand + K then Command + J
Add line commentCtrl + K then Ctrl + CCommand + K then Command + C
Remove line commentCtrl + K then Ctrl + UCommand + K then Command + U
Toggle line commentCtrl + /Command + /
Toggle block commentShift + Alt + AShift + Option + A
Toggle word wrapAlt + ZOption + Z

Navigation Shortcuts

ActionVisual Studio Code ShortcutsVisual Studio Code Shortcuts
Show all symbolsCtrl + TCommand + T
Go to lineCtrl + GCommand + G
Go to fileCtrl + PCommand + P
Go to symbolCtrl + Shift + OCommand + Shift + O
Show Problems panelCtrl + Shift + MCommand + Shift + M
Go to the next error or warningF8F8
Go to the previous error or warningShift + F8Shift + F8
Navigate editor group historyCtrl + Shift + TabCommand + Shift + Tab
Go backAlt + Left Arrow keyOption + Left Arrow key
Go forwardAlt + Right Arrow keyOption + Right Arrow key
Toggle Tab moves the focusCtrl + MCommand + M

Search and Replace Shortcuts

ActionVisual Studio Code ShortcutsVisual Studio Code Shortcuts
FindCtrl + FCommand + F
ReplaceCtrl + HCommand + H
Find nextF3F3
Find PreviousShift + F3Shift + F3
Select all occurrences of Find matchAlt + EnterOption + Enter
Add selection to next Find matchCtrl + DCommand + D
Move the last selection to the next Find matchCtrl + K then Ctrl + DCommand + K then Command + D
Toggle case-sensitiveAlt + COption + C
Toggle regexAlt + ROption + R
Toggle whole wordAlt + WOption + W

Rich Languages Editing Shortcuts

ActionVisual Studio Code ShortcutsVisual Studio Code Shortcuts
Trigger suggestionCtrl + SpacebarCommand + Spacebar
Trigger parameter hintsCtrl + Shift + SpacebarCommand + Shift + Spacebar
Format documentShift + Alt + FShift + Option + F
Format selectionCtrl + K then Ctrl + FCommand + K then Command + F
Go to DefinitionF12F12
Peek DefinitionAlt + F12Option + F12
Open Definition to the sideCtrl + K then F12Command + K then F12
Quick FixCtrl + .Command + .
Show ReferencesShift + F12Shift + F12
Rename SymbolF2F2
Trim trailing whitespaceCtrl + K then Ctrl + XCommand + K then Command + X
M Change file languageCtrl + K then MCommand + K then M

Editor Management Shortcuts

ActionVisual Studio Code ShortcutsVisual Studio Code Shortcuts
Close editorCtrl + F4 then Ctrl + WCommand + F4 then Command + W
F Close folderCtrl + KCommand + K
Split editorCtrl + \Command + \
Focus on the first groupCtrl + 1Command + 1
Focus on the second groupCtrl + 2Command + 2
Focus on the third groupCtrl + 3Command + 3
Focus on the previous editor’s groupCtrl + K then Ctrl + Left Arrow keyCommand + K then Command + Left Arrow key
Focus on the next editor groupCtrl + K then Ctrl + Right Arrow keyCommand + K then Command + Right Arrow key
Move editor leftCtrl + Shift + Page Up keyCommand + Shift + Page Up key
Move editor rightCtrl + Shift + Page Down keyCommand + Shift + Page Down key
Move active editor groupCtrl + K then Left & Right Arrow keyCommand + K then Left & Right Arrow key

File Management Shortcuts

ActionVisual Studio Code ShortcutsVisual Studio Code Shortcuts
New FileCtrl + NCommand + N
Open FileCtrl + OCommand + O
Open folderCtrl + K then Ctrl + OCommand + K then Command + O
Open recentCtrl + RCommand + R
SaveCtrl + SCommand + S
Save AsCtrl + Shift + SCommand + Shift + S
Save AllCtrl + K then SCommand + K then S
CloseCtrl + F4Command + F4
Close AllCtrl + K then Ctrl + WCommand + K then Command + W
Reopen closed editorCtrl + Shift + TCommand + Shift + T
Enter Keep preview mode editor openCtrl + KCommand + K
Open nextCtrl + TabCommand + Tab
Open previousCtrl + Shift + TabCommand + Shift + Tab
Copy path of active fileCtrl + K then PCommand + K then P
Reveal active files in ExplorerCtrl + K then RCommand + K then R
Show active file in new window/instanceCtrl + K then OCommand + K then O

Display Shortcuts

ActionVisual Studio Code ShortcutsVisual Studio Code Shortcuts
Toggle fullscreenF11F11
Toggle editor layout (horizontal/vertical)Shift + Alt + 1Shift + Option + 1
Zoom inCtrl + =Command + =
Zoom outCtrl + –Command + –
Toggle Sidebar VisibilityCtrl + BCommand + B
Show Explorer / Toggle focusCtrl + Shift + ECommand + Shift + E
Show SearchCtrl + Shift + FCommand + Shift + F
Show Source ControlCtrl + Shift + GCommand + Shift + G
Show DebugCtrl + Shift + DCommand + Shift + D
Show ExtensionsCtrl + Shift + XCommand + Shift + X
Replace in filesCtrl + Shift + HCommand + Shift + H
Toggle Search detailsCtrl + Shift + JCommand + Shift + J
Show Output panelCtrl + Shift + UCommand + Shift + U
Open Markdown previewCtrl + Shift + VCommand + Shift + V
Open Markdown preview to the sideCtrl + K then VCommand + K then V
Zen Mode (Esc Esc to exit)Ctrl + K then ZCommand + K then Z

Debug Shortcuts

ActionVisual Studio Code Shortcut keysVisual Studio Code Shortcut keys
Toggle breakpointF9F9
Start/ContinueF5F5
StopShift + F5Shift + F5
Step intoF11F11
Step outShift + F11Shift + F11
Step overF10F10
Show hoverCtrl + K then Ctrl + ICommand + K then Command + I

Integrated Terminal Shortcuts

ActionVisual Studio Code Shortcut keysVisual Studio Code Shortcut keys
Show integrated terminalCtrl + `Command + `
Create new terminalCtrl + Shift + `Command + Shift + `
Copy selectionCtrl + CCommand + C
Paste into the active terminalCtrl + VCommand + V
Scroll upCtrl + Up Arrow keyCommand + Up Arrow key
Scroll downCtrl + Down Arrow keyCommand + Down Arrow key
Scroll page upShift + Page Up keyShift + Page Up key
Scroll page downShift + Page Down keyShift + Page Down key
Scroll to topCtrl + HomeCommand + Home
Scroll to bottomCtrl + EndCommand + End

READ NEXT:

Back to top button