7 VS Code Shortcuts
To impress your Usenet group
12/21/2024
read time:2 mins
I got a new keyboard which messed with my keyboard shortcut muscle memory so I had to look them all up again and retrain my brain. Learn these 7 tricks jealous coworkers hate to supercharge your workflow and retire in Malta.
Multiple Cursors
I learned the other day that some devs I work with don’t know the VS Code multiple cursor shortcuts. For me these are big game changers.
-
Insert cursors on each selected line
Mac: Select lines, pressOption + Shift + I
Windows: Select lines, pressAlt + Shift + I
This places a cursor at the end of every selected line. -
Insert multiple cursors one at a time
Mac: HoldOption
, then click.
Windows: HoldAlt
, then click. -
Click and drag for multiple cursors
Mac: HoldOption + Shift
, then click + drag.
Windows: HoldAlt + Shift
, then click + drag.
This is “column selection” mode in VS Code. -
Add cursor at each regex match
Mac:Cmd + F
→ enable regex → type pattern → pressOption + Enter
Windows:Ctrl + F
→ enable regex → type pattern → pressAlt + Enter
-
Add cursor at end of each line
Mac:Cmd + Option + ↓
Windows:Ctrl + Alt + ↓
Misc Handy Stuff
-
Select all occurrences of word
Mac:Cmd + D
Windows:Ctrl + D
-
Move line up/down
Mac:Option + ↑
Windows:Option + ↑