VS Code Keyboard Shortcuts for Windows & Mac

Every default Visual Studio Code shortcut for Windows and Mac, with Linux differences: multi-cursor, search, refactoring, terminal.

VS Code keyboard shortcuts (Windows & Mac) — freetoolsforweb.com

Last verified: against the VS Code docs and default keybindings for Windows, macOS and Linux. 188 shortcuts.

How to read the keys
  • Chords: Control plus K then Control plus S means press Ctrl+K, let go, then press Ctrl+S. VS Code waits for the second key after the first.
  • Linux uses the Windows keys except where a row says “Linux:”, such as Control plus Shift plus I to format a document.
  • These are the defaults. Your own or an extension’s keybindings win; check them with Control plus K then Control plus S (Command plus K then Command plus S on a Mac).

Showing all 188 shortcuts in 12 categories

General and Command Palette#

ActionWindowsMacCopy
Show the Command Palette (all commands)Control plus Shift plus Por F1Shift plus Command plus Por F1
Quick Open: go to a file by nameControl plus PCommand plus P
New windowControl plus Shift plus NShift plus Command plus N
Close the windowAlt plus F4or Control plus Shift plus WLinux: Alt+F4 (the reference sheet also lists Ctrl+W).Shift plus Command plus W
Open SettingsControl plus commaCommand plus comma
Open the Keyboard Shortcuts editorControl plus K then Control plus SCommand plus K then Command plus S
Select a color themeControl plus K then Control plus TCommand plus K then Command plus T
Open a recent folder or workspaceControl plus RControl plus R
Quick Open a viewControl plus QLinux: no default shortcut.Control plus Q

Basic editing#

ActionWindowsMacCopy
Cut the line (no selection)Control plus XCommand plus X
Copy the line (no selection)Control plus CCommand plus C
UndoControl plus ZCommand plus Z
RedoControl plus YShift plus Command plus Z
Move the line upAlt plus Up arrowOption plus Up arrow
Move the line downAlt plus Down arrowOption plus Down arrow
Copy (duplicate) the line upShift plus Alt plus Up arrowLinux: Ctrl+Shift+Alt+Up.Option plus Shift plus Up arrow
Copy (duplicate) the line downShift plus Alt plus Down arrowLinux: Ctrl+Shift+Alt+Down.Option plus Shift plus Down arrow
Delete the lineControl plus Shift plus KShift plus Command plus K
Insert a line belowControl plus EnterCommand plus Enter
Insert a line aboveControl plus Shift plus EnterShift plus Command plus Enter
Jump to the matching bracketControl plus Shift plus backslashShift plus Command plus backslash
Indent the lineControl plus right bracketCommand plus right bracket
Outdent the lineControl plus left bracketCommand plus left bracket
Go to the beginning of the lineHomeHome
Go to the end of the lineEndEnd
Go to the beginning of the fileControl plus HomeCommand plus Up arrow
Go to the end of the fileControl plus EndCommand plus Down arrow
Scroll up one lineControl plus Up arrowControl plus Page Up
Scroll down one lineControl plus Down arrowControl plus Page Down
Scroll up one pageAlt plus Page UpCommand plus Page Up
Scroll down one pageAlt plus Page DownCommand plus Page Down
Toggle line commentControl plus slashCommand plus slash
Add line commentControl plus K then Control plus CCommand plus K then Command plus C
Remove line commentControl plus K then Control plus UCommand plus K then Command plus U
Toggle block commentShift plus Alt plus ALinux: Ctrl+Shift+A.Option plus Shift plus A
Toggle word wrapAlt plus ZOption plus Z
Fold (collapse) the regionControl plus Shift plus left bracketOption plus Command plus left bracket
Unfold (expand) the regionControl plus Shift plus right bracketOption plus Command plus right bracket
Toggle fold at the cursorControl plus K then Control plus LCommand plus K then Command plus L
Fold all subregionsControl plus K then Control plus left bracketCommand plus K then Command plus left bracket
Unfold all subregionsControl plus K then Control plus right bracketCommand plus K then Command plus right bracket
Fold all regionsControl plus K then Control plus 0Command plus K then Command plus 0
Unfold all regionsControl plus K then Control plus JCommand plus K then Command plus J
Fold all block commentsControl plus K then Control plus slashCommand plus K then Command plus slash
Toggle overtype / insert modeInsertOption plus Command plus O

