VS Code keyboard shortcuts for Mac
66 shortcuts · Updated
These are the default VS Code keyboard shortcuts on macOS, straight from Microsoft's official keybindings reference. The command palette (Cmd Shift P) can run everything, but the shortcuts below are the ones worth firing directly - editing, multi-cursor, navigation, and window management.
Nothing matches - try fewer letters, or an action word like "close" or "split".
Or stop looking them up. Super Shortcuts puts the VS Code commands you actually use one hyper key away: hold it, see every command for the app you're in, release a key to run it. No memorizing - the cheat sheet is the shortcut.
Get Super ShortcutsGeneral7
| Shortcut | Action |
|---|---|
| Command Shift P⌘⇧P | Open the Command Palette (run any command) |
| Command P⌘P | Quick Open - jump to any file by name |
| Command Shift N⌘⇧N | New window |
| Command W⌘W | Close the current editor tab |
| Command Shift W⌘⇧W | Close the window |
| Command ,⌘, | Open Settings |
| Command K, then Command S⌘K⌘S | Open the Keyboard Shortcuts editor |
Basic editing14
| Shortcut | Action |
|---|---|
| Command X⌘X | Cut the line (with nothing selected) |
| Command C⌘C | Copy the line (with nothing selected) |
| Option Down Arrow⌥↓ | Move the line down |
| Option Up Arrow⌥↑ | Move the line up |
| Shift Option Down Arrow⇧⌥↓ | Copy the line down |
| Shift Option Up Arrow⇧⌥↑ | Copy the line up |
| Command Shift K⌘⇧K | Delete the line |
| Command Return⌘↩ | Insert a line below the current one |
| Command Shift Return⌘⇧↩ | Insert a line above the current one |
| Command ]⌘] | Indent the line |
| Command [⌘[ | Outdent the line |
| Command /⌘/ | Toggle line comment |
| Shift Option A⇧⌥A | Toggle block comment |
| Option Z⌥Z | Toggle word wrap |
Multi-cursor & selection10
| Shortcut | Action |
|---|---|
| Option Click⌥Click | Insert an extra cursor where you click |
| Command Option Up Arrow⌘⌥↑ | Add a cursor on the line above |
| Command Option Down Arrow⌘⌥↓ | Add a cursor on the line below |
| Command D⌘D | Select the next occurrence of the current word |
| Command Shift L⌘⇧L | Select every occurrence of the current selection |
| Command U⌘U | Undo the last cursor operation |
| Shift Option I⇧⌥I | Insert a cursor at the end of each selected line |
| Command L⌘L | Select the current line |
| Control Shift Command Right Arrow⌃⇧⌘→ | Expand the selection |
| Control Shift Command Left Arrow⌃⇧⌘← | Shrink the selection |
Find & replace6
| Shortcut | Action |
|---|---|
| Command F⌘F | Find in the current file |
| Command Option F⌘⌥F | Replace in the current file |
| Command G⌘G | Find next |
| Command Shift G⌘⇧G | Find previous |
| Command Shift F⌘⇧F | Search across all files |
| Command Shift H⌘⇧H | Replace across all files |
Code navigation11
| Shortcut | Action |
|---|---|
| Control G⌃G | Go to line |
| Command Shift O⌘⇧O | Go to symbol in the current file |
| Command T⌘T | Go to symbol in the workspace |
| F12F12 | Go to definition |
| Option F12⌥F12 | Peek definition |
| Shift F12⇧F12 | Show all references |
| F2F2 | Rename symbol |
| F8F8 | Jump to the next error or warning |
| Control -⌃- | Go back |
| Control Shift -⌃⇧- | Go forward |
| Command Shift \⌘⇧\ | Jump to the matching bracket |
Editor & window management6
| Shortcut | Action |
|---|---|
| Command \⌘\ | Split the editor |
| Command 1⌘1 | Focus the first editor group |
| Command 2⌘2 | Focus the second editor group |
| Command Shift T⌘⇧T | Reopen the last closed editor |
| Command K, then Command W⌘K⌘W | Close all editors |
| Control Tab⌃⇥ | Cycle through open editors |
Display & panels9
| Shortcut | Action |
|---|---|
| Command B⌘B | Toggle the sidebar |
| Command Shift E⌘⇧E | Show the Explorer |
| Control Shift G⌃⇧G | Show Source Control |
| Command Shift D⌘⇧D | Show Run & Debug |
| Command Shift X⌘⇧X | Show Extensions |
| Command J⌘J | Toggle the bottom panel |
| Command K, then Z⌘KZ | Enter Zen mode (Esc twice to exit) |
| Command =⌘= | Zoom in |
| Command -⌘- | Zoom out |
Integrated terminal3
| Shortcut | Action |
|---|---|
| Control `⌃` | Toggle the integrated terminal |
| Control Shift `⌃⇧` | Create a new terminal |
| Command Shift 5⌘⇧5 | Split the terminal |
Curated from the official VS Code macOS keyboard shortcuts reference. Defaults only - shortcuts you've remapped will differ.
Frequently asked questions
How do I see all keyboard shortcuts in VS Code?
Press ⌘K ⌘S to open the Keyboard Shortcuts editor - a searchable list of every command and its binding. The same list is behind Code → Settings → Keyboard Shortcuts.
How do I change a keyboard shortcut in VS Code?
Open the Keyboard Shortcuts editor (⌘K ⌘S), search for the command, double-click it, and press your new key combination. VS Code warns you if the combo is already taken.
What is the most important VS Code shortcut to learn first?
The Command Palette, ⌘⇧P. Every VS Code command is reachable from it by name, so it works even when you don't know (or forgot) the dedicated shortcut.