Essential keyboard shortcuts for Visual Studio Code — navigate, edit, and refactor at lightning speed.
| Shortcut | Action |
|---|---|
| ⌘ + ⇧ + P | Command Palette |
| ⌘ + P | Quick Open file |
| ⌘ + ⇧ + N | New window |
| ⌘ + W | Close editor |
| ⌘ + , | User settings |
| ⌘ + K ⌘ + S | Keyboard shortcuts |
| ⌘ + ` | Toggle terminal |
| ⌘ + B | Toggle sidebar |
| ⌘ + J | Toggle bottom panel |
| ⌘ + ⇧ + E | Focus Explorer |
| ⌘ + ⇧ + F | Focus Search |
| ⌘ + ⇧ + G | Focus Source Control |
| ⌘ + ⇧ + D | Focus Debug |
| ⌘ + ⇧ + X | Focus Extensions |
| ⌘ + K Z | Zen Mode |
| ⌘ + \ | Split editor |
| Shortcut | Action |
|---|---|
| ⌘ + X | Cut line (empty selection) |
| ⌘ + C | Copy line (empty selection) |
| ⌥ + ↑ | Move line up |
| ⌥ + ↓ | Move line down |
| ⇧ + ⌥ + ↑ | Copy line up |
| ⇧ + ⌥ + ↓ | Copy line down |
| ⌘ + ⇧ + K | Delete line |
| ⌘ + Enter | Insert line below |
| ⌘ + ⇧ + Enter | Insert line above |
| ⌘ + ⇧ + \ | Jump to matching bracket |
| ⌘ + ] | Indent line |
| ⌘ + [ | Outdent line |
| ⌘ + / | Toggle line comment |
| ⇧ + ⌥ + A | Toggle block comment |
| ⌥ + Z | Toggle word wrap |
| ⌥ + ↑ | Move line up |
| ⌥ + ↓ | Move line down |
| ⌘ + ⇧ + K | Delete line |
| ⌘ + Enter | Insert line below |
| ⌘ + ⇧ + Enter | Insert line above |
| ⌘ + ] | Indent line |
| ⌘ + [ | Outdent line |
| ⌘ + / | Toggle line comment |
| ⌘ + ⇧ + A | Toggle block comment |
| ⌥ + ⇧ + F | Format document |
| ⌘ + K ⌘ + F | Format selection |
| F12 | Go to Definition |
| ⌥ + F12 | Peek Definition |
| ⌘ + . | Quick Fix |
| F2 | Rename symbol |
| ⌘ + ⇧ + Space | Parameter hints |
| Shortcut | Action |
|---|---|
| ⌥ + Click | Insert cursor |
| ⌥ + ⌘ + ↑ | Add cursor above |
| ⌥ + ⌘ + ↓ | Add cursor below |
| ⌘ + D | Select next occurrence |
| ⌘ + ⇧ + L | Select all occurrences |
| ⌘ + L | Select current line |
| ⌘ + ⌥ + ⇧ + → | Expand selection |
| ⌘ + ⌥ + ⇧ + ← | Shrink selection |
| Shortcut | Action |
|---|---|
| ⌘ + F | Find |
| ⌘ + H | Replace |
| ⌘ + ⇧ + F | Find in files |
| ⌘ + ⇧ + H | Replace in files |
| F3 | Find next |
| ⇧ + F3 | Find previous |
| ⌥ + Enter | Select all matches |
| ⌘ + G | Go to line |
| Shortcut | Action |
|---|---|
| ⌘ + T | Show all symbols |
| ⌃ + G | Go to line |
| ⌘ + P | Go to file |
| ⌘ + ⇧ + O | Go to symbol |
| ⌃ + Tab | Switch between editors |
| ⌘ + B | Toggle sidebar |
| ⌘ + J | Toggle panel |
| ⌘ + K Z | Zen mode |
| ⌃ + Tab | Switch between open editors |
| ⌘ + ⇧ + O | Go to Symbol in file |
| ⌘ + T | Go to Symbol in workspace |
| ⌘ + G | Go to Line |
| ⌃ + - | Navigate back |
| ⌃ + ⇧ + - | Navigate forward |
| ⌘ + ⇧ + M | Toggle Problems panel |
| F8 | Go to next error/warning |
| ⌘ + K ⌘ + Left | Focus left editor group |
| ⌘ + K ⌘ + Right | Focus right editor group |