Quick answer. The most-used VS Code shortcuts are the Command Palette (Ctrl+Shift+P / ⇧⌘P), Quick Open (Ctrl+P / ⌘P), find across files (Ctrl+Shift+F / ⇧⌘F), duplicate a line (Shift+Alt+↓ / ⇧⌥↓), and add-next-cursor (Ctrl+D / ⌘D). The big difference: on macOS the primary modifier is Command (⌘), where Windows and Linux use Control.
Keyboard shortcuts are the fastest way to speed up your workflow in Visual Studio Code. Instead of reaching for the mouse to search files, move lines, or open the terminal, a two-key combination does it instantly. This guide lists the most useful Visual Studio Code shortcuts for both Mac and Windows, grouped by task, with every combination checked against the current VS Code defaults.
If you already lean on VS Code extensions to boost productivity, pairing them with the right keyboard shortcuts is the next step. All shortcuts below are the out-of-the-box defaults — you can remap any of them (see the customization section at the end).
What is VS Code?
Visual Studio Code is a free, open-source source-code editor built by Microsoft for Windows, macOS, and Linux. It handles debugging, syntax highlighting, intelligent code completion (IntelliSense), and refactoring, and is released under the permissive MIT license. Its large extension marketplace and fast, keyboard-first design are why it stays one of the most widely used editors for front-end and full-stack developers.

