Multi-caret editing¶
Place several cursors at once and edit in many places simultaneously — type, delete, and select at every caret together. This makes repetitive edits across a file quick and precise.
Working with multiple carets¶
- Add additional carets to create several insertion points at once.
- Anything you type, delete, or select is applied at every caret simultaneously.
- Multi-selection lets you operate on several separate selections together.
Multi-caret editing pairs naturally with selecting multiple occurrences of a term and changing them all in one pass.
Auto-pair & smart indentation also work at every caret: typing a bracket pairs it at each, Enter keeps each line's indentation, and a single Undo reverts the whole multi-caret edit.
Adding carets¶
The commands live in Edit ▸ Multiple Selections.
| Action | Windows | macOS |
|---|---|---|
| Add Caret Above / Add Caret Below | Ctrl+Alt+Up / Ctrl+Alt+Down |
⌥⌘↑ / ⌥⌘↓ |
| Add Next Occurrence (of the selection or the word at the caret) | Ctrl+D |
⌘D |
| Select All Occurrences | Ctrl+Shift+L |
⇧⌘L |
| Add a caret with the mouse | Ctrl+click |
⌘+click |
| Collapse to Single Caret | Esc |
Esc |
Carets added this way are independent: the arrow keys, Home, End and the
word-movement keys move every caret at once, each on its own line, and holding
Shift extends every selection.
Column (rectangular) selection¶
A column selection is a different thing: one rectangular block spanning several lines.
| Action | Windows | macOS |
|---|---|---|
| Extend a column selection with the keyboard | Alt+Shift+arrow keys |
⌥⇧+arrow keys |
| Draw a column selection with the mouse | Alt+drag |
⌥+drag |
Typing into a column selection writes on every line of the block, so an empty
one looks like a caret on each line. It stays a block only while you extend it
with the keys above: a plain movement key — an arrow, Home, End — ends the
column selection and leaves a single caret. To move a caret on each line
together, add the carets with Add Caret Above / Add Caret Below instead.
The Column Editor fills a column selection with text or a number sequence.