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.| Shortcut | Action |
|---|---|
Ctrl+D | Add cursor at next occurrence of selection |
Esc | Clear all secondary cursors |
Select a word
Position cursor on a word (like a variable name) — if nothing is selected,
Ctrl+D automatically selects the word under the cursorAdd Cursors Above/Below
Create a column of cursors for editing multiple consecutive lines:| Shortcut | Action |
|---|---|
Ctrl+Alt+↑ | Add cursor on line above |
Ctrl+Alt+↓ | Add cursor on line below |
Add vertical cursors
Press
Ctrl+Alt+↓ repeatedly to add cursors on each line below (or Ctrl+Alt+↑ for above)Multi-Cursor Workflows
Rename a Variable
The classic use case — rename all occurrences of a variable:Edit Multiple Lines at Once
Add the same text to multiple lines:Select and Replace
Use multi-cursor with selection to replace multiple occurrences with different text:Same Text Limitation: All cursors type the same text. For different text at each cursor, you’ll need to use search and replace or edit each occurrence separately.
Advanced Multi-Cursor Techniques
Working with Selections
When you create a cursor withCtrl+D, Fresh preserves the selection:
Column Editing with Multi-Cursor
Edit a vertical column of text:Multi-Cursor with Block Selection
You can combine block selection with multi-cursor:Multi-Cursor Behavior Details
Cursor Synchronization
All cursors maintain synchronized offsets:What does synchronized mean?
What does synchronized mean?
When you create multiple cursors with
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:| Action | Behavior with Multiple Cursors |
|---|---|
| Arrow keys | All cursors move in sync |
Home / End | All cursors jump to their respective line start/end |
Ctrl+← / Ctrl+→ | All cursors move by word |
PgUp / PgDn | All cursors scroll together |
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
Undo Atomicity: All changes made with multiple cursors are treated as a single operation. One
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
Issue: When selecting with
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
Issue: Using
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
Issue: Pressed
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
Issue: Pressing
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
Performance Notes
Multi-cursor editing works efficiently even in large files (multi-gigabyte). Fresh’s architecture ensures low latency regardless of file size.
Keyboard Reference
Quick reference for all multi-cursor shortcuts:| Shortcut | Action |
|---|---|
Ctrl+D | Add cursor at next occurrence of selection (or select word if no selection) |
Ctrl+Alt+↑ | Add cursor on line above |
Ctrl+Alt+↓ | Add cursor on line below |
Esc | Clear all secondary cursors (return to single cursor) |
Ctrl+Z | Undo all multi-cursor edits as one operation |
Related Documentation
Editing Features
Learn about all editing capabilities
Search & Replace
Find and replace with regex
Block Selection
Rectangular selection mode