VS Code Cheatsheet - 50+ Keyboard Shortcuts
VSCode turns refactoring, symbol navigation and multi-cursor editing into pure keyboard work, keeping your attention on the logic instead of the mouse. Ordered by workflow — General, Editing, Navigation, Refactor/Debug, Git — each shortcut lists both macOS and Win/Linux keybindings and calls out the platform deltas (Cmd→Ctrl, Option→Alt). For rename, jump-to-definition and batch editing without the mouse, start with the Command Palette and Editing groups; in cross-platform teams it also helps you align on keybinding docs. After reading you can drive most of a refactoring session from the keyboard.
Typical Use Case
For people who live in VS Code: move the most frequent actions off the mouse. What actually separates fast users from slow ones is not memorising shortcuts but three groups — the Command Palette, global rename, and multi-cursor. The palette means you need to remember nothing, F2 renames a symbol and updates every reference, and Option+Enter turns batch editing into one operation. Organised in five groups: editing, navigation, refactor/debug, Git and search. On Windows and Linux, swap Cmd for Ctrl.
General 7
Cmd+Shift+PCtrl+Shift+PCmd+PCmd+,Cmd+Shift+XCmd+BCmd+`Editing 9
Option+↑/↓Shift+Option+↑/↓Cmd+LCmd+DCmd+Shift+LOption+ClickCmd+/Cmd+Option+[Cmd+Option+]Refactor & Debug 8
F2Cmd+Shift+RF5F9F10F11Cmd+Shift+FCmd+Shift+HGit Integration 5
Cmd+Shift+GCmd+EnterCtrl+Shift+G BCmd+Shift+P > Git: PullCmd+Shift+P > Git: PushViews & Panels 4
Cmd+Shift+ECmd+Shift+DCmd+JCmd+K ZConfig Files 4
settings.jsonlaunch.jsontasks.jsonkeybindings.jsonSearch 4
Cmd+F / Ctrl+FOption+Cmd+F / Ctrl+HCmd+Shift+H / Ctrl+Shift+HOption+Enter / Alt+EnterWindows & Terminal 8
Cmd+\ / Ctrl+\Cmd+1 / Ctrl+1Cmd+2 / Ctrl+2Ctrl+` / Ctrl+`Ctrl+Shift+` / Ctrl+Shift+`Cmd+K / Ctrl+KCmd+K W / Ctrl+K WCmd+K F / Ctrl+K FParameter matrix
| Parameter | Effect | Example |
|---|---|---|
Cmd+Shift+P | Open the Command Palette and reach any editor command by typing a few keywords. | Cmd+Shift+P then "Git: Pull" |
Cmd+P | Quick Open: jump to a file by fuzzy-matching its path as you type. | Cmd+P then src/utils |
Cmd+D | Add the next identical occurrence to the selection; repeated presses build multiple cursors. | Press Cmd+D repeatedly to select every identical snippet |
Option+Enter | Select every match found by the current search so you can replace them all at once. | Search with Cmd+F, then press Option+Enter to select all matches |
F2 | Rename the symbol under the cursor and update every reference the language service can see. | Put the cursor on a symbol and press F2 |
Shift+F12 | Peek all references for the current symbol, the fastest way to size up a refactor. | Shift+F12 then References |
F12 / Cmd+Click | Go to Definition for the symbol under the cursor. | F12 |
Cmd+T | Go to Symbol: navigate by function, class or constant name across the whole workspace. | Cmd+T then useUser |
Cmd+/ | Toggle a line comment using the comment syntax of the current language. | Cmd+/ |
Cmd+B | Show or hide the primary side bar. | Cmd+B |
Cmd+Shift+G | Open the Source Control view. | Cmd+Shift+G |
Cmd+K Z | Enter Zen Mode for a distraction-free, centred full-screen editor. | Cmd+K Z |
Common pitfalls
SymptomA shortcut does nothing at all, and every keybinding breaks after switching keyboard layout.
CauseAn IME or a keyboard remapping layer is swallowing the combination before VS Code sees it.
FixSearch keybindings.json for a conflicting binding, and remember that on macOS system shortcuts take priority over VS Code.
SymptomAfter several Cmd+D presses you accidentally edited text that should have been left alone.
CauseYou pressed it more times than intended and the cursor set expanded across the whole file.
FixPress Esc to drop the multi-cursor, and prefer Cmd+Shift+L to select all matches exactly before a bulk edit.
SymptomF2 rename left some references untouched and the code throws a not-defined error at runtime.
CauseThose references are built dynamically or live in a file of another language, so static analysis never saw them.
FixRun Shift+F12 before renaming and review the full reference list, then hand-check any suspicious location.
SymptomCmd+K does not clear the integrated terminal, it deletes the current line instead.
CauseFocus is inside the terminal, which owns the meaning of the key sequence in that context.
FixAlways check where focus sits; Cmd+K only clears the screen while the terminal itself is focused.
SymptomAfter an edit the Git view reports a huge number of changed lines when you only touched a few.
CauseLine endings were rewritten wholesale, for example CRLF being converted to LF or back.
FixSet "files.eol": "\n" in settings.json and normalise the same way with files.trimTrailingWhitespace.
SymptomThe folder that opened is not what you expected, or the workspace looks empty after Open Folder.
CauseA single File was opened instead of a Folder, so no workspace context exists and search plus Git stay disabled.
FixUse File then Open Folder on the project root and confirm the status bar shows the workspace name.
Troubleshooting
1You do not know which command maps to a feature
Cmd+Shift+PSearch by the feature name such as "format document"; you never have to memorise keybindings.
2Check the blast radius before refactoring
Shift+F12Read the whole reference list first, then commit to the F2 rename.
3Edit every match in one pass
Cmd+Shift+LMore predictable than pressing Cmd+D repeatedly, or search with Cmd+F and press Option+Enter to select all matches.
4Rebind a keybinding yourself
Cmd+Shift+P then "Preferences: Open Keyboard Shortcuts (JSON)"Add a {"key": "...", "command": "..."} entry in keybindings.json to override the default binding.
5Go to a line number and come back
Cmd+GType the line number to jump; Ctrl+- returns to the previous cursor position.
Command Examples
Rename every reference to a symbol
F2Put the cursor on the identifier and press F2, type the new name, and every reference including cross-file ones is updated in a single pass. Nothing else comes close when a symbol has to move.
Select all matching text then edit them together
Cmd+Shift+L / Ctrl+Shift+LSelect one instance of a word, press the shortcut to select every occurrence in the file, then type: the replacement lands everywhere at once. It is the fastest route through a repeated variable name or a hard-coded value.
Jump across all references of a symbol
Shift+F12The list shows every reference to the current symbol and lets you step or preview each one. Run it before a refactor to see the blast radius rather than discovering it from a failing test.
Common Pitfalls
- macOS and Win/Linux differ systematically: Cmd↔Ctrl, Option↔Alt — confirm which system you are on before using this table.
- F2 rename depends on the language-server index; on huge projects or right after installing extensions wait for indexing to finish first.
- Cmd/Ctrl+Shift+L selects all matching text — if the selection is a common substring like i or result you may over-select; verify the set before typing.
- F5 and others still honor your custom keybindings; this table lists defaults, so check keybindings.json if something differs.
- Semantics stay the same in remote SSH/container windows but plugins may intercept keys; if a shortcut does not fire, check extension conflicts first.
Tips
- Press Cmd+D repeatedly to select all matching text; batch editing is more intuitive than regex.
- Option+Click multi-cursor mode suits typing in many places at once, e.g. adding a prefix to multiple lines.
- Custom shortcuts: Cmd+K Cmd+S opens the keyboard shortcuts visual editor.
FAQ
How do I find a shortcut I forgot in VSCode?
Press Ctrl+Shift+P (Cmd+Shift+P on macOS) to open the Command Palette and run any command by name — the most reliable entry — and it shows the default keybinding beside each entry. To rebind keys, open Keyboard Shortcuts with Ctrl+K Ctrl+S.
How do I edit multiple places at once with multi-cursor in VSCode?
On Windows/Linux hold Alt and click to add cursors; on macOS use Option. After selecting text, press Ctrl+D (Cmd+D) to add each next match, Ctrl+Shift+L (Cmd+Shift+L) to add all matches, and Alt+Up/Down to move a line up or down.
Where does VSCode store configuration and how do I sync it across machines?
User settings live in settings.json (open with Ctrl+,, then toggle to the file), keybindings in keybindings.json, and snippets in a snippets folder. Sign in with Settings Sync to sync them across devices; alternatively commit settings.json into your own dotfiles repo.
How do I rename every reference of a symbol in VSCode?
Place the cursor on the symbol and press F2 to rename all in-scope references, smartly skipping same-named literal text inside strings and comments. Because it uses the language service it works across files and languages and is far safer than a blind find-and-replace.
How do macOS keybindings differ from Windows in VSCode?
The main difference is macOS Cmd maps to Windows/Linux Ctrl and Option maps to Alt — e.g. copy/paste is Cmd+C vs Ctrl+C, and cursor-to-line-start is Cmd+Left vs Home. Most other bindings align. Use the Keyboard Shortcuts UI to give a specific command both platform bindings if one feels off.
Official References
Each command links to its official documentation below, so you can verify the latest usage and read deeper.
Maintained by LaoHand
Publicly updated on Jul 21, 2026, continuously proofread against official docs.
Contact Us
Wrong command or description? Send us corrections, business inquiries or product feedback by email.
Contact Us