How do VS Code shortcuts differ on Mac and Windows?
Most VS Code shortcuts map one-to-one between platforms, but the modifier keys differ. Get these swaps right and almost every Windows shortcut has an obvious Mac equivalent:
- Windows/Linux
Ctrl→ macOS⌘(Command) for the majority of commands (save, find, Command Palette, etc.). - Windows/Linux
Alt→ macOS⌥(Option) for line moves, word selection, and multi-cursor commands. ⇧is Shift and⌃is the literal Control key on Mac (a few commands, like Go to Line and Toggle Terminal, still use ⌃ on macOS).
Throughout the tables below, the Windows/Linux combination is on the left and the macOS combination (using ⌘ ⌥ ⇧ ⌃ symbols) is on the right.
What are the most useful VS Code shortcuts?
If you only memorize a handful, make it these. They cover the actions developers repeat dozens of times an hour.
| Action | Windows / Linux | macOS |
|---|---|---|
| Open the Command Palette | Ctrl+Shift+P | ⇧⌘P |
| Quick Open / Go to File | Ctrl+P | ⌘P |
| Find across all files | Ctrl+Shift+F | ⇧⌘F |
| Find in current file | Ctrl+F | ⌘F |
| Duplicate a line (down) | Shift+Alt+↓ | ⇧⌥↓ |
| Move a line up / down | Alt+↑ / Alt+↓ | ⌥↑ / ⌥↓ |
| Add cursor at next match | Ctrl+D | ⌘D |
| Toggle line comment | Ctrl+/ | ⌘/ |
| Reopen last closed editor | Ctrl+Shift+T | ⇧⌘T |
| Toggle integrated terminal | Ctrl+` | ⌃` |
General VS Code shortcuts
| Action | Windows / Linux | macOS |
|---|---|---|
| Command Palette | Ctrl+Shift+P (or F1) | ⇧⌘P (or F1) |
| Quick Open / Go to File | Ctrl+P | ⌘P |
| New window | Ctrl+Shift+N | ⇧⌘N |
| Open Settings | Ctrl+, | ⌘, |
| Keyboard Shortcuts editor | Ctrl+K Ctrl+S | ⌘K ⌘S |
VS Code editing shortcuts
| Action | Windows / Linux | macOS |
|---|---|---|
| Cut line (no selection) | Ctrl+X | ⌘X |
| Copy line (no selection) | Ctrl+C | ⌘C |
| Delete line | Ctrl+Shift+K | ⇧⌘K |
| Move line up / down | Alt+↑ / Alt+↓ | ⌥↑ / ⌥↓ |
| Duplicate line up / down | Shift+Alt+↑ / Shift+Alt+↓ | ⇧⌥↑ / ⇧⌥↓ |
| Insert line below / above | Ctrl+Enter / Ctrl+Shift+Enter | ⌘⏎ / ⇧⌘⏎ |
| Indent / outdent | Ctrl+] / Ctrl+[ | ⌘] / ⌘[ |
| Delete previous word | Ctrl+Backspace | ⌥⌫ |
| Toggle line comment | Ctrl+/ | ⌘/ |
| Toggle block comment | Shift+Alt+A | ⇧⌥A |
| Format document | Shift+Alt+F | ⇧⌥F |
Multi-cursor and selection shortcuts
| Action | Windows / Linux | macOS |
|---|---|---|
| Insert cursor (click) | Alt+Click | ⌥Click |
| Insert cursor above / below | Ctrl+Alt+↑ / Ctrl+Alt+↓ | ⌥⌘↑ / ⌥⌘↓ |
| Select current line | Ctrl+L | ⌘L |
| Add next occurrence to selection | Ctrl+D | ⌘D |
| Select all occurrences of selection | Ctrl+Shift+L | ⇧⌘L |
| Change all occurrences of a word | Ctrl+F2 | ⌘F2 |
| Extend selection word by word | Ctrl+Shift+→ / Ctrl+Shift+← | ⌥⇧→ / ⌥⇧← |
| Select from cursor to line start / end | Shift+Home / Shift+End | ⇧⌘← / ⇧⌘→ |
Navigation shortcuts
| Action | Windows / Linux | macOS |
|---|---|---|
| Go to Symbol in file | Ctrl+Shift+O | ⇧⌘O |
| Go to Symbol in workspace | Ctrl+T | ⌘T |
| Go to line | Ctrl+G | ⌃G |
| Go to Definition | F12 | F12 |
| Go back / forward | Alt+← / Alt+→ | ⌃- / ⌃⇧- |
| Jump to start / end of file | Ctrl+Home / Ctrl+End | ⌘↑ / ⌘↓ |
| Jump to start / end of line | Home / End | ⌘← / ⌘→ |
| Show Problems panel | Ctrl+Shift+M | ⇧⌘M |
Search and replace shortcuts
| Action | Windows / Linux | macOS |
|---|---|---|
| Find in current file | Ctrl+F | ⌘F |
| Replace in current file | Ctrl+H | ⌥⌘F |
| Find across all files | Ctrl+Shift+F | ⇧⌘F |
| Replace across all files | Ctrl+Shift+H | ⇧⌘H |
| Change all occurrences of a word | Ctrl+F2 | ⌘F2 |
| Rename symbol | F2 | F2 |
Editor and window management shortcuts
| Action | Windows / Linux | macOS |
|---|---|---|
| Reopen last closed editor | Ctrl+Shift+T | ⇧⌘T |
| Close editor | Ctrl+W | ⌘W |
| Split editor | Ctrl+\ | ⌘\ |
| Focus editor group 1 / 2 / 3 | Ctrl+1 / Ctrl+2 / Ctrl+3 | ⌘1 / ⌘2 / ⌘3 |
| Cycle through open editors | Ctrl+Tab | ⌃Tab |
Display and panel shortcuts
| Action | Windows / Linux | macOS |
|---|---|---|
| Toggle integrated terminal | Ctrl+` | ⌃` |
| Toggle sidebar | Ctrl+B | ⌘B |
| Toggle Zen mode | Ctrl+K Z | ⌘K Z |
| Zoom in / out | Ctrl+= / Ctrl+- | ⌘= / ⌘- |
Debugging shortcuts
| Action | Windows / Linux | macOS |
|---|---|---|
| Toggle breakpoint | F9 | F9 |
| Start / continue | F5 | F5 |
| Step over | F10 | F10 |
| Step into | F11 | F11 |
| Stop debugging | Shift+F5 | ⇧F5 |
How do I customize VS Code keyboard shortcuts?
Every shortcut above is a default that you can change. Open the Keyboard Shortcuts editor with Ctrl+K Ctrl+S (Windows) or ⌘K ⌘S (Mac), search for a command, and double-click it to record a new key combination. For bulk edits, run the Command Palette and choose Preferences: Open Keyboard Shortcuts (JSON) to edit keybindings.json directly. VS Code also ships printable cheat-sheet PDFs for Windows and macOS.
FAQ
What is the most important VS Code shortcut to learn first?
The Command Palette (Ctrl+Shift+P on Windows, ⇧⌘P on Mac). It exposes every command VS Code can run, so even if you forget a specific shortcut you can search for the action by name and run it from there.
How do I duplicate a line in VS Code?
Use Shift+Alt+↓ on Windows/Linux or ⇧⌥↓ on macOS to copy the current line below (use ↑ to copy above). You don't need to select anything first — just place the cursor on the line.
Why do the Mac shortcuts use ⌘ instead of Ctrl?
On macOS the Command (⌘) key is the standard primary modifier, so most VS Code commands that use Ctrl on Windows use ⌘ on Mac. A few commands, such as Go to Line and Toggle Terminal, keep the literal Control (⌃) key on Mac.
Can I change VS Code keyboard shortcuts?
Yes. Open the Keyboard Shortcuts editor (Ctrl+K Ctrl+S / ⌘K ⌘S), find the command, and assign your own combination. Advanced users can edit keybindings.json for bulk changes or to import a full keymap.
Do these shortcuts also work in Cursor and other VS Code forks?
Mostly yes. Editors built on the VS Code core — including Cursor and VSCodium — inherit the same default keybindings, so the editing, navigation, and search shortcuts here carry over. AI-specific actions add their own extra shortcuts on top.
Master a few of these each week and they quickly become muscle memory. If your team is scaling and you need experienced developers who already work fast in modern tooling, Codersera can help you hire vetted remote developers to extend your engineering team.