Cheat sheetDev

VS Code shortcuts

The VS Code keyboard shortcuts that actually change how fast you work — editing, navigation and multi-cursor — for Windows and macOS side by side.

Last updated

The big three

ActionWindows / LinuxmacOS
Command palette (every command lives here)Ctrl+Shift+PCmd+Shift+P
Go to file by nameCtrl+PCmd+P
Toggle integrated terminalCtrl+`Cmd+`

Editing

ActionWindows / LinuxmacOS
Move line up / downAlt+↑ / Alt+↓Opt+↑ / Opt+↓
Copy line up / downShift+Alt+↑ / ↓Shift+Opt+↑ / ↓
Delete whole lineCtrl+Shift+KCmd+Shift+K
Toggle line commentCtrl+/Cmd+/
Rename symbol everywhereF2F2
Format documentShift+Alt+FShift+Opt+F
Quick fix / code actionCtrl+.Cmd+.

Multi-cursor & selection

ActionWindows / LinuxmacOS
Select next occurrence of selectionCtrl+DCmd+D
Select ALL occurrencesCtrl+Shift+LCmd+Shift+L
Add cursor above / belowCtrl+Alt+↑ / ↓Cmd+Opt+↑ / ↓
Add cursor by clickingAlt+ClickOpt+Click
Expand selection by scopeShift+Alt+→Ctrl+Shift+→

Navigation

ActionWindows / LinuxmacOS
Go to definitionF12F12
Peek definition inlineAlt+F12Opt+F12
Find all referencesShift+F12Shift+F12
Go to line numberCtrl+GCtrl+G
Go to symbol in fileCtrl+Shift+OCmd+Shift+O
Go back / forwardAlt+← / Alt+→Ctrl+- / Ctrl+Shift+-

Search & files

ActionWindows / LinuxmacOS
Search across the whole projectCtrl+Shift+FCmd+Shift+F
Replace in fileCtrl+HOpt+Cmd+F
Split editorCtrl+\Cmd+\
Reopen closed editorCtrl+Shift+TCmd+Shift+T

Worth remembering

  • If you memorise nothing else: Ctrl/Cmd+Shift+P reaches every command in the editor by typing its name — the rest of this sheet is shortcuts for what you do hourly.
  • Ctrl/Cmd+D then repeated presses is the gateway to multi-cursor editing: select a word, press again for the next occurrence, edit them all at once.

Related in Cheat sheets