Overview

VS Code shortcuts reduce context-switching by keeping hands on the keyboard during editing, navigation, and debugging. The patterns below cover the 80% of shortcuts worth memorizing. Mac uses Cmd; Windows and Linux use Ctrl in the same position. The key binding system is fully remappable via keybindings.json (Cmd/Ctrl+Shift+P > “Open Keyboard Shortcuts (JSON)”). For terminal-first workflows, see bash-one-liners and vim-commands.

File and window operations

ActionMacWindows / Linux
Open file by nameCmd+PCtrl+P
Open command paletteCmd+Shift+PCtrl+Shift+P
New fileCmd+NCtrl+N
SaveCmd+SCtrl+S
Save allCmd+Option+SCtrl+K S
Close tabCmd+WCtrl+W
Reopen closed tabCmd+Shift+TCtrl+Shift+T
Split editorCmd+\Ctrl+\
Switch editor groupCmd+1/2/3Ctrl+1/2/3
Toggle sidebarCmd+BCtrl+B
Toggle terminalCtrl+`Ctrl+`
Open settings (UI)Cmd+,Ctrl+,
Open settings (JSON)Cmd+Shift+P > “settings json”same
ActionMacWindows / Linux
Go to symbol in fileCmd+Shift+OCtrl+Shift+O
Go to symbol in workspaceCmd+TCtrl+T
Go to definitionF12F12
Peek definitionOption+F12Alt+F12
Go to referencesShift+F12Shift+F12
Go to lineCtrl+GCtrl+G
Go back / forwardCtrl+- / Ctrl+Shift+-Alt+Left / Alt+Right
Breadcrumb focusCmd+Shift+.Ctrl+Shift+.
Quick open recentCtrl+RCtrl+R
Move between tabsCmd+Option+Left/RightCtrl+PageUp/Down
# Quick symbol jump workflow:
Cmd+T → type "UserService" → Enter → instant jump across all files

Search and replace

ActionMacWindows / Linux
Find in fileCmd+FCtrl+F
Find and replace in fileCmd+HCtrl+H
Find in workspaceCmd+Shift+FCtrl+Shift+F
Replace in workspaceCmd+Shift+HCtrl+Shift+H
Select all occurrencesCmd+Shift+LCtrl+Shift+L
Add next occurrence to selectionCmd+DCtrl+D
Skip current occurrenceCmd+K Cmd+DCtrl+K Ctrl+D
Toggle regex in searchCmd+Option+R (in search box)Alt+R

Multi-cursor and selection

ActionMacWindows / Linux
Add cursor above / belowCmd+Option+Up/DownCtrl+Alt+Up/Down
Add cursor at clickOption+ClickAlt+Click
Select to line endShift+EndShift+End
Expand selection to wordCmd+Shift+RightCtrl+Shift+Right
Select current lineCmd+LCtrl+L
Move line up / downOption+Up/DownAlt+Up/Down
Copy line up / downShift+Option+Up/DownShift+Alt+Up/Down
Delete lineCmd+Shift+KCtrl+Shift+K
Insert line belowCmd+EnterCtrl+Enter
Insert line aboveCmd+Shift+EnterCtrl+Shift+Enter
Join line belowCtrl+J (not default; add in keybindings)

Refactoring

ActionMacWindows / Linux
Rename symbolF2F2
Extract to function/variableCmd+. then chooseCtrl+. then choose
Quick fix / code actionCmd+.Ctrl+.
Format documentShift+Option+FShift+Alt+F
Format selectionCmd+K Cmd+FCtrl+K Ctrl+F
Organize importsShift+Option+OShift+Alt+O
Fold / unfold regionCmd+Option+[/]Ctrl+Shift+[/]
Fold all / unfold allCmd+K Cmd+0 / Cmd+K Cmd+JCtrl+K 0 / Ctrl+K J

Terminal

ActionMacWindows / Linux
New terminalCtrl+Shift+`Ctrl+Shift+`
Toggle terminal panelCtrl+`Ctrl+`
Kill terminalCmd+K (in terminal)same (if configured)
Clear terminalCmd+KCtrl+K (shell shortcut)
Next / previous terminalCtrl+PageDown/UpCtrl+PageDown/Up
Focus terminal from editorCtrl+`Ctrl+`
Focus editor from terminalCmd+1Ctrl+1
Run selected text in terminal(assign via keybindings)

Debugging

ActionMacWindows / Linux
Start / continueF5F5
StopShift+F5Shift+F5
RestartCmd+Shift+F5Ctrl+Shift+F5
Step overF10F10
Step intoF11F11
Step outShift+F11Shift+F11
Toggle breakpointF9F9
Toggle inline breakpointShift+F9Shift+F9
Open debug consoleCmd+Shift+YCtrl+Shift+Y

Common gotchas

  • Cmd+D selects the next occurrence of the current word, not all occurrences. Use Cmd+Shift+L to select all at once.
  • Multi-cursor column editing requires placing cursors first with Cmd+Option+Down, then typing. It does not select a rectangular block automatically; use the box-select extension for that.
  • F12 (go to definition) jumps to the compiled type declaration for npm packages unless you have source maps and the package includes declarationMap. Set "declarationMap": true in tsconfig.json to jump to the source.
  • Shift+Option+F (format document) uses the default formatter. If multiple formatters are installed, VS Code prompts you to choose; set a default in settings.json with "editor.defaultFormatter".
  • Opening the command palette with Cmd+P then typing > switches to command mode. This is the same as Cmd+Shift+P; the > prefix selects commands vs files.