Most “VS Code shortcuts” lists promise you’ll get an hour back every day. Nobody has measured that, and we won’t pretend to. What we can tell you is which keys replace the slowest mouse habits, what each one is on Windows, macOS and Linux, and where the three platforms quietly disagree. Every key below was checked against Microsoft’s own cheat sheets on code.visualstudio.com.
There are well over a hundred default bindings. You don’t need them. Thirty is plenty, and you can learn them in small batches over a couple of weeks.
Quick answer: The VS Code shortcuts worth learning first are the Command Palette (Ctrl+Shift+P, or Cmd+Shift+P on Mac), Go to File (Ctrl+P), add next match (Ctrl+D), move line (Alt+Up/Down), toggle comment (Ctrl+/) and the terminal (Ctrl+`). On a Mac, most Ctrl keys become Cmd. Ctrl+K Ctrl+S shows every binding you have.
- We checked 30 shortcuts against the official Windows, macOS and Linux PDFs. 24 of the 30 are the same on Windows and Linux.
- Of the 19 that start with Ctrl on Windows, 17 switch to Cmd on a Mac. Go to Line and the terminal stay on Control.
- Format Document is Shift+Alt+F on Windows but Ctrl+Shift+I on Linux. Copy-pasted cheat sheets get this wrong a lot.
- If a key does nothing, another app or extension probably grabbed it. VS Code has a built-in troubleshooter for that.
Why we didn’t keep “an hour a day”
The working title for this post promised an hour a day. We dropped it. There’s no official study behind that number, and the time you save depends on how much you edit versus how much you think, read and sit in meetings. Someone who spends six hours inside the editor gains more than someone who opens it twice a day.
The honest claim is smaller and still useful. A shortcut removes a reach for the mouse, a menu hunt, or a scroll through the file tree. Those are short interruptions, but they repeat hundreds of times. The keys below target the ones that repeat most: finding files, jumping around code, editing several lines at once, and moving between the editor and the terminal.
A note on sources. Every binding here comes from the three printable sheets Microsoft links from its VS Code keyboard shortcuts documentation, plus the Basic Editing guide for multi-cursor details. We downloaded the PDFs on November 16, 2026, pulled out the text, and ran a small Python script that confirmed each key on this page appears on the right sheet. If you’ve installed a keymap extension or changed bindings yourself, your keys may differ.

Shortcuts that find things
Start here. These replace the file tree and the scroll wheel, which is where most people lose time without noticing.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Command Palette | Ctrl+Shift+P | ⇧⌘P | Ctrl+Shift+P |
| Go to File | Ctrl+P | ⌘P | Ctrl+P |
| Go to Line | Ctrl+G | ⌃G | Ctrl+G |
| Go to Symbol in file | Ctrl+Shift+O | ⇧⌘O | Ctrl+Shift+O |
| Search across files | Ctrl+Shift+F | ⇧⌘F | Ctrl+Shift+F |
| Next error or warning | F8 | F8 | F8 |
The Command Palette is the one to learn on day one. It lists every command VS Code has, and it shows the shortcut next to each command, so it teaches you new keys while you use it. F1 opens it too.
Go to File is the second. Type a few letters of a file name, even out of order, and press Enter. In a project with 200 files it’s far quicker than clicking through folders. Go to Symbol does the same inside one file: it lists functions and classes, so you can jump straight to handleSubmit in a long component.
F8 is underrated. It jumps to the next error or warning in the file, and Shift+F8 goes back. After a refactor, pressing F8 a few times is a fast way to clean up red squiggles.
VS Code keyboard shortcuts for editing lines
These are the keys people notice first when they watch someone fast in VS Code. They work on whole lines, so you don’t have to select anything.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Move line up/down | Alt+↑/↓ | ⌥↑/↓ | Alt+↑/↓ |
| Copy line up/down | Shift+Alt+↑/↓ | ⇧⌥↑/↓ | Not on the Linux sheet |
| Delete line | Ctrl+Shift+K | ⇧⌘K | Ctrl+Shift+K |
| Toggle line comment | Ctrl+/ | ⌘/ | Ctrl+/ |
| Toggle block comment | Shift+Alt+A | ⇧⌥A | Ctrl+Shift+A |
| Select current line | Ctrl+L | ⌘L | Ctrl+L |
| Format document | Shift+Alt+F | ⇧⌥F | Ctrl+Shift+I |
Move line is the one we’d learn first. Put the cursor anywhere on a line and press Alt+Up to swap it with the line above. Select a block of lines and the whole block moves. No cut, no paste, no lost indentation.
Copy line works the same way but duplicates instead. The official Linux sheet doesn’t list it at all, so don’t assume the Windows key works there. Open the Keyboard Shortcuts editor and search “copy line down” to see what your machine actually uses.
Toggle line comment is the VS Code shortcut for commenting out code, and it’s smart about the language: // in JavaScript, # in Python, <!-- --> in HTML. Press it again to uncomment. Format Document runs whatever formatter you have set for that language, such as Prettier or Black, if one is installed.
Multi-cursor: the biggest single win
If you only adopt one new habit from this page, make it this. Multiple cursors let you make the same edit in many places at once, and VS Code’s editing docs describe several ways to create them.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Add next match to selection | Ctrl+D | ⌘D | Ctrl+D |
| Select all occurrences | Ctrl+Shift+L | ⇧⌘L | Ctrl+Shift+L |
| Insert cursor above/below | Ctrl+Alt+↑/↓ | ⌥⌘↑/↓ | Shift+Alt+↑/↓ |
| Cursor at end of each selected line | Shift+Alt+I | ⇧⌥I | Shift+Alt+I |
| Undo last cursor operation | Ctrl+U | ⌘U | Ctrl+U |
| Expand selection | Shift+Alt+→ | ⌃⇧⌘→ | Shift+Alt+→ |
Ctrl+D is the daily driver. Put the cursor on a word and press it once to select the word. Press it again and VS Code adds the next match with a second cursor. Keep pressing until you’ve got the ones you want, then type. If you grab one too many, Ctrl+U steps back, and Ctrl+K Ctrl+D skips a match without selecting it.
Ctrl+Shift+L grabs every match in the file at once. It’s quick, but it’s also how people rename id inside userId by accident. For renaming a variable or function, use F2 (Rename Symbol) instead, because it understands code rather than text.
Shift+Alt+I is the hidden gem. Select ten lines, press it, and you get a cursor at the end of every line. Adding a comma or a semicolon to a list of values takes one keystroke after that. You can also hold Alt and click to drop cursors by hand, or hold Shift+Alt while dragging the mouse for a box selection.

Code navigation and refactoring
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Go to Definition | F12 | F12 | F12 |
| Peek Definition | Alt+F12 | ⌥F12 | Ctrl+Shift+F10 |
| Go back | Alt+← | ⌃- | Ctrl+Alt+- |
| Rename Symbol | F2 | F2 | F2 |
| Quick Fix | Ctrl+. | ⌘. | Ctrl+. |
F12 jumps to where a function or class is defined. Go back takes you to where you were. Together they let you follow a call chain three files deep and return without losing your place. Peek Definition opens the definition in a small inline window instead, which is better when you just want to check a parameter name.
Ctrl+. opens Quick Fix wherever you see a lightbulb: add a missing import, fix a typo the language server spotted, extract code into a function. In TypeScript projects it does a lot of work for free. If you’re learning TypeScript, our TypeScript tips for beginners shows the kind of errors these quick fixes help with.
Layout, terminal and tabs
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Toggle integrated terminal | Ctrl+` | ⌃` | Ctrl+` |
| Toggle sidebar | Ctrl+B | ⌘B | Ctrl+B |
| Split editor | Ctrl+\ | ⌘\ | Ctrl+\ |
| Reopen closed editor | Ctrl+Shift+T | ⇧⌘T | Ctrl+Shift+T |
| Zen Mode | Ctrl+K Z | ⌘K Z | Ctrl+K Z |
| Keyboard Shortcuts editor | Ctrl+K Ctrl+S | ⌘K ⌘S | Ctrl+K Ctrl+S |
Ctrl+` (the backtick key, left of 1 on a US keyboard) shows and hides the terminal. That’s the shortcut to run code in VS Code if you work from the command line: toggle the terminal, run python app.py or npm test, toggle it away. For debugging, F5 starts or continues and F9 sets a breakpoint, on all three platforms.
Reopen closed editor saves you every time you close the wrong tab. Zen Mode hides everything except your code; press Esc twice to leave. Ctrl+B is handy on a laptop screen, where the sidebar eats a third of the width.
Shortcut keys with a space in them, like Ctrl+K Z, are chords. Press Ctrl+K, let go, then press Z. Between the two presses, VS Code shows “Waiting for second key of chord…” in the status bar.
What most shortcut lists skip: the key depends on your platform and your keyboard layout, not just the action. Copy a Windows cheat sheet onto Linux and 6 of our 30 keys are wrong or missing. VS Code also shows bindings for your current layout, so on a French keyboard the docs note that Split Editor appears as Ctrl+*. The only list that’s always right for your machine is the Keyboard Shortcuts editor itself.
How to change shortcuts in VS Code
Press Ctrl+K Ctrl+S (⌘K ⌘S on Mac). According to the keybindings docs, this editor lists every command, with and without a shortcut, and lets you change, remove or reset each one. You can search by command name or by the key itself. Right-click any entry and choose Show Same Keybindings to see what else uses that key.
Your changes are saved to a file called keybindings.json. You can open it from the Keyboard Shortcuts editor with the “Open Keyboard Shortcuts (JSON)” button. Each rule is one small object:
[
{ "key": "ctrl+shift+d", "command": "editor.action.copyLinesDownAction", "when": "editorTextFocus" }
]
The when part limits where the key works. Leave it out and the docs say the shortcut is available everywhere, all the time, which can break other things. Coming from another editor? File, then Preferences, then Migrate Keyboard Shortcuts from… lists keymap extensions that copy the bindings you already know.
VS Code shortcuts not working?
The usual causes are another program grabbing the key first (screen recorders, chat apps, graphics drivers and Linux desktops often take Ctrl+Alt or Shift+Alt combos), an extension that rebinds it, or a different keyboard layout. Run Developer: Toggle Keyboard Shortcuts Troubleshooting from the Command Palette. It logs every key VS Code receives in the Output panel. If your press never shows up, something outside VS Code ate it.
A two-week plan to learn them
Reading 30 shortcuts won’t make them stick. Using five at a time will. Here’s the order we’d suggest:
- Days 1 to 3: Command Palette, Go to File, toggle terminal, toggle comment.
- Days 4 to 6: move line, copy line, delete line, select line.
- Days 7 to 10: Ctrl+D, Ctrl+Shift+L, Shift+Alt+I, Alt+Click.
- Days 11 to 14: F12, Go back, F2, Ctrl+., F8.
When you catch yourself reaching for the mouse, stop and use the key instead, even if it’s slower the first few times. For a printable copy, Help, then Keyboard Shortcut Reference, opens Microsoft’s PDF for your platform. Stick it next to the monitor for a week.
Shortcuts pair well with other small habits. Our Git commands every developer should know covers the terminal side, and the Python tricks for beginners guide is a good place to practise multi-cursor editing on real code.
Verdict
Learn the Command Palette, Go to File, Ctrl+D and move line this week. Those four change how editing feels more than the other 26 combined. Skip memorising long chord lists you’ll use once a month; the Command Palette finds those for you. And if you’re on Linux or a Mac, don’t trust a cheat sheet written for Windows. Check your own Keyboard Shortcuts editor.
Next: once the editor feels fast, let an assistant handle the boring parts. Our GitHub Copilot tutorial walks through setup inside VS Code, step by step.
FAQ
How do I see all shortcuts in VS Code?
Press Ctrl+K Ctrl+S on Windows and Linux, or ⌘K ⌘S on macOS. The Keyboard Shortcuts editor lists every command and its current key, including ones you or your extensions changed. Help, then Keyboard Shortcut Reference, opens the official printable PDF.
What does Ctrl+Shift+P do in VS Code?
It opens the Command Palette, a searchable list of every VS Code command. On a Mac it’s Cmd+Shift+P. F1 opens it on all platforms.
What is the shortcut to comment in VS Code?
Ctrl+/ toggles a line comment on Windows and Linux, and Cmd+/ does it on macOS. Block comments are Shift+Alt+A on Windows, ⇧⌥A on Mac and Ctrl+Shift+A on Linux, according to the official sheets.
How do I edit VS Code shortcuts?
Open the Keyboard Shortcuts editor, find the command, and change or remove its key. Or open keybindings.json and add a rule with key, command and an optional when clause. Use Show Same Keybindings to avoid clashes.