Skip to main content
Multi-cursor editing is one of Fresh’s most powerful features, allowing you to edit multiple locations simultaneously. It works exactly like VS Code or Sublime Text, but in your terminal.

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.
ShortcutAction
Ctrl+DAdd cursor at next occurrence of selection
EscClear all secondary cursors
1

Select a word

Position cursor on a word (like a variable name) — if nothing is selected, Ctrl+D automatically selects the word under the cursor
2

Add cursors at matches

Press Ctrl+D repeatedly to add a cursor at each occurrence
3

Edit simultaneously

Type, delete, or move — all cursors respond in sync
4

Clear cursors

Press Esc to return to single cursor mode
No Selection Required: If you press Ctrl+D without a selection, Fresh automatically selects the word under the cursor first, then finds the next match.

Add Cursors Above/Below

Create a column of cursors for editing multiple consecutive lines:
ShortcutAction
Ctrl+Alt+↑Add cursor on line above
Ctrl+Alt+↓Add cursor on line below
1

Position initial cursor

Place your cursor where you want to start
2

Add vertical cursors

Press Ctrl+Alt+↓ repeatedly to add cursors on each line below (or Ctrl+Alt+↑ for above)
3

Edit all lines

All cursors maintain the same column position as you type

Multi-Cursor Workflows

Rename a Variable

The classic use case — rename all occurrences of a variable:
function calculate(value) {
  const result = value * 2;
  return result + value;
}
1

Select first occurrence

Click on value or press Ctrl+D with cursor on it
2

Add all occurrences

Press Ctrl+D two more times to select all three occurrences
3

Type new name

Type price — all occurrences update simultaneously

Edit Multiple Lines at Once

Add the same text to multiple lines:
apple
banana
cherry
date
1

Position at line start

Move cursor to the beginning of apple
2

Add cursors below

Press Ctrl+Alt+↓ three times to add cursors on each line
3

Type prefix

Type const (with space)
4

Move to end

Press End to move all cursors to line ends
5

Add suffix

Type = '' then press and select each word with Ctrl+Shift+←, then type to fill in the quotes

Select and Replace

Use multi-cursor with selection to replace multiple occurrences with different text:
console.log("test");
console.log("test");
console.log("test");
1

Create cursors

Use Ctrl+D to select all three "test" strings
2

Delete selection

The selected text is replaced when you start typing
3

Type first replacement

Type "debug" — wait, they all get the same text!
4

Undo and use different approach

For different replacements, undo and replace them one at a time, or use cursors on each line and navigate individually
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 with Ctrl+D, Fresh preserves the selection:
1

Select text

Select a word with Ctrl+W or manually with Shift+Arrow
2

Add cursor at next match

Press Ctrl+D — the new cursor has the same selection
3

Extend selections

Use Shift+→ to extend all selections simultaneously
4

Replace selections

Type to replace all selected text at once

Column Editing with Multi-Cursor

Edit a vertical column of text:
| Name    | Age |
| Alice   | 30  |
| Bob     | 25  |
| Charlie | 35  |
1

Position at end of first line

Move cursor after Age |
2

Add cursors down

Press Ctrl+Alt+↓ three times
3

Type new column

Type ✓ | — appears on all lines

Multi-Cursor with Block Selection

You can combine block selection with multi-cursor:
1

Create block selection

Use Alt+Shift+↓ and Alt+Shift+→ to select a rectangular region
2

Type or edit

When you type, Fresh converts the block selection to multi-cursor automatically
3

Each line gets a cursor

You now have one cursor per line in the block, ready for more editing

Multi-Cursor Behavior Details

Cursor Synchronization

All cursors maintain synchronized offsets:
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:
ActionBehavior with Multiple Cursors
Arrow keysAll cursors move in sync
Home / EndAll cursors jump to their respective line start/end
Ctrl+← / Ctrl+→All cursors move by word
PgUp / PgDnAll 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:
Line 10, Col 5 | 3 cursors | UTF-8 | JavaScript
This helps you stay aware of multi-cursor mode.

Common Pitfalls and Solutions

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.
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.
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.
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

No Cursor Limit: Fresh handles hundreds of cursors efficiently. However, very large numbers of cursors (1000+) may slow down rendering on some terminals.
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:
ShortcutAction
Ctrl+DAdd 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
EscClear all secondary cursors (return to single cursor)
Ctrl+ZUndo all multi-cursor edits as one operation

Editing Features

Learn about all editing capabilities

Search & Replace

Find and replace with regex

Block Selection

Rectangular selection mode

Build docs developers (and LLMs) love