Did you ever wanted to write code like a pro? To move chunks of code back and forth easily? Access whatever you want in the blink of an eye? Well, I did.
All the coding courses I took were recorded by instructors who seemed to know their code editor by heart. Seeing them slamming their keyboard and manipulating their code like pros made me think it was just ridiculous. That's when I decided to learn all the essential shortcuts of my favorite code editor: VS Code.
You'll find below all of the different shortcuts I use:
- Open the command palette:
⇧ + ⌘ + P
orCtrl + Shift + P
- Open keyboard shortcuts:
⌘ + K ⌘ + S
orCtrl + K Ctrl + S
- Open user settings:
⌘ + ,
orCtrl + ,
Editing
- Undo:
⌘ + Z
orCtrl + Z
- Redo:
⇧ + ⌘ + Z
orCtrl + Shift + Z
- Remove one word:
⌥ + ⌫
orCtrl + Backspace
- Cut line:
⌘ + X
orCtrl + X
- Copy line:
⌘ + C
orCtrl + C
- Paste line:
⌘ + V
orCtrl + V
- Delete line:
⇧ + ⌘ + K
orCtrl + Shift + K
- Move line up/down:
⌥ + ↑/↓
orAlt + ↑/↓
- Copy line up/down:
⇧ + ⌥ + ↑/↓
orShift + Alt + ↑/↓
- Toggle line commment:
⌘ + /
orCtrl + /
Selecting
- Select the next/previous letter:
⇧ + →/←
orShift + →/←
- Select the next/previous word:
⇧ + ⌥ + →/←
orCtrl + Shift + →/←
- : Select current line / current and next line / etc :
⌘ + L / ⌘ + L ⌘ + L
orCtrl + L / Ctrl + L Ctrl + L
- Select line up/down:
⇧ + ↑/↓
orCtrl + Shift + ↑/↓
- Select to the beginning/end of file:
⇧ + ⌘ + ↑/↓
orCtrl + Shift + Home/End
- Expand/Shrink selection:
⇧ + ⌃ + →/←
orShift + Alt + →/←
Navigating
- Go to the next/previous word:
⌥ + →
orCtrl + →/←
- Go to beginning/end of line:
⌘ + →/←
orHome/End
- Go to beginning/end of file:
⌘ + ↑/↓
orCtrl + Home/End
- Go to line:
⌃ + G
orCtrl + G
- Go to file / Go to previous file:
⌘ + P / ⌘ + P ⌘ + P
orCtrl + P / Ctrl + P Ctrl + P
- Open next opened tab:
⌃ + Tab
orCtrl + Tab
- Go to symbol:
⇧ + ⌘ + O
orCtrl + Shift + O
- Go to symbol in the workspace:
⌘ + T
orCtrl + T
Files
- Save file:
⌘ + S
orCtrl + S
- Close file:
⌘ + W
orCtrl + W
- Close all files:
⌘ + K ⌘ + W
orCtrl + K Ctrl + W
- Open previously closed:
⇧ + ⌘ + T
orCtrl + Shift + T
Search
- Find:
⌘ + F
orCtrl + F
- Replace:
⌘ + ⌥ + F
orCtrl + H
- Find next/previous:
⌘ + G / ⇧ + ⌘ + G
orCtrl + F3 / Shift + Ctrl +F3
Cursors
- Insert cursor:
⌥ + Click
orAlt + Click
- Insert cursor above:
⌥ + ⌘ + ↑/↓
orCtrl + Alt + ↑
- Select next match:
⌘ + D
orCtrl + D
- De-select previous match:
⌘ + U
orCtrl + U
- Select all occurrences of current word:
⇧ + ⌘ + L
orCtrl + Shift + L
- Remove cursors:
Escape
Display
- Show Explorer:
⇧ + ⌘ + E
orCtrl + Shift + E
- Show Search:
⇧ + ⌘ + F
orCtrl + Shift + F
- Show Source Control:
⇧ + ⌃ + G
orCtrl + Shift + G
- Show Debug:
⇧ + ⌘ + D
orCtrl + Shift + D
: Show Debug - Show Extensions:
⇧ + ⌘ + X
orCtrl + Shift + X
- Toggle Sidebar:
⌘ + B
orCtrl + B
- Split editor:
⌘ + \
orCtrl + \
- Enter zen mode:
⌘ + K Z
orCtrl + K Z
- Show (focus) integrated terminal:
⌃ + `
orCtrl + `
- Focus first/second/third editor window:
⌘ + 1 / ⌘ + 2 / ⌘ + 3
orCtrl + 1 / Ctrl + 2 / Ctrl + 3
Alternatively, you can also check the official keyboard shortcuts of VS Code for macOS and for Windows.
Top comments (1)
Thanks, been looking for this for a while!