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.

Dev Tools·56 commands·Last updated 2026-07-21

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+P
Open Command Palette (macOS)
Ctrl+Shift+P
Open Command Palette (Win/Linux)
Cmd+P
Quick open file
Cmd+,
Open Settings
Cmd+Shift+X
Open Extensions panel
Cmd+B
Toggle sidebar
Cmd+`
Toggle integrated terminal

Editing 9

Option+↑/↓
Move current line up/down
Shift+Option+↑/↓
Copy current line up/down
Cmd+L
Select current line
Cmd+D
Select next occurrence
Cmd+Shift+L
Select all occurrences
Option+Click
Add multi-cursor
Cmd+/
Toggle line comment
Cmd+Option+[
Fold code block
Cmd+Option+]
Unfold code block

Refactor & Debug 8

F2
Rename symbol
Cmd+Shift+R
Refactor menu
F5
Start debugging
F9
Toggle breakpoint
F10
Step over
F11
Step into
Cmd+Shift+F
Global search
Cmd+Shift+H
Global replace

Git Integration 5

Cmd+Shift+G
Open Source Control panel
Cmd+Enter
Commit changes from the message box
Ctrl+Shift+G B
View changed files list
Cmd+Shift+P > Git: Pull
Pull remote changes
Cmd+Shift+P > Git: Push
Push local commits

Views & Panels 4

Cmd+Shift+E
Focus the Explorer
Cmd+Shift+D
Open the Debug view
Cmd+J
Toggle bottom panel
Cmd+K Z
Zen mode (fullscreen, distraction-free)

Config Files 4

settings.json
User & workspace settings
launch.json
Debug launch configuration
tasks.json
Build & task configuration
keybindings.json
Custom keybinding bindings

Windows & Terminal 8

Cmd+\ / Ctrl+\
Split editor (side by side)
Cmd+1 / Ctrl+1
Focus 1st editor group
Cmd+2 / Ctrl+2
Focus 2nd editor group
Ctrl+` / Ctrl+`
Toggle integrated terminal
Ctrl+Shift+` / Ctrl+Shift+`
Create new terminal instance
Cmd+K / Ctrl+K
Clear terminal (when focused)
Cmd+K W / Ctrl+K W
Close all editors
Cmd+K F / Ctrl+K F
Close current folder

Parameter matrix

ParameterEffectExample
Cmd+Shift+POpen the Command Palette and reach any editor command by typing a few keywords.Cmd+Shift+P then "Git: Pull"
Cmd+PQuick Open: jump to a file by fuzzy-matching its path as you type.Cmd+P then src/utils
Cmd+DAdd the next identical occurrence to the selection; repeated presses build multiple cursors.Press Cmd+D repeatedly to select every identical snippet
Option+EnterSelect 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
F2Rename the symbol under the cursor and update every reference the language service can see.Put the cursor on a symbol and press F2
Shift+F12Peek all references for the current symbol, the fastest way to size up a refactor.Shift+F12 then References
F12 / Cmd+ClickGo to Definition for the symbol under the cursor.F12
Cmd+TGo 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+BShow or hide the primary side bar.Cmd+B
Cmd+Shift+GOpen the Source Control view.Cmd+Shift+G
Cmd+K ZEnter 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

  1. 1You do not know which command maps to a feature

    Cmd+Shift+P

    Search by the feature name such as "format document"; you never have to memorise keybindings.

  2. 2Check the blast radius before refactoring

    Shift+F12

    Read the whole reference list first, then commit to the F2 rename.

  3. 3Edit every match in one pass

    Cmd+Shift+L

    More predictable than pressing Cmd+D repeatedly, or search with Cmd+F and press Option+Enter to select all matches.

  4. 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.

  5. 5Go to a line number and come back

    Cmd+G

    Type the line number to jump; Ctrl+- returns to the previous cursor position.

Command Examples

Rename every reference to a symbol

F2

Put 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+L

Select 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+F12

The 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