How to Use Multiple Cursors in VS Code

· Category: VS Code & Developer Tools

Short answer

Multiple cursors let you type or edit in several places at once. VS Code supports adding cursors with clicks, keyboard shortcuts, and selection commands.

Steps

  1. Hold Alt (Windows/Linux) or Option (macOS) and click to place multiple cursors.
  2. Press Ctrl+Alt+Down or Ctrl+Alt+Up to add cursors to adjacent lines.
  3. Use Ctrl+D to select the next occurrence of the current word.
  4. Press Ctrl+Shift+L to select all occurrences at once.
  5. Type normally; your input appears at every cursor location.

Tips

  • Use Undo (Ctrl+Z) carefully; it undoes the last edit at all cursor positions.
  • Column selection mode (Shift+Alt+Drag) is great for editing CSV or aligned data.
  • Combine with Emmet for powerful batch HTML generation.

Common issues

  • Accidental multi-cursor triggers can be disabled by removing the keybinding.
  • Some commands do not support multiple cursors and only run at the primary cursor.