Essential Shortcuts
A handful of shortcuts dominate the productivity curve. Memorise palette + file + line + symbol navigation; everything else you can search through the palette as needed.
The shortcuts that actually matter
EXAMPLE
# Commands — the door to everything Cmd / Ctrl + Shift + P Command Palette Cmd / Ctrl + P Quick Open file by name Ctrl + ` Toggle integrated terminal Ctrl + B Toggle sidebar Cmd / Ctrl + , Settings # Navigation Cmd / Ctrl + P File Ctrl + Shift + O Symbol in file (prefix: @) Ctrl + T Symbol in workspace (prefix: #) Ctrl + G Go to line F12 Go to definition Alt + F12 Peek definition Shift + F12 Show references Ctrl + - / Ctrl + Shift + - Back / forward through cursor history # Editing Alt + ↑ / ↓ Move line up / down Shift + Alt + ↑ / ↓ Duplicate line Ctrl + / Toggle line comment Shift + Alt + A Toggle block comment Ctrl + Shift + K Delete line Ctrl + Enter Insert line below Ctrl + Shift + Enter Insert line above Ctrl + L Select current line Ctrl + D Add next match to selection (multi-cursor) Ctrl + Shift + L Select ALL matches Alt + click Add a cursor Ctrl + Alt + ↑ / ↓ Column cursors Tab / Shift + Tab Indent / outdent F2 Rename symbol (across files) # Refactor Ctrl + . Quick fix / refactor menu Ctrl + Shift + R Refactor menu Shift + Alt + F Format file Ctrl + K, Ctrl + F Format selection only Ctrl + Shift + O Organise imports # Find / replace Ctrl + F Find Ctrl + H Replace Ctrl + Shift + F Find across workspace Ctrl + Shift + H Replace across workspace Alt + Enter In Find: select all matches as multi-cursor Alt + R / Alt + C / Alt + W Toggle regex / case / whole-word # Editor management Ctrl + W Close editor Ctrl + K W Close all editors Ctrl + \\ Split editor Ctrl + 1 / 2 / 3 Focus group 1 / 2 / 3 Ctrl + Tab Cycle open editors
Why it matters
Customise ~/.config/Code/User/keybindings.json. Bind the 5-10 commands you use weekly — format, split, terminal, source-control commit — to two-key chords you can do without looking.
Tip: Tweak the snippet with Try it Yourself », then sit the quiz at the bottom of the page.
Example
Example
// Move line Alt + ↑ / ↓ // Duplicate line Shift + Alt + ↑ / ↓ // Multi-cursor Ctrl + D (next match) / Alt + Click // Comment Ctrl + / // Format file Shift + Alt + F // Go to file Ctrl + P // Go to symbol Ctrl + Shift + OTry it Yourself »
Exercise
Move the current line down.
Alt +
Direction.
Discussion
Loading…