What is Multi-Cursor Editing?
Multi-cursor editing lets you create multiple cursors in your document. Every action you perform — typing, deleting, moving, selecting — happens at all cursor positions simultaneously.Creating Multiple Cursors
Add Cursor at Next Match
The most common multi-cursor workflow: select a word and add cursors at each occurrence.Select a word
Ctrl+D automatically selects the word under the cursorAdd cursors at matches
Ctrl+D repeatedly to add a cursor at each occurrenceEdit simultaneously
Clear cursors
Esc to return to single cursor modeAdd Cursors Above/Below
Create a column of cursors for editing multiple consecutive lines:Position initial cursor
Add vertical cursors
Ctrl+Alt+↓ repeatedly to add cursors on each line below (or Ctrl+Alt+↑ for above)Edit all lines
Multi-Cursor Workflows
Rename a Variable
The classic use case — rename all occurrences of a variable:Select first occurrence
value or press Ctrl+D with cursor on itAdd all occurrences
Ctrl+D two more times to select all three occurrencesType new name
price — all occurrences update simultaneouslyEdit Multiple Lines at Once
Add the same text to multiple lines:Position at line start
appleAdd cursors below
Ctrl+Alt+↓ three times to add cursors on each lineType prefix
const (with space)Move to end
End to move all cursors to line endsAdd suffix
= '' then press ← and select each word with Ctrl+Shift+←, then type to fill in the quotesSelect and Replace
Use multi-cursor with selection to replace multiple occurrences with different text:Create cursors
Ctrl+D to select all three "test" stringsDelete selection
Type first replacement
"debug" — wait, they all get the same text!Undo and use different approach
Advanced Multi-Cursor Techniques
Working with Selections
When you create a cursor withCtrl+D, Fresh preserves the selection:
Select text
Ctrl+W or manually with Shift+ArrowAdd cursor at next match
Ctrl+D — the new cursor has the same selectionExtend selections
Shift+→ to extend all selections simultaneouslyReplace selections
Column Editing with Multi-Cursor
Edit a vertical column of text:Position at end of first line
Age |Add cursors down
Ctrl+Alt+↓ three timesType new column
✓ | — appears on all linesMulti-Cursor with Block Selection
You can combine block selection with multi-cursor:Create block selection
Alt+Shift+↓ and Alt+Shift+→ to select a rectangular regionType or edit
Each line gets a cursor
Multi-Cursor Behavior Details
Cursor Synchronization
All cursors maintain synchronized offsets:What does synchronized mean?
What does synchronized mean?
Ctrl+D, Fresh ensures they all point to the same relative position within their selections. If the first cursor is at the start of its selection, all other cursors are also at the start of their selections.This matters when you create selections with Shift+Left (backward selection) vs Shift+Right (forward selection) — Ctrl+D preserves the direction.Movement with Multiple Cursors
All cursor movement commands work with multiple cursors:Editing with Multiple Cursors
All editing operations work with multiple cursors:- Typing: Characters appear at all cursor positions
- Backspace/Delete: Removes characters at all cursors
- Paste: Inserts clipboard content at all cursors
- Cut/Copy: Captures text from all selections
Ctrl+Z undoes all the simultaneous edits and restores all cursor positions.Multi-Cursor Status Indicator
The status bar shows how many cursors are active:Common Pitfalls and Solutions
Cursor positions are misaligned after Ctrl+D
Cursor positions are misaligned after Ctrl+D
Shift+Left and then pressing Ctrl+D, cursors appear at different offsets (one at start, one at end).Solution: This was a bug in earlier versions and has been fixed. Update to the latest version of Fresh. All cursors now maintain synchronized positions.Can't create cursors on lines with different lengths
Can't create cursors on lines with different lengths
Ctrl+Alt+↓ on lines of varying lengths causes cursors to appear at different column positions.Solution: This is expected behavior. Each cursor maintains the same column number from the original position. Shorter lines will have cursors at their end. Use End key to move all cursors to their respective line ends if needed.Lost all my cursors by accident
Lost all my cursors by accident
Esc or clicked the mouse and lost all secondary cursors.Solution: Use Ctrl+Z (undo) to restore your cursor state. Fresh’s undo system tracks cursor positions.Want to skip one occurrence when using Ctrl+D
Want to skip one occurrence when using Ctrl+D
Ctrl+D adds cursors sequentially, but you want to skip one match.Solution: Currently, you can’t skip matches with Ctrl+D. Instead, use search and replace, or manually place cursors with Ctrl+Alt+↓ and individual clicks.Multi-Cursor vs Other Tools
When to Use Multi-Cursor
Use Multi-Cursor When
- Renaming a variable in a small scope
- Adding/removing the same text on multiple lines
- Formatting multiple similar lines
- Making the same edit in several places you can see
Use Other Tools When
- Renaming across many files → Use LSP rename
- Complex pattern matching → Use regex search/replace
- Different text at each location → Use search/replace or macros
- Project-wide changes → Use git grep and replace