Master VS Code multiple cursors for lightning-fast editing. These keyboard shortcuts will transform how quickly you can make repetitive changes across multiple lines.
Essential Multiple Cursor Shortcuts
Ctrl + D
Select next occurrence of current word
Perfect for renaming variables one by one
Ctrl + Shift + L
Select all occurrences of current word
Rename ALL instances instantly
Alt + Click
Add cursor at clicked position
Place cursors anywhere you want
Ctrl + Alt + β/β
Add cursor above/below
Great for column-like editing
Shift + Alt + I
Add cursor at end of each selected line
Perfect for adding semicolons to multiple lines
Shift + Alt + Drag
Column selection mode
Select rectangular blocks of text
Real-World Examples
Example 1: Renaming Variables
// Select 'userName' and press Ctrl + Shift + L
const userName = 'john';
console.log(userName);
return userName.toUpperCase();
// Now type 'userEmail' - all instances change!
Example 2: Adding Semicolons
// Select these lines and press Shift + Alt + I
const name = 'John'
const age = 30
const city = 'New York'
// Now type ';' - adds to all lines!
Example 3: Creating Arrays
// Use Alt + Click to place cursors before each name
John
Jane
Bob
Alice
// Type '"' then End key then '", - creates array items!
π― Pro Tips
- Escape key exits multiple cursor mode
- Ctrl + U undoes the last cursor operation
- Home/End moves all cursors to line start/end
- Use Ctrl + β/β to move cursors by words
- Hold Shift while moving to select text
Advanced Techniques
π Selection to Multiple Cursors
- Select text with multiple lines
- Press
Shift + Alt + I - Each line gets a cursor at the end
- Perfect for bulk edits!
β‘ Quick Pattern Matching
- Place cursor on a word
- Press
Ctrl + Dto select first occurrence - Keep pressing
Ctrl + Dto add more - Press
Ctrl + K, Ctrl + Dto skip current and go to next
// Common use case: Converting to camelCase
const user_name = 'john';
const user_age = 30;
const user_email = '[email protected]';
// Select 'user_' β Ctrl + Shift + L β Replace with 'user'
π¬ Comments & Reactions