VS Code keyboard shortcuts
The VS Code shortcuts worth knowing, in one page. This is a reference to come back to, not a list to learn — the handful you actually use will stick by themselves within a week or two.
If you only ever remember one
Make it Ctrl+Shift+P / Cmd+Shift+P. The Command Palette can run every command in VS Code by name, and it shows you the keyboard shortcut for each one as you scroll past. It is a shortcut that teaches you the other shortcuts.
The five that matter
If you learn nothing else from this page, learn these. They cover most of what you will do in a normal session.
| Windows | Mac | What it does |
|---|---|---|
| Ctrl+Shift+P | Cmd+Shift+P | Open the Command Palette — search every command by name |
| Ctrl+` | Ctrl+` | Open or close the terminal |
| Ctrl+S | Cmd+S | Save the file you are looking at |
| Ctrl+Z | Cmd+Z | Undo — works on AI edits too, one step at a time |
| Ctrl+P | Cmd+P | Jump to a file by typing part of its name |
Moving between panels
Each of these opens a panel down the left-hand side. Pressing the same keys again closes it.
| Windows | Mac | What it does |
|---|---|---|
| Ctrl+Shift+E | Cmd+Shift+E | File Explorer — your project tree |
| Ctrl+Shift+X | Cmd+Shift+X | Extensions — search and install add-ons |
| Ctrl+Shift+G | Ctrl+Shift+G | Source Control — see what changed, commit, push |
| Ctrl+Shift+F | Cmd+Shift+F | Search across every file in the project |
| Ctrl+B | Cmd+B | Hide or show the sidebar — useful on a small screen |
Working in a file
Useful once you start making small edits by hand rather than asking the AI for everything.
| Windows | Mac | What it does |
|---|---|---|
| Ctrl+F | Cmd+F | Find something in the current file |
| Ctrl+/ | Cmd+/ | Comment out the selected lines (switch them off without deleting) |
| Alt+↑ / Alt+↓ | Option+↑ / Option+↓ | Move the current line up or down |
| Ctrl+W | Cmd+W | Close the current tab |
| Ctrl+Shift+T | Cmd+Shift+T | Reopen the tab you just closed by accident |
AI coding tools
These come from the Claude Code extension. Codex ships its own set — open the Command Palette and type its name to see them, since they change more often than VS Code's own.
| Windows | Mac | What it does |
|---|---|---|
| Ctrl+Esc | Cmd+Esc | Claude Code — jump between the editor and the Claude panel |
| Alt+K | Option+K | Claude Code — reference the lines you have selected in your prompt |
Change any of them
None of these are fixed. Open the Keyboard Shortcuts editor with Ctrl+K Ctrl+S / Cmd+K Cmd+S — that means pressing the two pairs one after the other — then search for a command and click the pencil to give it different keys.
This is also where to look when a shortcut on this page does nothing: occasionally an extension, or your operating system, has claimed the same combination first.
On a Mac, the symbols are the shortcuts. Menus show ⌘ for Cmd, ⇧ for Shift, ⌥ for Option and ⌃ for Control. When a menu item shows ⇧⌘P beside it, that is the same thing as Cmd+Shift+P — VS Code is telling you the shortcut every time you use the slow way.