Multi-cursor and selection#

ActionWindowsMacCopy
Add a cursor where you clickAlt plus clickOn some Linux distributions Alt+Click is taken by the window manager; switch the modifier with the editor.multiCursorModifier setting.Option plus click
Add a cursor aboveControl plus Alt plus Up arrowLinux: Shift+Alt+Up.Option plus Command plus Up arrow
Add a cursor belowControl plus Alt plus Down arrowLinux: Shift+Alt+Down.Option plus Command plus Down arrow
Undo the last cursor operationControl plus UCommand plus U
Add cursors at the end of each selected lineShift plus Alt plus IOption plus Shift plus I
Select the current lineControl plus LCommand plus L
Select the word, then add the next matchControl plus DCommand plus D
Move the last selection to the next match (skip)Control plus K then Control plus DCommand plus K then Command plus D
Select all occurrences of the selectionControl plus Shift plus LShift plus Command plus L
Select all occurrences of the current wordControl plus F2Command plus F2
Expand the selection (smart select)Shift plus Alt plus Right arrowControl plus Shift plus Command plus Right arrow
Shrink the selectionShift plus Alt plus Left arrowControl plus Shift plus Command plus Left arrow
Column (box) selection with the mouseShift plus Alt plus dragOption plus Shift plus drag
Column (box) selection with the keyboardControl plus Shift plus Alt plus arrow keysOption plus Shift plus Command plus arrow keys
Column (box) selection a page up or downControl plus Shift plus Alt plus Page Upor Control plus Shift plus Alt plus Page DownOption plus Shift plus Command plus Page Upor Option plus Shift plus Command plus Page Down

Rich language editing (IntelliSense, refactoring)#

ActionWindowsMacCopy
Trigger suggestions (IntelliSense)Control plus Space barControl plus Space bar
Trigger parameter hintsControl plus Shift plus Space barShift plus Command plus Space bar
Format the documentShift plus Alt plus FLinux: Ctrl+Shift+I.Option plus Shift plus F
Format the selectionControl plus K then Control plus FCommand plus K then Command plus F
Go to definitionF12F12
Peek definitionAlt plus F12Linux: Ctrl+Shift+F10.Option plus F12
Open definition to the sideControl plus K then F12Command plus K then F12
Quick Fix (code actions)Control plus periodCommand plus period
Go to referencesShift plus F12Shift plus F12
Show all references in the References viewShift plus Alt plus F12Option plus Shift plus F12
Rename symbolF2F2
Show hover informationControl plus K then Control plus ICommand plus K then Command plus I
Replace with the next valueControl plus Shift plus periodShift plus Command plus period
Replace with the previous valueControl plus Shift plus commaShift plus Command plus comma
Trim trailing whitespaceControl plus K then Control plus XCommand plus K then Command plus X
Change the file’s language modeControl plus K then MCommand plus K then M

Editor and window management#

ActionWindowsMacCopy
Close the editor (tab)Control plus F4or Control plus WLinux: Ctrl+W.Command plus W
Close all editors in the groupControl plus K then WCommand plus K then W
Close all editorsControl plus K then Control plus WCommand plus K then Command plus W
Close the folderControl plus K then FCommand plus K then F
Split the editorControl plus backslashCommand plus backslash
Split the editor inside its groupControl plus K then Control plus Shift plus backslashCommand plus K then Shift plus Command plus backslash
Focus the 1st, 2nd or 3rd editor groupControl plus 1 to 3Command plus 1 to 3
Focus the editor group on the leftControl plus K then Control plus Left arrowCommand plus K then Command plus Left arrow
Focus the editor group on the rightControl plus K then Control plus Right arrowCommand plus K then Command plus Right arrow
Open the editor (tab) to the rightControl plus Page DownOption plus Command plus Right arrow
Open the editor (tab) to the leftControl plus Page UpOption plus Command plus Left arrow
Move the editor (tab) leftControl plus Shift plus Page UpCommand plus K then Shift plus Command plus Left arrow
Move the editor (tab) rightControl plus Shift plus Page DownCommand plus K then Shift plus Command plus Right arrow
Move the active editor group leftControl plus K then Left arrowCommand plus K then Left arrow
Move the active editor group rightControl plus K then Right arrowCommand plus K then Right arrow
Move the editor into the next groupControl plus Alt plus Right arrowControl plus Command plus Right arrow
Move the editor into the previous groupControl plus Alt plus Left arrowControl plus Command plus Left arrow
Keep a preview editor openControl plus K then EnterCommand plus K then Enter
Pin the editor tabControl plus K then Shift plus EnterCommand plus K then Shift plus Enter
Toggle maximize editor groupControl plus K then Control plus MCommand plus K then Command plus M
Toggle vertical/horizontal editor layoutShift plus Alt plus 0Option plus Command plus 0
Copy the editor into a new windowControl plus K then OCommand plus K then O

