Visual Studio Code keyboard shortcuts for Mac

Edit code, navigate symbols, search a workspace and use editor groups deliberately.

Documentation reviewed 2026-11-03 · 20 task guides · Mac bindings and focus notes

What do you want to do?

Quick reference

Selected bindings from the linked task guides. Check the context before pressing a key: the focused control, app version and your custom settings can change what it does. This is a documentation reference, not an exhaustive live menu reading.

Visual Studio Code shortcut quick reference
ActionKeysContext
Close the active editorCommand-WApplies to the active editor context; handle any save prompt deliberately. Source ↗Read the task guide →
Search editor commandsShift-Command-PThe Command Palette lists commands rather than repository files. Source ↗Read the task guide →
Step overF10Advances within the active debugging workflow. Source ↗Read the task guide →
Open the definitionF12Uses the current language provider’s definition information. Source ↗Read the task guide →
Expand the structured selectionControl-Shift-Command-Right ArrowDepends on the syntax and language support of the focused editor. Source ↗Read the task guide →
Find in the current fileCommand-FUses the focused editor’s document context. Source ↗Read the task guide →
Find a symbol in this fileShift-Command-OUses symbols from the active editor’s language support. Source ↗Read the task guide →
Fold the current regionOption-Command-[Collapses a recognised code region near the cursor. Source ↗Read the task guide →
Format the documentShift-Option-FRequires a formatter suitable for the active language. Source ↗Read the task guide →
Jump to a lineControl-GOpen the correct file before using a line-number reference. Source ↗Read the task guide →
Toggle line commentCommand-/Uses the active language’s line-comment behaviour. Source ↗Read the task guide →
Move a line upwardOption-Up ArrowCan act on the selected lines rather than only one line. Source ↗Read the task guide →
Open ProblemsShift-Command-MInspect diagnostic source, file and message. Source ↗Read the task guide →
Rename the current symbolF2Requires language support and an appropriate symbol under the cursor. Source ↗Read the task guide →
Run the configured build taskShift-Command-BMay require choosing a task; inspect what it will execute. Source ↗Read the task guide →
Add the next matching occurrenceCommand-DBuild the selected matches incrementally and inspect their contexts. Source ↗Read the task guide →
Split the current editorCommand-BackslashCreates another editor group according to the current layout. Source ↗Read the task guide →
Show the integrated terminalControl-`Uses the backtick key; layout and terminal settings can affect the binding. Source ↗Read the task guide →

When a shortcut behaves differently

  1. Confirm you are using the Mac binding, and check whether the guide describes a desktop app or its web version.
  2. Put focus in the control named in the guide. Editing text, selecting an object and navigating a sidebar can use different keys.
  3. Look up the command in the app's menu or shortcut settings. Customized keys and non-US keyboard layouts can differ from documented defaults.

The cited documentation was checked for these guides; a documentation review is separate from testing your particular running app. How we verify and update guides →

Official sources

Explore other apps →