πŸ’‘ Developer Tips / VS Code Multiple Cursors Magic
productivity

VS Code Multiple Cursors Magic

November 5, 2025 β€’ 1 min read
← Back to Tips
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

  1. Select text with multiple lines
  2. Press Shift + Alt + I
  3. Each line gets a cursor at the end
  4. Perfect for bulk edits!

⚑ Quick Pattern Matching

  1. Place cursor on a word
  2. Press Ctrl + D to select first occurrence
  3. Keep pressing Ctrl + D to add more
  4. Press Ctrl + K, Ctrl + D to 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