File management#

ActionWindowsMacCopy
New fileControl plus NCommand plus N
Open fileControl plus OCommand plus O
SaveControl plus SCommand plus S
Save AsControl plus Shift plus SShift plus Command plus S
Save allControl plus K then SLinux: no default shortcut.Option plus Command plus S
Reopen the last closed editorControl plus Shift plus TShift plus Command plus T
Copy the path of the active fileControl plus K then PCommand plus K then P
Reveal the active file in Explorer / FinderControl plus K then RCommand plus K then R
Compare the active file with the clipboardControl plus K then CCommand plus K then C
Compare the active file with the saved versionControl plus K then DCommand plus K then D
Open the file to the side (from Quick Open or Explorer)Control plus EnterControl plus Enter
Find a file in the Explorer treeWith focus in the Explorer.Control plus Alt plus FOption plus Command plus F

Display, views and panels#

ActionWindowsMacCopy
Toggle the Primary Side BarControl plus BCommand plus B
Toggle the Secondary Side BarControl plus Alt plus BOption plus Command plus B
Toggle the panel (terminal, output, problems)Control plus JCommand plus J
Show the ExplorerControl plus Shift plus EShift plus Command plus E
Show Source Control (Git)Control plus Shift plus GControl plus Shift plus G
Show Run and DebugControl plus Shift plus DShift plus Command plus D
Show ExtensionsControl plus Shift plus XShift plus Command plus X
Show the Output panelControl plus Shift plus ULinux: Ctrl+K Ctrl+H.Shift plus Command plus U
Toggle full screenF11Control plus Command plus F
Toggle Zen Mode (press Esc twice to leave)Control plus K then ZCommand plus K then Z
Zoom inControl plus equalsCommand plus equals
Zoom outControl plus hyphenCommand plus hyphen
Reset zoomControl plus zero on the numeric keypadCommand plus zero on the numeric keypad
Toggle Markdown previewControl plus Shift plus VShift plus Command plus V
Open Markdown preview to the sideControl plus K then VCommand plus K then V

Debug and tasks#

ActionWindowsMacCopy
Toggle breakpointF9F9
Start or continue debuggingF5F5
Run without debuggingControl plus F5Control plus F5
Stop debuggingShift plus F5Shift plus F5
PauseF6F6
Step overF10F10
Step intoF11F11
Step outShift plus F11Shift plus F11
Run the build taskControl plus Shift plus BShift plus Command plus B

Integrated terminal#

ActionWindowsMacCopy
Show or hide the integrated terminalControl plus grave accentControl plus grave accent
Create a new terminalControl plus Shift plus grave accentControl plus Shift plus grave accent
Split the terminalWith the terminal focused.Control plus Shift plus 5Command plus backslash
Copy the selection in the terminalControl plus CLinux: Ctrl+Shift+C.Command plus C
Paste into the terminalControl plus VLinux: Ctrl+Shift+V.No default shortcut
Find in the terminalWith the terminal focused.Control plus FCommand plus F
Scroll to the previous commandControl plus Up arrowCommand plus Up arrow
Scroll to the next commandControl plus Down arrowCommand plus Down arrow
Scroll the terminal up a pageShift plus Page UpPage Up
Scroll the terminal down a pageShift plus Page DownPage Down
Scroll to the top of the terminalControl plus HomeLinux: Shift+Home.Command plus Home
Scroll to the bottom of the terminalControl plus EndLinux: Shift+End.Command plus End
Focus the next terminal in a split groupAlt plus Right arrowOption plus Command plus Right arrow
Focus the previous terminal in a split groupAlt plus Left arrowOption plus Command plus Left arrow
Focus the next terminal groupControl plus Page DownShift plus Command plus right bracket
Focus the previous terminal groupControl plus Page UpShift plus Command plus left bracket
Open an external terminalControl plus Shift plus CShift plus Command plus C

