VS Code ships with hundreds of keyboard shortcuts. This cheat sheet covers the ones you will reach for every day, grouped by what you are doing: editing, navigating, searching, working with the terminal, or debugging.
Each table shows the Windows/Linux key first, then the macOS key.
Modifier key translations: Ctrl on Windows/Linux is Cmd on macOS. Alt on Windows/Linux is Opt on macOS.
Open anything fast
These three shortcuts are your entry points to everything else in VS Code. Memorize them first.
| Action | Windows / Linux | macOS |
|---|---|---|
| Command Palette (run any command) | Ctrl+Shift+P | Cmd+Shift+P |
| Quick Open (open any file) | Ctrl+P | Cmd+P |
| Keyboard Shortcuts reference | Ctrl+K Ctrl+S | Cmd+K Cmd+S |
The Command Palette lets you type a command name instead of finding it in a menu. Quick Open finds any file in your project by typing part of its name. If you are new to these tools, the guide on using the Command Palette walks through every feature.
Basic editing
| Action | Windows / Linux | macOS |
|---|---|---|
| Undo / Redo | Ctrl+Z / Ctrl+Y | Cmd+Z / Cmd+Shift+Z |
| Cut / Copy / Paste line (no selection needed) | Ctrl+X / Ctrl+C / Ctrl+V | Cmd+X / Cmd+C / Cmd+V |
| Move line up / down | Alt+Up / Alt+Down | Opt+Up / Opt+Down |
| Copy line up / down | Shift+Alt+Up / Shift+Alt+Down | Shift+Opt+Up / Shift+Opt+Down |
| Delete line | Ctrl+Shift+K | Cmd+Shift+K |
| Insert line below / above | Ctrl+Enter / Ctrl+Shift+Enter | Cmd+Enter / Cmd+Shift+Enter |
| Toggle line comment | Ctrl+/ | Cmd+/ |
| Toggle block comment | Shift+Alt+A | Shift+Opt+A |
| Format document | Shift+Alt+F | Shift+Opt+F |
| Format selection | Ctrl+K Ctrl+F | Cmd+K Cmd+F |
| Indent / Outdent line | Ctrl+] / Ctrl+[ | Cmd+] / Cmd+[ |
Multiple cursors and selection
| Action | Windows / Linux | macOS |
|---|---|---|
| Add cursor above / below | Ctrl+Alt+Up / Ctrl+Alt+Down | Cmd+Opt+Up / Cmd+Opt+Down |
| Add cursor at click | Alt+Click | Opt+Click |
| Select next occurrence of word | Ctrl+D | Cmd+D |
| Select all occurrences of word | Ctrl+Shift+L | Cmd+Shift+L |
| Skip next occurrence (while using Ctrl+D) | Ctrl+K Ctrl+D | Cmd+K Cmd+D |
| Select current line | Ctrl+L | Cmd+L |
| Expand / shrink selection | Shift+Alt+Right / Shift+Alt+Left | Ctrl+Shift+Cmd+Right / Ctrl+Shift+Cmd+Left |
| Column (box) selection | Shift+Alt+drag | Shift+Opt+drag |
Find and replace
| Action | Windows / Linux | macOS |
|---|---|---|
| Find in file | Ctrl+F | Cmd+F |
| Find next / previous | F3 / Shift+F3 | Cmd+G / Cmd+Shift+G |
| Replace in file | Ctrl+H | Cmd+Opt+F |
| Find across all files | Ctrl+Shift+F | Cmd+Shift+F |
| Replace across all files | Ctrl+Shift+H | Cmd+Shift+H |
The Find control seeds its search from selected text. Select a word, press Ctrl+F, and it appears in the search box. Toggle Match Case, Match Whole Word, and regex from the icons inside the Find control.
Navigation
| Action | Windows / Linux | macOS |
|---|---|---|
| Go to file | Ctrl+P | Cmd+P |
| Go to symbol in file | Ctrl+Shift+O | Cmd+Shift+O |
| Go to symbol in workspace | Ctrl+T | Cmd+T |
| Go to line | Ctrl+G | Ctrl+G |
| Go to definition | F12 | F12 |
| Go to references | Shift+F12 | Shift+F12 |
| Peek definition | Alt+F12 | Opt+F12 |
| Rename symbol | F2 | F2 |
| Switch between open editors | Ctrl+Tab | Ctrl+Tab |
| Go back / forward | Alt+Left / Alt+Right | Ctrl+- / Ctrl+Shift+- |
| Focus breadcrumbs | Ctrl+Shift+. | Cmd+Shift+. |
On macOS, Cmd+G is not Go to Line. It repeats the last Find, so use Ctrl+G for Go to Line instead.
Terminal
| Action | Windows / Linux | macOS |
|---|---|---|
| Toggle terminal | Ctrl+` | Ctrl+` |
| New terminal | Ctrl+Shift+` | Ctrl+Shift+` |
| Switch between terminals | Ctrl+PageUp / Ctrl+PageDown | Cmd+Shift+[ / Cmd+Shift+] |
| Split terminal | Ctrl+Shift+5 | Cmd+Shift+5 |
| Clear terminal | Ctrl+K | Cmd+K |
| Focus next / previous pane | Alt+Right / Alt+Left | Cmd+Opt+Right / Cmd+Opt+Left |
Debugging
| Action | Windows / Linux | macOS |
|---|---|---|
| Start / Continue debugging | F5 | F5 |
| Step over | F10 | F10 |
| Step into | F11 | F11 |
| Step out | Shift+F11 | Shift+F11 |
| Toggle breakpoint | F9 | F9 |
| Show Debug Console | Ctrl+Shift+Y | Cmd+Shift+Y |
Display and layout
| Action | Windows / Linux | macOS |
|---|---|---|
| Toggle sidebar visibility | Ctrl+B | Cmd+B |
| Toggle Explorer | Ctrl+Shift+E | Cmd+Shift+E |
| Toggle Search | Ctrl+Shift+F | Cmd+Shift+F |
| Toggle Terminal | Ctrl+` | Ctrl+` |
| Zen Mode | Ctrl+K Z | Cmd+K Z |
| Close editor | Ctrl+W | Cmd+W |
| Reopen closed editor | Ctrl+Shift+T | Cmd+Shift+T |
How to find any shortcut
You do not need to memorize every shortcut. Open the Keyboard Shortcuts editor with Ctrl+K Ctrl+S (Windows/Linux) or Cmd+K Cmd+S (macOS).
From there:
- Search by command name. Type
commentto see all comment-related shortcuts. - Search by key. Type
ctrl+dto see what Ctrl+D does. - Sort by source. Click the source column to separate built-in from user and extension shortcuts.
- Find conflicts. Right-click any entry and select Show Same Keybindings.
How to change a shortcut
Find the command in the Keyboard Shortcuts editor. Click the pencil icon on the left, or double-click the row. Press your new key combination and press Enter.
Right-click any button, menu item, or UI element in VS Code and select Configure Keybinding to jump straight to that action in the editor.
Your custom shortcuts are saved in keybindings.json. To open the raw file, run Preferences: Open Keyboard Shortcuts (JSON) from the Command Palette. For a complete walkthrough of editing keybindings, see how to change keyboard shortcuts.
When a shortcut does not work
Check for an operating system conflict
macOS uses Ctrl+Space for Spotlight and Cmd+Space for Spotlight search, which can capture the key before VS Code sees it.
Check your GPU driver software
Some GPU driver software, especially NVIDIA, overrides Alt+arrow shortcuts. Check your graphics control panel.
Check for an extension conflict
An extension may have registered the same keybinding. Open the Keyboard Shortcuts editor and search for the key to see which command wins.
Run the troubleshooting command
Run Developer: Toggle Keyboard Shortcuts Troubleshooting from the Command Palette. Press your key and look at the Output panel to see how VS Code interpreted it.
Install a keymap from your old editor
If you are coming from another editor, you do not need to relearn every shortcut. Open the Command Palette and run Preferences: Keymaps. VS Code lists popular keymap extensions: Sublime Text, Atom, Vim, IntelliJ IDEA, Eclipse, and more. Install one and your muscle memory transfers immediately.
You can also browse the Keymaps category on the Marketplace.
Rune AI
Key Insights
- Keep hands on the keyboard: Command Palette (Ctrl+Shift+P / Cmd+Shift+P), Quick Open (Ctrl+P / Cmd+P), and the keyboard shortcut reference (Ctrl+K Ctrl+S / Cmd+K Cmd+S) are your three most important shortcuts.
- Editing: Ctrl+D / Cmd+D (select next occurrence), Alt+Up or Down (move line), Ctrl+/ / Cmd+/ (toggle comment).
- Navigation: Ctrl+Tab (switch files), Ctrl+G (go to line), F12 (go to definition).
- Terminal: Ctrl+
(toggle), Ctrl+Shift+(new terminal), Ctrl+Shift+5 (split). - Search: Ctrl+F / Cmd+F (find), Ctrl+Shift+F / Cmd+Shift+F (find across files).
- Remap any shortcut: Ctrl+K Ctrl+S / Cmd+K Cmd+S opens the editor where you can search by command or by key press.
Frequently Asked Questions
How do I change a keyboard shortcut?
How do I see all shortcuts I have changed?
How can I use shortcuts from my old editor?
Conclusion
You now have the 30+ keyboard shortcuts that matter most, organized by the task you are doing. Print the official PDF reference from Help > Keyboard Shortcut Reference, keep this page open as a quick lookup, and remap any shortcut that collides with your operating system or muscle memory. If you want to edit keybindings.json directly, read the guide on changing keyboard shortcuts.
More in this topic
How to Use VS Code with WSL 2 on Windows
Run VS Code connected to Windows Subsystem for Linux so you can develop in a full Linux environment with native tools, terminals, and debugging, all from Windows.
20 Best VS Code Extensions for Web Developers in 2026
Twenty carefully chosen VS Code extensions every web developer should know. Covers formatting, linting, frameworks, debugging, Git, and developer experience.
How to Install, Disable, Update, and Uninstall VS Code Extensions
Learn how to install, disable, update, and uninstall VS Code extensions from the Marketplace and the command line. Step-by-step instructions for every action.