Multiple Selections
Espresso can have more than one selection, or more than one cursor, in a document at once. What you type is typed at every one of them, which makes it quick to rename something throughout a file, or to make the same change on a run of lines.
Selecting more than one thing
With the mouse:
- Hold command and click to add a cursor, or drag to add a selection
- Hold option and drag to select a block: the same columns on each line you drag over
From the Text ⟩ Select menu:
- Next Occurrence (option command E) adds the next place the selected text occurs. With nothing selected, it first selects the word the cursor is in. Choose it again and again to work down the document.
- All Occurrences (control command E) selects every place the selected text, or the word the cursor is in, occurs
- Add Insertion Point Above (control shift up) and Add Insertion Point Below (control shift down) add a cursor on the line above or below, at the same column
- Split into Lines (control command L) turns a selection that runs over several lines into one selection for each line
And from a search: Edit ⟩ Find ⟩ Select All Matches (control command G) selects everything the find bar has found.
When you select a word, Espresso shows faintly where else in the document it occurs, so you can see what All Occurrences would select. You can turn this off in the Text Editing preferences.
Typing with several selections
- What you type, paste or delete happens at every selection, and one Undo takes all of it back
- Brackets and quotes pair up at each selection, and typing a bracket or quote with text selected wraps each selection in the pair
- tab with text selected shifts the lines of every selection right, and shift tab shifts them left. With cursors only, tab inserts a tab at each.
- Text actions such as Un/Comment, and the commands of the Convert / Strip menu, work on every selection
The readout in the corner of the editor says how many selections there are.
Going back to one
Click anywhere in the text, or press up or down.