Chat and AI#

ActionWindowsMacCopy
Open the Chat viewControl plus Alt plus IControl plus Command plus I
Open chat in agent modeControl plus Shift plus ILinux: Ctrl+Shift+Alt+I.Shift plus Command plus I
Inline chat in the editor or terminalControl plus ICommand plus I
Open quick chatControl plus Shift plus Alt plus LOption plus Shift plus Command plus L
Open the language model pickerIn the Chat view.Control plus Alt plus periodOption plus Command plus period
Open the agent pickerIn the Chat view.Control plus periodCommand plus period
Start a new chat sessionIn the Chat view.Control plus NCommand plus N
Accept an inline (ghost text) suggestionTabTab
Sources (7 official pages)

Everything runs in your browser; searches are not sent anywhere. Shortcuts are checked against the official VS Code documentation. Browse all free tools.

Found a problem, or something that could be better? We read every message and we fix things quickly.

This VS Code shortcuts cheat sheet lists the default keyboard shortcuts of Visual Studio Code for Windows and Mac in one table, with the Linux keys noted wherever they differ. It covers the shortcuts that change how fast you edit, such as Ctrl+D to add the next match to a multi-cursor selection, Alt+Up and Down to move lines, F2 to rename a symbol everywhere and Ctrl+Shift+P for the Command Palette, plus the chords (Ctrl+K, then another key) that are hard to discover on your own.

Everything was checked on 2026-10-18 against code.visualstudio.com: the official keyboard shortcut reference sheets for Windows, macOS and Linux and the current documentation, which wins where the two disagree. These are defaults for a US keyboard layout. Extensions, keymaps (Vim, IntelliJ, Sublime) and your own keybindings.json override them, so if a shortcut does something else on your machine, check the Keyboard Shortcuts editor with Ctrl+K Ctrl+S.

How to use

  1. Pick a category chip (Multi-cursor, Search, Terminal...) or scroll the full list.
  2. Search by action ("duplicate line") or by keys ("shift alt down").
  3. For chords like Ctrl+K then Ctrl+S, press the first pair, release, then press the second.
  4. On Linux, use the Windows column unless the row has a "Linux:" note.
  5. Copy a shortcut, link to a row, or print the sheet as a PDF.

Frequently asked questions

How do I open the Command Palette in VS Code?

Press Ctrl+Shift+P on Windows and Linux or Cmd+Shift+P on a Mac. F1 works on all three. The Command Palette lists every command with its current shortcut, so it is also the quickest way to look one up. Ctrl+P (Cmd+P) opens Quick Open for files instead.

How do I use multiple cursors in VS Code?

Alt+Click (Option+Click on Mac) adds a cursor where you click. Ctrl+Alt+Up or Down (Cmd+Option+Up/Down on Mac, Shift+Alt+Up/Down on Linux) adds one on the line above or below. Ctrl+D (Cmd+D) selects the word and then each next occurrence, and Ctrl+Shift+L (Cmd+Shift+L) selects all occurrences at once. Ctrl+U undoes the last cursor you added.

What is the shortcut to format code in VS Code?

Shift+Alt+F on Windows, Shift+Option+F on a Mac and Ctrl+Shift+I on Linux formats the whole document with the formatter set for that language. To format only the selection, press Ctrl+K then Ctrl+F (Cmd+K then Cmd+F).

How do I comment out lines in VS Code?

Ctrl+/ (Cmd+/ on Mac) toggles a line comment on the current line or every selected line. Shift+Alt+A (Shift+Option+A on Mac, Ctrl+Shift+A on Linux) toggles a block comment around the selection.

