Updated May 2026 · 9 min read
VS Code Keyboard Shortcuts: The Complete Guide for Developers
Visual Studio Code is the world's most popular code editor, used by over 70% of developers. Its keyboard shortcut system is one of the deepest of any editor — and learning it properly can cut your coding time by 30% or more. This guide covers every major category: navigation, editing, multi-cursor, terminal, and debugging.
For the full interactive reference, see the VS Code shortcuts cheat sheet.
The Core VS Code Shortcuts (Learn These First)
| Action | Windows / Linux | Mac |
|---|---|---|
| Command Palette | Ctrl+Shift+P | ⌘+Shift+P |
| Quick Open (file search) | Ctrl+P | ⌘+P |
| Open integrated terminal | Ctrl+` | Ctrl+` |
| Toggle sidebar | Ctrl+B | ⌘+B |
| Go to definition | F12 | F12 |
| Rename symbol | F2 | F2 |
| Format document | Shift+Alt+F | Shift+Option+F |
| Comment/uncomment | Ctrl+/ | ⌘+/ |
Navigation Shortcuts
Speed through large codebases without touching the file explorer or scrollbar.
| Action | Windows / Linux | Mac |
|---|---|---|
| Go to file | Ctrl+P | ⌘+P |
| Go to line number | Ctrl+G | Ctrl+G |
| Go to symbol in file | Ctrl+Shift+O | ⌘+Shift+O |
| Go to symbol in workspace | Ctrl+T | ⌘+T |
| Go back / forward | Alt+← / → | Ctrl+- / Ctrl+Shift+- |
| Jump to matching bracket | Ctrl+Shift+\ | ⌘+Shift+\ |
| Switch between open editors | Ctrl+Tab | Ctrl+Tab |
| Close current editor | Ctrl+W | ⌘+W |
| Reopen closed editor | Ctrl+Shift+T | ⌘+Shift+T |
Multi-Cursor Editing
Multi-cursor is one of VS Code's most powerful features for editing repetitive code patterns.
| Action | Windows / Linux | Mac |
|---|---|---|
| Add cursor above / below | Ctrl+Alt+↑ / ↓ | ⌘+Option+↑ / ↓ |
| Click to add cursor | Alt+Click | Option+Click |
| Select next occurrence | Ctrl+D | ⌘+D |
| Select all occurrences | Ctrl+Shift+L | ⌘+Shift+L |
| Column (box) select | Shift+Alt+drag | Shift+Option+drag |
| Undo last cursor operation | Ctrl+U | ⌘+U |
Code Editing Shortcuts
| Action | Windows / Linux | Mac |
|---|---|---|
| Move line up / down | Alt+↑ / ↓ | Option+↑ / ↓ |
| Copy line up / down | Shift+Alt+↑ / ↓ | Shift+Option+↑ / ↓ |
| Delete entire line | Ctrl+Shift+K | ⌘+Shift+K |
| Duplicate line | Shift+Alt+D | Shift+Option+D |
| Trigger IntelliSense | Ctrl+Space | Ctrl+Space |
| Quick fix / light bulb | Ctrl+. | ⌘+. |
| Indent / outdent line | Ctrl+] / [ | ⌘+] / [ |
| Expand/collapse region | Ctrl+Shift+[ / ] | ⌘+Option+[ / ] |
Search & Replace
| Action | Windows / Linux | Mac |
|---|---|---|
| Find in file | Ctrl+F | ⌘+F |
| Find & replace in file | Ctrl+H | ⌘+H |
| Find in all files | Ctrl+Shift+F | ⌘+Shift+F |
| Replace in all files | Ctrl+Shift+H | ⌘+Shift+H |
| Find next / previous | F3 / Shift+F3 | ⌘+G / ⌘+Shift+G |
Integrated Terminal
| Action | Windows / Linux | Mac |
|---|---|---|
| Toggle terminal panel | Ctrl+` | Ctrl+` |
| New terminal | Ctrl+Shift+` | Ctrl+Shift+` |
| Kill terminal | Ctrl+Shift+5 (in terminal) | ⌘+Shift+5 |
| Split terminal | Ctrl+Shift+5 | ⌘+\ |
| Focus next terminal | Alt+Down | Option+Down |
| Scroll terminal up | Ctrl+↑ | ⌘+↑ |
Debugging Shortcuts
| Action | Windows / Linux | Mac |
|---|---|---|
| Start / continue debugging | F5 | F5 |
| Stop debugging | Shift+F5 | Shift+F5 |
| Step over | F10 | F10 |
| Step into | F11 | F11 |
| Step out | Shift+F11 | Shift+F11 |
| Toggle breakpoint | F9 | F9 |
| Show hover (debug) | ⌘+K ⌘+I | ⌘+K ⌘+I |
Pro Tips for VS Code Power Users
- Ctrl+P then type ":" for line jump — quick open accepts filename:linenum so you can type "server.ts:88" and land exactly there.
- Ctrl+K Ctrl+C / Ctrl+K Ctrl+U — block comment and uncomment entire selections, more reliable than Ctrl+/ for multi-line comments.
- Shift+Alt+F to auto-format on save — set
"editor.formatOnSave": truein your settings and you'll never think about formatting again. - Ctrl+Shift+` for a new terminal per task — open one terminal for your dev server, one for git, one for tests. Switch between them without stopping any of them.
- F12 vs Ctrl+Click — both go to definition, but Ctrl+Click works when the cursor isn't already on the symbol, while F12 works wherever the cursor is.
Download the Developer Shortcuts PDF
The Developer Pack PDF includes complete cheat sheets for VS Code, Vim, IntelliJ IDEA, Cursor, and Chrome — formatted for printing or keeping open on a second monitor. One-time purchase, instant download.
Related Shortcut References
- VS Code Shortcuts — Full Interactive Reference
- Vim Keyboard Shortcuts
- IntelliJ IDEA Keyboard Shortcuts
- Cursor AI Shortcuts
- VS Code vs Vim Shortcuts Compared
Frequently Asked Questions
What is the single most important VS Code shortcut to learn first?
Ctrl+Shift+P (Cmd+Shift+P on Mac) — the Command Palette. Every VS Code command, setting, and extension action is accessible from here. If you forget a shortcut, open the Command Palette and search for the action by name.
How do I open a file quickly in VS Code without using the file explorer?
Press Ctrl+P (Cmd+P on Mac) to open Quick Open. Start typing the filename and VS Code will fuzzy-search your entire project. Add a colon and line number (e.g. 'app.ts:42') to jump directly to a specific line.
How do I edit multiple lines at the same time in VS Code?
Hold Alt and click to place cursors at multiple positions. Press Ctrl+D to select the next occurrence of the selected text and add a cursor there — repeat to keep selecting more. Press Ctrl+Shift+L to select all occurrences at once.
How do I move a line of code up or down in VS Code?
Press Alt+Up to move the current line up and Alt+Down to move it down. This works on the current line without selecting it first. You can also move multiple selected lines at once with the same shortcut.
What is the VS Code shortcut to comment out code?
Press Ctrl+/ (Cmd+/ on Mac) to toggle a line comment on the current line or all selected lines. Press Ctrl+Shift+A (Cmd+Option+A on Mac) to toggle a block comment around the selection.