Browse all keyboard shortcut cheat sheets
VS Code Keyboard Shortcuts (Latest) — Complete Cheat Sheet
Supercharge your coding workflow in Visual Studio Code with shortcuts for editing, navigation, terminal, and debugging.
47 shortcuts across 5 categories · Windows · macOS · Linux
Visual Studio Code is the most widely used code editor, and its extensive keyboard shortcut system is one of its greatest strengths. From multi-cursor editing to the Command Palette, mastering VS Code shortcuts lets you write, navigate, and refactor code without ever reaching for the mouse.
Editing
| Action | Shortcut | Description |
|---|---|---|
| Command Palette | Ctrl + Shift + P | Open the command palette to run any VS Code command |
| Quick Open File | Ctrl + P | Quickly open any file by name |
| Duplicate Line | Shift + Alt + ↓ | Duplicate the current line below |
| Move Line Down | Alt + ↓ | Move the current line down |
| Move Line Up | Alt + ↑ | Move the current line up |
| Delete Line | Ctrl + Shift + K | Delete the entire current line |
| Toggle Comment | Ctrl + / | Toggle line comment on the current line or selection |
| Block Comment | Shift + Alt + A | Toggle block comment on the selection |
| Format Document | Shift + Alt + F | Auto-format the entire document |
| Rename Symbol | F2 | Rename a variable or function across all files |
| Add Multiple Cursors | Alt + Click | Place additional cursors by clicking with Alt held |
| Select All Occurrences | Ctrl + Shift + L | Select every occurrence of the current word |
| Expand Selection | Shift + Alt + → | Expand the selection to the next logical unit |
Navigation
| Action | Shortcut | Description |
|---|---|---|
| Go to Definition | F12 | Jump to where a function or variable is defined |
| Peek Definition | Alt + F12 | View the definition inline without leaving the file |
| Go to References | Shift + F12 | Find all references to the symbol under the cursor |
| Go to Line | Ctrl + G | Jump to a specific line number |
| Go to Symbol in File | Ctrl + Shift + O | Jump to a function or class in the current file |
| Go to Symbol in Workspace | Ctrl + T | Search for any symbol across all files |
| Navigate Back | Alt + ← | Go back to the previous cursor location |
| Navigate Forward | Alt + → | Go forward to the next cursor location |
| Switch Tab | Ctrl + Tab | Switch between open editor tabs |
| Split Editor | Ctrl + \ | Split the editor into two side-by-side panels |
Search & Replace
| Action | Shortcut | Description |
|---|---|---|
| Find | Ctrl + F | Open find widget in the current file |
| Replace | Ctrl + H | Open find and replace in the current file |
| Find in Files | Ctrl + Shift + F | Search across all files in the workspace |
| Replace in Files | Ctrl + Shift + H | Find and replace across all files |
| Toggle Case Sensitive | Alt + C | Toggle case-sensitive search in the find widget |
| Toggle Regex | Alt + R | Toggle regular expression mode in the find widget |
| Find Next | Enter | Jump to the next search match |
| Find Previous | Shift + Enter | Jump to the previous search match |
Terminal & Panels
| Action | Shortcut | Description |
|---|---|---|
| Toggle Terminal | Ctrl + ` | Show or hide the integrated terminal panel |
| New Terminal | Ctrl + Shift + ` | Open a new terminal instance |
| Toggle Sidebar | Ctrl + B | Show or hide the file explorer sidebar |
| Toggle Problems Panel | Ctrl + Shift + M | Show errors and warnings in the Problems panel |
| Toggle Output Panel | Ctrl + Shift + U | Show the output panel |
| Zoom In | Ctrl + + | Increase the editor font size |
| Zoom Out | Ctrl + - | Decrease the editor font size |
| Reset Zoom | Ctrl + 0 | Reset the editor zoom to default |
Debug & Source Control
| Action | Shortcut | Description |
|---|---|---|
| Toggle Breakpoint | F9 | Add or remove a breakpoint on the current line |
| Start / Continue Debugging | F5 | Start a debug session or resume from a breakpoint |
| Step Over | F10 | Execute the next line without entering function calls |
| Step Into | F11 | Step into the function call on the current line |
| Step Out | Shift + F11 | Step out of the current function |
| Stop Debugging | Shift + F5 | Stop the current debug session |
| Open Source Control | Ctrl + Shift + G | Open the Git source control panel |
| Stage Changes | Ctrl + Enter | Stage selected changes in the source control panel |
VS Code Tips & Tricks
- Multi-cursor editing saves massive time: Place your cursor on a word, press Ctrl+D to select the next occurrence, and keep pressing to select more. Edit all of them simultaneously.
- Use the Command Palette for everything: Press Ctrl+Shift+P and type anything — install extensions, change settings, run tasks, or switch themes — all without leaving the keyboard.
- Emmet shortcuts speed up HTML/CSS: Type a CSS selector like ul>li*5 and press Tab — VS Code expands it into a full HTML structure instantly.
Frequently Asked Questions — VS Code
- Are these shortcuts the same in VS Code forks like Cursor?
- Almost entirely — Cursor and similar forks inherit VS Code's keymap and add their own AI-specific bindings. We track those separately on our Cursor cheat sheet.
- What are the Mac equivalents for VS Code shortcuts?
- As a rule Ctrl becomes Cmd, and Alt becomes Option. The exceptions are noted per-shortcut in the tables above.
- How do I print just the VS Code shortcuts I'm currently learning?
- Use the print/PDF version of this page and highlight your current three to five. Adding shortcuts in small batches sticks far better than reading the full list once.
The only shortcut you truly need on day one
Ctrl + Shift + P (Cmd + Shift + P on Mac) opens the Command Palette, and it makes every other shortcut optional: type what you want ("format document", "toggle terminal", "change language mode") and VS Code finds the command — and shows you its keyboard shortcut, which is how most people organically learn the rest. If you remember one thing from this page, make it this.
The next nine, in the order they'll pay off
- Ctrl + P — jump to any file by fuzzy name matching. Faster than the file tree once your project has more than a dozen files.
- Ctrl + D — select the next occurrence of the current word, adding a cursor each time. Rename a variable in a few keystrokes; press Ctrl+K then Ctrl+D to skip an occurrence.
- Alt + Up / Down — move the current line (or selection) up or down. Rearranging code without cut-and-paste feels illegal the first time.
- Shift + Alt + Up / Down — copy the line up/down instead of moving it.
- Ctrl + / — toggle line comment, language-aware.
- Ctrl + ` (backtick) — toggle the integrated terminal.
- F2 — rename a symbol project-wide, using the language server rather than find-and-replace. Safer than Ctrl+H for code.
- Ctrl + B — toggle the sidebar for more editing room.
- Ctrl + Shift + F — search across the entire project.
Multi-cursor editing: the five-minute skill worth an hour of reading
VS Code's real superpower is multiple cursors. Three ways to get them: Alt + Click places a cursor anywhere; Ctrl + Alt + Up/Down adds cursors on adjacent lines (perfect for editing columns of similar text); and Ctrl + D, described above, adds them by matching selection. Escape returns to one cursor. If you edit config files, CSV-ish data, or repetitive code, this replaces most regex find-and-replace you'd otherwise write.
Common problems and fixes
- A shortcut does nothing or does the wrong thing? An extension probably rebound it. Open Keyboard Shortcuts (Ctrl+K, Ctrl+S), search for the key combo, and you'll see every command competing for it — including a right-click option to see conflicts.
- Coming from Vim, Sublime, or JetBrains? Don't retrain your hands: install the official keymap extension (search the marketplace for "keymap") and keep your existing muscle memory.
- Ctrl + ` doesn't work on some international keyboards? Known quirk with certain layouts — rebind "Toggle Terminal" in Keyboard Shortcuts to something your layout can type comfortably.