How do I duplicate a line in VS Code?

Shift+Alt+Down copies the line below and Shift+Alt+Up above on Windows; on a Mac use Shift+Option+Down or Up, and on Linux Ctrl+Shift+Alt+Down or Up. Without Shift, Alt+Up and Alt+Down move the line instead of copying it.

How do I change or reset a keyboard shortcut in VS Code?

Open the Keyboard Shortcuts editor with Ctrl+K then Ctrl+S (Cmd+K then Cmd+S), search for the command, double-click it and press the new keys. To edit the JSON file directly, select the Open Keyboard Shortcuts (JSON) button at the top right of that editor. Right-click an entry for Remove Keybinding or Show Same Keybindings, which reveals conflicts.

The VS Code shortcuts that save the most time

Shortcuts for opening menus save seconds; these save minutes because they replace whole manual edits (Windows keys first, Mac in brackets):

• Ctrl+D (Cmd+D): select the next occurrence of the word for a quick multi-cursor rename

• Alt+Up / Down (Option+Up / Down): move the line; add Shift to copy it

• Ctrl+Shift+K (Cmd+Shift+K): delete the line without selecting it

• F2: rename a symbol across the project, not just in the file

• F12 and Alt+F12 (Option+F12): go to or peek at a definition; Alt+Left (Ctrl+- on Mac) jumps back

• Ctrl+. (Cmd+.): Quick Fix, for missing imports and lint fixes

• Ctrl+P (Cmd+P) and Ctrl+Shift+O (Cmd+Shift+O): open a file, then jump to a symbol in it

• Ctrl+G (Ctrl+G on Mac too): go to a line number from an error message

• Ctrl+` (Ctrl+` on Mac too): toggle the terminal; Ctrl+J (Cmd+J) toggles the whole panel

Chords: why some shortcuts need two steps

VS Code runs out of single combinations, so many commands start with Ctrl+K (Cmd+K on Mac) and wait for a second key. Press Ctrl+K, let go, then press the second part; VS Code waits for it. Ctrl+K Ctrl+S opens the Keyboard Shortcuts editor, Ctrl+K Ctrl+T the theme picker, Ctrl+K Z Zen Mode, Ctrl+K V a Markdown preview to the side and Ctrl+K Ctrl+0 folds everything.

Watch whether the second key needs Ctrl as well. Ctrl+K M (no Ctrl on the M) changes the file's language mode, while Ctrl+K Ctrl+M maximizes the editor group. This sheet writes each step out in full.

Linux and other keyboard layouts

On Linux VS Code mostly uses the Windows keys, with a few changes where the desktop environment already owns a combination. The ones to know:

• Format document: Ctrl+Shift+I instead of Shift+Alt+F

• Add cursor above/below: Shift+Alt+Up/Down instead of Ctrl+Alt+Up/Down

• Copy line up/down: Ctrl+Shift+Alt+Up/Down

• Block comment: Ctrl+Shift+A; Peek Definition: Ctrl+Shift+F10

• Go back / forward: Ctrl+Alt+- and Ctrl+Shift+-

• Terminal copy and paste: Ctrl+Shift+C and Ctrl+Shift+V

VS Code's own documents render shortcuts for a US layout. On other layouts, keys such as [, ] and / can sit elsewhere; the Keyboard Shortcuts editor shows the keys for your actual layout.

Related free tools

  • JSON Formatter — Pretty-print, minify and validate JSON, with parse errors located by line and column. In your browser, no upload.
  • Regex Tester — Test a regular expression against sample text with live match highlighting, capture groups and replace preview. Free, in your browser.
  • Claude Code Cheat Sheet — Claude Code slash commands, CLI flags, keyboard shortcuts, CLAUDE.md and settings locations, hooks and MCP commands on one page.
  • Windows Keyboard Shortcuts — Every Windows 11 shortcut in one searchable, printable list: Win key, Snap, desktops, screenshots, File Explorer.
  • Mac Keyboard Shortcuts — Every macOS shortcut with ⌘ ⌥ ⌃ ⇧ symbols explained: screenshots, window tiling, Finder, Safari and special characters.