App shortcuts

VS Code keyboard shortcuts for Mac

Every chord below is the macOS binding VS Code itself publishes. Nothing is translated from the Windows list, and nothing was written from memory — each one was read from the editor's own keybindings reference.

Updated August 5, 202612 min read

Editing lines and text

Command and slash shown as mechanical keycaps — VS Code's toggle a line comment chord
⌘/toggle a line comment

VS Code's line commands work on the current line when nothing is selected, which is what makes them worth learning: ⌘X with an empty selection cuts the whole line rather than nothing at all. That one behaviour removes most of the selecting people do before they edit.

The chords marked with two parts, such as ⌘K ⌘C, are chords in the musical sense — press the first pair, release, then press the second. VS Code shows a pending-chord indicator in the status bar while it waits for the second half, so a chord that appears to do nothing usually means the second press missed.

ShortcutWhat it does
⌘XCut the current line when nothing is selected
⌘CCopy the current line when nothing is selected
⇧⌘KDelete the current line
⌘EnterInsert a line below and move the cursor to it
⇧⌘EnterInsert a line above and move the cursor to it
⌥↓Move the current line down
⌥↑Move the current line up
⇧⌥↓Copy the current line down
⇧⌥↑Copy the current line up
⌘]Indent the line
⌘[Outdent the line
⌘/Toggle a line comment
⇧⌥AToggle a block comment
⇧⌘\Jump to the matching bracket
⌥ZToggle word wrap

Multiple cursors and selection

Multi-cursor editing is the single largest difference between someone who is fast in VS Code and someone who is not, and it starts with one chord. ⌘D selects the word under the cursor, and each further press adds the next occurrence to the selection — so a rename becomes typing the new name once with six cursors down the file.

⌘K ⌘D is the escape hatch for the occurrence you did not want: it moves the last selection on to the next match instead of adding to it. ⌘U undoes the most recent cursor operation without undoing the edit, which is what you want when one press of ⌘D went one match too far.

ShortcutWhat it does
⌘DAdd the next match of the selection as another cursor
⌘K ⌘DMove the last selection to the next match instead of adding it
⇧⌘LSelect every occurrence of the current selection at once
⌘F2Select every occurrence of the current word
⌥⌘↓Insert a cursor on the line below
⌥⌘↑Insert a cursor on the line above
⇧⌥IInsert a cursor at the end of every selected line
⌘UUndo the last cursor operation
⌘LSelect the current line
⌃⇧⌘→Expand the selection to the next syntax node
⌃⇧⌘←Shrink the selection to the previous syntax node
⌥EnterSelect all occurrences of the current find match

Moving around a project

Shift, Command and P shown as mechanical keycaps — VS Code's Command Palette chord
⇧⌘Pshow all commands in the Command Palette

Quick Open and the Command Palette are the same widget wearing two hats, which is why ⌘P and ⇧⌘P feel identical. ⌘P searches file names; typing a > into it turns it into the Command Palette, and ⇧⌘P simply starts you there.

The two history chords are the ones people miss. ⌃- steps back to where you were before the last jump to a definition, and ⌃⇧- steps forward again — the browser back button for code, and the reason you can chase a call chain four files deep and still find your way home.

ShortcutWhat it does
⌘PGo to File, and Quick Open generally
⇧⌘PShow all commands in the Command Palette
⌘TShow all symbols across the workspace
⇧⌘OGo to a symbol in the current file
⌃GGo to a line number
⇧⌘MShow the Problems panel
F8Go to the next error or warning
⇧F8Go to the previous error or warning
⌃-Go back to the previous location
⌃⇧-Go forward again
⌃TabCycle through the editor group's history
⇧⌘;Focus the breadcrumbs
⌘↑Go to the beginning of the file
⌘↓Go to the end of the file

Finding and replacing

There are two search surfaces in VS Code and they take different chords: ⌘F searches the file you are in, ⇧⌘F searches every file in the workspace. The three toggle chords — case, whole word, regular expression — work in both, and they are worth learning because clicking those small buttons in the find widget is fiddly at any window size.

Search Editor is the third surface and the least known. ⌘Enter from the search view opens the results as an editable document you can scroll, annotate and keep, rather than a panel that vanishes the moment you search for something else.

ShortcutWhat it does
⌘FFind in the current file
⌥⌘FReplace in the current file
EnterFind the next match, from the find widget
⇧EnterFind the previous match, from the find widget
⌥⌘CToggle case-sensitive matching
⌥⌘WToggle whole-word matching
⌥⌘RToggle regular expression matching
⇧⌘FSearch across every file in the workspace
⇧⌘HReplace across every file in the workspace
⇧⌘JToggle the search details, including include and exclude globs
F4Focus the next search result
⇧F4Focus the previous search result
⌘EnterOpen the search results in an editor
⇧⌘RRun the search again, from a search editor

Language features and folding

These are the chords that make an editor an IDE. ⌘. is the most valuable of them: it opens the Quick Fix menu for whatever the cursor is sitting on, which is where imports get added, protocols get stubbed and lint rules get silenced, all without reaching for the mouse.

F12 jumps to a definition and ⌥F12 peeks at it inline instead — the difference matters when you want to read a function signature without losing your place. ⌘K F12 splits the difference by opening the definition beside your current file.

ShortcutWhat it does
⌃SpaceTrigger the suggestion list
⇧⌘SpaceTrigger parameter hints
⇧⌥FFormat the whole document
⌘K ⌘FFormat the current selection
F12Go to the definition
⌥F12Peek the definition inline
⌘K F12Open the definition in a side editor
⇧F12Go to references
⌘K ⌘IShow the hover documentation
⌘.Open the Quick Fix menu
F2Rename the symbol everywhere
⌥⌘[Fold the region at the cursor
⌥⌘]Unfold the region at the cursor
⌘K ⌘0Fold every region in the file
⌘K ⌘JUnfold every region in the file

Files, editors and the workbench

VS Code arranges editors into groups rather than plain tabs, and the numbered chords focus a group rather than a document. ⌘1 through ⌘3 move between the first three, which covers almost every split anyone actually works in.

⇧⌘T is the chord to remember after a mis-click: it reopens the editor you just closed, as many times as you need to walk back. ⌘K Z drops into Zen Mode for a screenshot or a demo, and two presses of Escape leave it again.

ShortcutWhat it does
⌘NNew file
⌘OOpen a file
⌘SSave
⌥⌘SSave all
⇧⌘SSave as
⌘WClose the editor
⇧⌘TReopen the editor you just closed
⌘\Split the editor
⌘1Focus the first editor group
⌘BToggle the sidebar
⌘K ZEnter Zen Mode; Escape twice to leave
⌃⌘FToggle full screen
⇧⌘EShow the Explorer, or toggle focus into it
⇧⌘XShow the Extensions view
⌘K ⌘SOpen the Keyboard Shortcuts editor

The integrated terminal

The terminal has its own keyboard universe, and the first thing to know is that ⌘\ splits the terminal when the terminal has focus and splits the editor when the editor does. Same chord, different pane, decided entirely by where the cursor is.

The two command-navigation chords depend on shell integration being active. When it is, ⌘↑ and ⌘↓ jump between the commands you have run rather than scrolling by line — which is how you find the output of the build from four commands ago without dragging a scrollbar.

ShortcutWhat it does
⌃`Toggle the terminal panel
⌃⇧`Create a new terminal
⌘\Split the terminal, when the terminal has focus
⌥⌘←Focus the previous terminal pane in the group
⌥⌘→Focus the next terminal pane in the group
⇧⌘]Focus the next terminal group
⇧⌘[Focus the previous terminal group
⌘FFind in the terminal
⌘↑Scroll to the previous command, with shell integration
⌘↓Scroll to the next command, with shell integration
⌥⌘PageUpScroll up one line
⌥⌘PageDownScroll down one line
⌘HomeScroll to the top of the buffer
⌘EndScroll to the bottom of the buffer
⇧⌘COpen an external terminal at the current folder

Debugging

Shift, Command and F5 shown as mechanical keycaps — VS Code's restart the debugging session chord
⇧⌘F5restart the debugging session

Debugging is the one group built on function keys, which is a problem on a Mac laptop: unless you have turned on the option to use F1, F2 and so on as standard function keys, F5 needs an fn press to reach VS Code at all. Turning that setting on is the single change that makes this table usable.

F5 does double duty — it starts a session and continues a paused one — while ⌃F5 runs without attaching the debugger at all. ⇧F5 stops and ⇧⌘F5 restarts, which is the pair you will wear out.

ShortcutWhat it does
F5Start debugging, or continue a paused session
⌃F5Run without debugging
⇧F5Stop the session
⇧⌘F5Restart the session
F6Pause
F10Step over the next call
F11Step into the next call
⇧F11Step out of the current call
F9Toggle a breakpoint on the current line
⇧F9Set an inline breakpoint
⇧⌘DShow the Run and Debug view
⇧⌘YOpen the Debug Console
⌥⌘FFilter the Variables view by name or value

Show VS Code shortcuts on screen while you demo

A shortcut pressed in VS Code is invisible to whoever is watching. The Command Palette opens, six cursors appear, the terminal splits — and the audience sees the result with no idea what caused it. In a recorded tutorial or a pairing session that gap is the whole problem, and narrating every chord out loud only works if your voice keeps perfect pace with your hands, which it does not once you are typing quickly.

Show KeyPress is a paid macOS menu bar app, for macOS 14 Sonoma or later, that closes the gap by drawing each key you press as a keycap on top of everything else on screen. It has no VS Code integration, no extension to install and no video recording of its own — it is a window drawn above your other windows, which is exactly why any recorder or conferencing tool capturing a display picks it up.

  • Shortcuts Only content mode draws combinations like ⇧⌘P and stays quiet while you type actual code.
  • Three reading modes: Latest for one combination at a time, Horizontal History for a row of recent keycaps, Stacked History for continuous typing grouped into fragments.
  • One Display pins the overlay to the screen you are capturing instead of letting it follow your pointer between monitors.
  • The overlay is click-through, so it never intercepts a click meant for the editor underneath.
  • ⌘⇧K toggles the whole thing between takes, and ⌃⌥= and ⌃⌥- resize it without opening Settings.

Sources and further reading

Product details and guidance were checked against these first-party pages on August 5, 2026. Re-check current listings before making an install or high-stakes decision.

FAQ

Questions people ask

Where does VS Code list all of its Mac keyboard shortcuts?

In two places. The Keyboard Shortcuts editor inside VS Code, at ⌘K ⌘S, is the authoritative list for your installation because it includes bindings added by extensions. The published default keybindings reference covers the built-in commands with the macOS chord for each one.

How do I change a VS Code keyboard shortcut on macOS?

Open the Keyboard Shortcuts editor with ⌘K ⌘S, search for the command by name or by its current chord, then double-click the binding and press the combination you would rather use. Everything you change is written to a keybindings.json file you can move between machines.

What does a chord like ⌘K ⌘C mean?

Press ⌘K, release, then press ⌘C. VS Code shows a pending indicator in the status bar while it waits for the second half of the chord. If nothing happens, the second press usually arrived after the chord timed out or another binding claimed it first.

Why does F5 do nothing when I press it?

On most Mac keyboards the top row sends media keys unless you press fn as well, or turn on the option to use F1, F2 and so on as standard function keys in System Settings under Keyboard. The debugging shortcuts are the group this affects most.

Will an overlay show my keys when I record a VS Code tutorial?

Yes, provided your recorder captures a display rather than a single application window. An overlay is a separate window drawn above VS Code, so it is not part of VS Code's own window content and a window-scoped capture can leave it out.

Continue the topic