Skip to content

↑↓ moveEnter openEsc close

VS Code keyboard shortcuts

VS Code 1.96 · 138 shortcuts · checked Nov 2026 · Source: Microsoft docs

Every VS Code keyboard shortcut from Microsoft's official reference, with the keys for Mac, Windows and Linux side by side.

Essential VS Code keyboard shortcuts

The VS Code shortcuts that save the most time. Keys are shown for every system; the Mac and Windows pages show one system only.

138 shortcuts

Small screen: your system's keys only. Pick another system in the tabs above.

General

7 shortcuts
ActionMacWindowsLinux
Show Command PaletteShiftCmdPorF1CtrlShiftPorF1CtrlShiftPorF1
Quick Open, go to fileCmdPCtrlPCtrlP
New windowShiftCmdNCtrlShiftNCtrlShiftN
Close windowShiftCmdWCtrlShiftWCtrlShiftW
Open User SettingsCmd,Ctrl,Ctrl,
Open the keybindings editorCmdK,CmdSCtrlK,CtrlSCtrlK,CtrlS
Open Microsoft's shortcut referenceCmdK,CmdRCtrlK,CtrlRCtrlK,CtrlR

Basic editing

33 shortcuts
ActionMacWindowsLinux
Cut line (empty selection)CmdXCtrlXCtrlX
Copy line (empty selection)CmdCCtrlCCtrlC
Move line downOption↓Alt↓Alt↓
Move line upOption↑Alt↑Alt↑
Copy line downOptionShift↓AltShift↓CtrlAltShift↓
Copy line upOptionShift↑AltShift↑CtrlAltShift↑
Delete lineShiftCmdKCtrlShiftKCtrlShiftK
Insert line belowCmdEnterCtrlEnterCtrlEnter
Insert line aboveShiftCmdEnterCtrlShiftEnterCtrlShiftEnter
Jump to matching bracketShiftCmd\CtrlShift\CtrlShift\
Indent lineCmd]Ctrl]Ctrl]
Outdent lineCmd[Ctrl[Ctrl[
Go to beginning of lineHomeorCmd←HomeHome
Go to end of lineEndorCmd→EndEnd
Go to beginning of fileCmd↑CtrlHomeCtrlHome
Go to end of fileCmd↓CtrlEndCtrlEnd
Scroll line upCtrlPageUpCtrl↑Ctrl↑
Scroll line downCtrlPageDownCtrl↓Ctrl↓
Scroll page upCmdPageUpAltPageUpAltPageUp
Scroll page downCmdPageDownAltPageDownAltPageDown
Fold (collapse) regionOptionCmd[CtrlShift[CtrlShift[
Unfold (uncollapse) regionOptionCmd]CtrlShift]CtrlShift]
Toggle foldCmdK,CmdLCtrlK,CtrlLCtrlK,CtrlL
Fold all subregionsCmdK,Cmd[CtrlK,Ctrl[CtrlK,Ctrl[
Unfold all subregionsCmdK,Cmd]CtrlK,Ctrl]CtrlK,Ctrl]
Fold all regionsCmdK,Cmd0CtrlK,Ctrl0CtrlK,Ctrl0
Unfold all regionsCmdK,CmdJCtrlK,CtrlJCtrlK,CtrlJ
Fold all block commentsCmdK,Cmd/CtrlK,Ctrl/CtrlK,Ctrl/
Add line commentCmdK,CmdCCtrlK,CtrlCCtrlK,CtrlC
Remove line commentCmdK,CmdUCtrlK,CtrlUCtrlK,CtrlU
Toggle line commentCmd/Ctrl/Ctrl/
Toggle block commentOptionShiftAAltShiftACtrlShiftA
Toggle word wrapOptionZAltZAltZ

Navigation

10 shortcuts
ActionMacWindowsLinux
Show all symbolsCmdTCtrlTCtrlT
Go to lineCtrlGCtrlGCtrlG
Go to symbol in fileShiftCmdOCtrlShiftOCtrlShiftO
Show Problems panelShiftCmdMCtrlShiftMCtrlShiftM
Go to next error or warningF8F8F8
Go to previous error or warningShiftF8ShiftF8ShiftF8
Navigate editor group historyCtrlShiftTabCtrlShiftTabCtrlShiftTab
Go backCtrl-Alt←CtrlAlt-
Go forwardCtrlShift-Alt→CtrlShift-
Toggle Tab moves focusCtrlShiftMCtrlMCtrlM
ActionMacWindowsLinux
FindCmdFCtrlFCtrlF
ReplaceOptionCmdFCtrlHCtrlH
Find nextFind widget openEnterorCmdGEnterorF3EnterorF3
Find previousFind widget openShiftEnterorShiftCmdGShiftEnterorShiftF3ShiftEnterorShiftF3
Select all occurrences of find matchFind widget openOptionEnterAltEnterAltEnter
Toggle case-sensitiveFind widget openOptionCmdCAltCAltC
Toggle regexFind widget openOptionCmdRAltRAltR
Toggle whole wordFind widget openOptionCmdWAltWAltW
ActionMacWindowsLinux
Insert cursor aboveOptionCmd↑CtrlAlt↑AltShift↑
Insert cursor belowOptionCmd↓CtrlAlt↓AltShift↓
Undo last cursor operationCmdUCtrlUCtrlU
Insert cursor at end of each selected lineOptionShiftIAltShiftIAltShiftI
Select current lineCmdLCtrlLCtrlL
Select all occurrences of current selectionShiftCmdLCtrlShiftLCtrlShiftL
Add selection to next find matchCmdDCtrlDCtrlD
Select allCmdACtrlACtrlA
Expand selectionCtrlShiftCmd→AltShift→AltShift→
Shrink selectionCtrlShiftCmd←AltShift←AltShift←
Column (box) selection downOptionShiftCmd↓CtrlAltShift↓CtrlAltShift↓
ActionMacWindowsLinux
Trigger suggestionCtrlSpaceorCmdICtrlSpaceorCtrlICtrlSpaceorCtrlI
Trigger parameter hintsShiftCmdSpaceCtrlShiftSpaceCtrlShiftSpace
Format documentOptionShiftFAltShiftFCtrlShiftI
Format selectionCmdK,CmdFCtrlK,CtrlFCtrlK,CtrlF
Go to definitionF12F12F12
Peek definitionOptionF12AltF12CtrlShiftF10
Open definition to the sideCmdK,F12CtrlK,F12CtrlK,F12
Quick FixCmd.Ctrl.Ctrl.
Show referencesShiftF12ShiftF12ShiftF12
Rename symbolF2F2F2
Trim trailing whitespaceCmdK,CmdXCtrlK,CtrlXCtrlK,CtrlX
Change file languageCmdK,MCtrlK,MCtrlK,M

Editor management

10 shortcuts
ActionMacWindowsLinux
Close editorCmdWCtrlWorCtrlF4CtrlW
Close folderCmdK,FCtrlK,FCtrlK,F
Split editorCmd\Ctrl\Ctrl\
Focus into 1st, 2nd or 3rd editor groupCmd1Ctrl1Ctrl1
Focus into previous editor groupCmdK,Cmd←CtrlK,Ctrl←CtrlK,Ctrl←
Focus into next editor groupCmdK,Cmd→CtrlK,Ctrl→CtrlK,Ctrl→
Move editor leftCmdK,ShiftCmd←CtrlShiftPageUpCtrlShiftPageUp
Move editor rightCmdK,ShiftCmd→CtrlShiftPageDownCtrlShiftPageDown
Move active editor group leftCmdK,←CtrlK,←CtrlK,←
Move active editor group rightCmdK,→CtrlK,→CtrlK,→

File management

14 shortcuts
ActionMacWindowsLinux
Open folderCmdOCtrlK,CtrlOCtrlK,CtrlO
New fileCmdNCtrlNCtrlN
Open fileCmdOCtrlOCtrlO
SaveCmdSCtrlSCtrlS
Save asShiftCmdSCtrlShiftSCtrlShiftS
Save allOptionCmdSCtrlK,SCtrlK,S
Close all editorsCmdK,CmdWCtrlK,CtrlWCtrlK,CtrlW
Reopen closed editorShiftCmdTCtrlShiftTCtrlShiftT
Keep preview mode editor openCmdK,EnterCtrlK,EnterCtrlK,Enter
Open next editorCtrlTabCtrlTabCtrlTab
Open previous editorCtrlShiftTabCtrlShiftTabCtrlShiftTab
Copy path of active fileCmdK,PCtrlK,PCtrlK,P
Reveal active file in Explorer or FinderCmdK,RCtrlK,RCtrlK,R
Show active file in new windowCmdK,OCtrlK,OCtrlK,O

Display

17 shortcuts
ActionMacWindowsLinux
Toggle full screenCtrlCmdFF11F11
Toggle Zen ModeCmdK,ZCtrlK,ZCtrlK,Z
Zoom inCmd=Ctrl=Ctrl=
Zoom outCmd-Ctrl-Ctrl-
Toggle Sidebar visibilityCmdBCtrlBCtrlB
Show ExplorerShiftCmdECtrlShiftECtrlShiftE
Show Source ControlCtrlShiftGCtrlShiftGCtrlShiftG
Show Run and DebugShiftCmdDCtrlShiftDCtrlShiftD
Show ExtensionsShiftCmdXCtrlShiftXCtrlShiftX
Replace in filesShiftCmdHCtrlShiftHCtrlShiftH
Toggle Search detailsShiftCmdJCtrlShiftJCtrlShiftJ
Show Output panelShiftCmdUCtrlShiftUCtrlK,CtrlH
Toggle panelCmdJCtrlJCtrlJ
Show Debug ConsoleShiftCmdYCtrlShiftYCtrlShiftY
Open Markdown previewShiftCmdVCtrlShiftVCtrlShiftV
Open Markdown preview to the sideCmdK,VCtrlK,VCtrlK,V

Debug

8 shortcuts
ActionMacWindowsLinux
Toggle breakpointF9F9F9
Start or continue debuggingF5F5F5
Start without debuggingCtrlF5CtrlF5CtrlF5
Stop debuggingShiftF5ShiftF5ShiftF5
Step intoF11F11F11
Step outShiftF11ShiftF11ShiftF11
Step overF10F10F10
Show hoverCmdK,CmdICtrlK,CtrlICtrlK,CtrlI
ActionMacWindowsLinux
Toggle integrated terminalCtrl`Ctrl`Ctrl`
Create new terminalCtrlShift`CtrlShift`CtrlShift`
Scroll up (terminal)Terminal focusedCmd↑CtrlShift↑CtrlShift↑
Scroll down (terminal)Terminal focusedCmd↓CtrlShift↓CtrlShift↓
Scroll page up (terminal)Terminal focusedPageUpShiftPageUpShiftPageUp
Scroll page down (terminal)Terminal focusedPageDownShiftPageDownShiftPageDown
Scroll to top (terminal)Terminal focusedCmdHomeCtrlHomeCtrlHome
Scroll to bottom (terminal)Terminal focusedCmdEndCtrlEndCtrlEnd
Show the key map: which keys VS Code uses mostDarker orange = used by more shortcuts

Open a folder, files and windows in VS Code

To open a folder in VS Code from the keyboard, press Ctrl+K Ctrl+O on Windows and Linux, or Cmd+O on a Mac, and choose the folder.

Open a recent folder
Ctrl+R opens the list of recent folders and workspaces; type to filter it and press Enter.
From a terminal
Type code . to open the current folder in VS Code. On a Mac, run "Shell Command: Install 'code' command in PATH" from the Command Palette first.

Explorer, Search, Extensions, panel and terminal shortcuts

The views in the sidebar each have a shortcut. Press the same shortcut again, or Ctrl+B (Cmd+B on Mac), to hide the sidebar.

Filter the Extensions view
In the Extensions view's search box, type @installed, @enabled or @disabled to list those extensions, or @recommended for suggestions for your project.

VS Code code folding shortcuts

Folding hides a block of code behind one line. Fold the block at the cursor, fold everything, or unfold it all again from the keyboard.

Fold to a level
Ctrl+K Ctrl+1 folds every block at level 1, Ctrl+K Ctrl+2 at level 2, and so on up to 7 (Cmd+K Cmd+1 on Mac).
Your own regions
In many languages, lines such as // #region and // #endregion mark a block you can fold, even when it is not a function or class.

GitHub Copilot keyboard shortcuts in VS Code

With GitHub Copilot turned on, these keys handle its suggestions and chat. They come from GitHub's and Microsoft's documentation rather than the core list above, and can change between Copilot releases.

Accept or dismiss a suggestion
Tab accepts the grey inline suggestion and Esc dismisses it. Ctrl+Right Arrow (Cmd+Right Arrow on Mac) accepts it one word at a time.
See other suggestions
Alt+] shows the next suggestion and Alt+[ the previous one (Option+] and Option+[ on Mac). Alt+\ (Option+\) asks for a suggestion straight away.
Chat
Ctrl+Alt+I (Ctrl+Cmd+I on Mac) opens the Chat view, and Ctrl+I (Cmd+I) opens inline chat in the editor, replacing Trigger suggestion on that key.
Check your version
Search "copilot" in the Keyboard Shortcuts editor to see the keys your version uses and change them.
Continue and other AI extensions
Extensions such as Continue add their own shortcuts, and some replace VS Code defaults. Search the extension's name in the Keyboard Shortcuts editor to see and change them.

Change and reset VS Code keyboard shortcuts in the Keyboard Shortcuts editor

Every shortcut is listed and changed in the Keyboard Shortcuts editor. Open it with Ctrl+K Ctrl+S (Cmd+K Cmd+S on Mac), or File > Preferences > Keyboard Shortcuts (Code > Settings > Keyboard Shortcuts on Mac).

What the editor shows
A searchable table with four columns: Command, Keybinding, When (where the shortcut works) and Source (Default, User or an extension).
Change a shortcut
Double-click a row, press the new keys and press Enter. Press Esc to cancel.
Search by keys
Click Record Keys (the keyboard icon in the search box) and press a shortcut to see every command bound to it.
Find clashes
Right-click a row and choose Show Same Keybindings to list other commands on the same keys.
Edit as JSON
Run "Preferences: Open Keyboard Shortcuts (JSON)" from the Command Palette to edit keybindings.json, where your changes are stored.
Shortcuts from another editor
Ctrl+K Ctrl+M lists keymap extensions that bring the shortcuts of Sublime Text, IntelliJ, Vim and other editors.
Reset one shortcut
In the Keyboard Shortcuts editor, right-click the shortcut and choose Reset Keybinding.
See what you changed
Type @source:user in the editor's search box to list only your own shortcuts.
Reset all shortcuts
Open keybindings.json ("Preferences: Open Keyboard Shortcuts (JSON)"), delete everything between the square brackets so only [] is left, and save.
Extension shortcuts
If a keymap or other extension changed your keys, disable or uninstall it from the Extensions view; its shortcuts go with it.

VS Code keyboard shortcuts: questions

How do I open keyboard shortcuts settings in VS Code?
Press Ctrl+K Ctrl+S (Cmd+K Cmd+S on Mac) to open the Keyboard Shortcuts editor, where you can search, change and reset every shortcut. More in Keyboard Shortcuts editor.
How do I reset all keyboard shortcuts in VS Code?
Open keybindings.json with "Preferences: Open Keyboard Shortcuts (JSON)", leave only [] and save. To reset one shortcut, right-click it in the Keyboard Shortcuts editor and choose Reset Keybinding.
What is the shortcut to open a folder in VS Code?
Ctrl+K Ctrl+O on Windows and Linux, and Cmd+O on a Mac. Ctrl+R opens a recent folder.
How do I open the Extensions view?
Press Ctrl+Shift+X (Cmd+Shift+X on Mac).
How do I show or hide the panel in VS Code?
Press Ctrl+J (Cmd+J on Mac). Ctrl+` opens the terminal in the panel directly.
How do I fold all code in VS Code?
Ctrl+K Ctrl+0 folds everything and Ctrl+K Ctrl+J unfolds it (Cmd+K on Mac). See code folding shortcuts.
Are VS Code shortcuts different on Mac and Windows?
Mostly Cmd replaces Ctrl, with a few exceptions. See VS Code keyboard shortcuts for Mac and VS Code keyboard shortcuts for Windows for one system at a time.
Is there a VS Code keyboard shortcuts PDF?
Yes: the printable VS Code keyboard shortcuts cheat sheet for Windows, Mac or Linux prints on one or two pages or saves as a PDF.

These are the default key bindings in Visual Studio Code 1.96, as published by Microsoft. Shortcuts that need an extension, an add-in or a changed keymap are left out. Where two combinations do the same thing, both are shown.

Single-system lists: VS Code keyboard shortcuts for Mac, VS Code keyboard shortcuts for Windows, VS Code keyboard shortcuts for Linux.

Each shortcut has its own page with the keys for every system, related shortcuts and the same action in other apps. The printable cheat sheet fits the whole list on one or two pages.