VSCode Cheatsheet - VS Code Shortcut Reference

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

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

Typical Use Case

Start most sessions with Cmd/Ctrl+Shift+P and type the command name instead of hunting menus; rename a variable or function with F2 rather than manual find-replace so the language server keeps symbols consistent; to see every place a symbol is used, press Shift+F12 and judge the blast radius; to edit many identical occurrences at once, select them with Cmd/Ctrl+D one by one or Cmd/Ctrl+Shift+L all at once; add multiple cursors with Option/Alt+Click for editing several spots simultaneously. After reading you handle most navigation, refactoring and batch edits from the keyboard.

Command Examples

Rename every reference to a symbol

F2

光标放在标识符上按 F2,输入新名回车,所有引用(含跨文件)一次更新,优于手写全局替换。

Select all matching text then edit them together

Cmd+Shift+L / Ctrl+Shift+L

先选中一个词,再按此键选中全文所有相同词,随后输入即同时替换,处理重复出现的变量/硬编码值最顺手。

Jump across all references of a symbol

Shift+F12

列出当前符号的所有引用并逐个跳转/预览,重构前先扫一遍,确认改动波及范围。

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