# VS Code keyboard shortcuts (Mac)

> The most used VS Code shortcuts on Mac: Command Palette (⇧⌘P), Quick Open, go to file (⌘P), Save (⌘S), Toggle line comment (⌘/), Add next match to selection (⌘D). This page lists all 50, from the official documentation.

- Source: [Microsoft · code.visualstudio.com](https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf), retrieved November 19, 2026 (2026-11-19)
- Page: https://www.modandkey.com/vscode-keyboard-shortcuts/mac
- Also: [Windows](https://www.modandkey.com/md/vscode-keyboard-shortcuts.md), [Linux](https://www.modandkey.com/md/vscode-keyboard-shortcuts/linux.md)
- Unofficial reference. Not affiliated with Microsoft.

## Files & general

| Command | Shortcut |
|---|---|
| Command Palette | ⇧⌘P |
| Quick Open, go to file | ⌘P |
| User Settings | ⌘, |
| New file | ⌘N |
| Save | ⌘S |
| Close editor | ⌘W |
| Reopen closed editor | ⇧⌘T |
| Split editor | ⌘\ |

## Basic editing

| Command | Shortcut |
|---|---|
| Move line up | ⌥↑ |
| Copy line down | ⌥⇧↓ |
| Delete line | ⇧⌘K |
| Insert line below | ⌘↩ |
| Indent line | ⌘] |
| Outdent line | ⌘[ |
| Toggle line comment | ⌘/ |
| Toggle block comment | ⌥⇧A |
| Toggle word wrap | ⌥Z |
| Fold region | ⌥⌘[ |
| Unfold region | ⌥⌘] |
| Jump to matching bracket | ⇧⌘\ |

## Multi-cursor & search

| Command | Shortcut |
|---|---|
| Insert cursor above | ⌥⌘↑ |
| Insert cursor below | ⌥⌘↓ |
| Select current line | ⌘L |
| Select all occurrences | ⇧⌘L |
| Add next match to selection | ⌘D |
| Expand selection | ⌃⇧⌘→ |
| Find | ⌘F |
| Replace | ⌥⌘F |
| Search in files | ⇧⌘F |
| Replace in files | ⇧⌘H |

## Code & navigation

| Command | Shortcut |
|---|---|
| Trigger suggestion | ⌃Space |
| Format document | ⌥⇧F |
| Go to Definition | F12 |
| Peek Definition | ⌥F12 |
| Show References | ⇧F12 |
| Rename symbol | F2 |
| Quick Fix | ⌘. |
| Go to line | ⌃G |
| Go to symbol | ⇧⌘O |
| Problems panel | ⇧⌘M |
| Next error or warning | F8 |

## Panels, terminal & debug

| Command | Shortcut |
|---|---|
| Toggle sidebar | ⌘B |
| Explorer | ⇧⌘E |
| Extensions | ⇧⌘X |
| Source Control | ⌃⇧G |
| Show integrated terminal | ⌃` |
| New terminal | ⌃⇧` |
| Toggle breakpoint | F9 |
| Start / continue debugging | F5 |
| Step over | F10 |
