Multi-Cursor Editing
VMark supports powerful multi-cursor editing in both WYSIWYG and Source modes, allowing you to edit multiple locations simultaneously.
Quick Start
| Action | Shortcut |
|---|---|
| Add cursor at next match | Mod + D |
| Skip match, jump to next | Mod + Shift + D |
| Add cursors at all matches | Mod + Shift + L |
| Add cursors at all matches in the current block | Alt + Mod + Shift + L |
| Undo last cursor addition | Alt + Mod + Z |
| Add cursor above | Mod + Alt + Up |
| Add cursor below | Mod + Alt + Down |
| Add/remove cursor at click | Alt + Click |
| Collapse to single cursor | Escape |
TIP
Mod = Cmd on macOS, Ctrl on Windows/Linux Alt = Option on macOS
Adding Cursors
Select Next Occurrence (Mod + D)
- Select a word or place cursor on a word
- Press
Mod + Dto add a cursor at the next occurrence - Press again to add more cursors
- Type to edit all locations at once
count to total: - Double-click
countto select it - Press
Mod + Drepeatedly to select each occurrence - Type
total— all occurrences update simultaneously
Select All Occurrences (Mod + Shift + L)
Select all occurrences of the current word or selection at once:
- Select a word or text
- Press
Mod + Shift + L - All matching occurrences in the current block are selected
- Type to replace all at once
Alt + Click
Hold Alt (Option on macOS) and click to:
- Add a cursor at that position
- Remove a cursor if one already exists there
This is useful for placing cursors at arbitrary positions that aren't matching text.
Skip Occurrence (Mod + Shift + D)
When Mod + D selects a match you don't want, skip it:
- Press
Mod + Dto start adding matches - If the latest match is unwanted, press
Mod + Shift + Dto skip it - The skipped match is removed and the next match is selected instead
This is the multi-cursor equivalent of "Find Next" — it lets you cherry-pick which occurrences to edit.
Soft Undo (Alt + Mod + Z)
Undo the last cursor addition without losing all your cursors:
- Press
Mod + Dseveral times to build up cursors - If you added one too many, press
Alt + Mod + Z - The last-added cursor is removed, restoring the previous state
Unlike Escape (which collapses everything), soft undo steps back one cursor at a time.
Add Cursor Above / Below (Mod + Alt + Up/Down)
Add cursors vertically, one line at a time:
- Place your cursor on a line
- Press
Mod + Alt + Downto add a cursor on the next line - Press again to keep adding cursors downward
- Use
Mod + Alt + Upto add cursors upward instead
This is ideal for editing column-aligned text or making the same edit across consecutive lines.
Editing with Multiple Cursors
Once you have multiple cursors, all standard editing works at each cursor:
Typing
- Characters are inserted at all cursor positions
- Selections are replaced at all positions
Deletion
- Backspace — deletes character before each cursor
- Delete — deletes character after each cursor
Navigation
- Arrow keys — move all cursors together
- Shift + Arrow — extend selection at each cursor
- Mod + Arrow — jump by word/line at each cursor
Tab Escape
Tab escape works independently for each cursor:
- Cursors inside bold, italic,
code, orstrikejump to the end of that formatting - Cursors inside links escape from the link
- Cursors before closing brackets
)]}jump over them - Cursors in plain text stay in place
This lets you escape from multiple formatted regions simultaneously. See Smart Tab Navigation for details.
Clipboard
Copy (Mod + C):
- Copies text from all selections, joined by newlines
Paste (Mod + V):
- If the clipboard has the same number of lines as cursors, each line goes to each cursor
- Otherwise, the full clipboard content is pasted at all cursors
Scoping
Code is scoped; prose is not. Inside a code block (WYSIWYG) or a fenced block (Source), cursors never cross the fence — matching a variable name in one snippet cannot place a cursor in another. In ordinary prose, Mod + D and Mod + Shift + L search the whole document.
That is often what you want, and occasionally not: in a long document, matching a common word places cursors in paragraphs far off-screen.
Select All Occurrences in Block
Alt + Mod + Shift + L selects every match within the current block only — the paragraph, heading, or list item your cursor is in. Blank lines bound a block in Source mode; the enclosing block bounds it in WYSIWYG. Inside a code fence it behaves exactly like Mod + Shift + L, since the fence is already the block.
The two are siblings, not a mode: Mod + Shift + L still reaches the whole document, so nothing you already rely on changes.
Reach for the block-scoped version when the word is common — renaming a variable mentioned in prose, or editing one list item's pattern. Reach for the document-wide one when you genuinely mean everywhere.
Collapsing Cursors
Press Escape to collapse back to a single cursor at the primary position.
Cursor Stability
Collapsed cursors remain stable when text is inserted at the cursor position. They will not unexpectedly expand into selections after mapped insertions (fixed in v0.6.x).
Visual Feedback
- Primary cursor — standard blinking cursor
- Secondary cursors — additional blinking cursors with distinct styling
- Selections — each cursor's selection is highlighted
In dark mode, cursor and selection colors automatically adjust for visibility.
Mode Comparison
| Feature | WYSIWYG | Source |
|---|---|---|
Mod + D | ✓ | ✓ |
Mod + Shift + D (Skip) | ✓ | ✓ |
Mod + Shift + L | ✓ | ✓ |
Alt + Mod + Z (Soft Undo) | ✓ | ✓ |
Mod + Alt + Up/Down | ✓ | ✓ |
Alt + Click | ✓ | ✓ |
| Fence scoping | Code blocks | Code fences |
| Block-scoped select-all | Alt + Mod + Shift + L | Alt + Mod + Shift + L |
| Wrap-around search | ✓ | ✓ |
Tips & Best Practices
Renaming Variables
- Double-click the variable name
Alt + Mod + Shift + Lto select every match in this block (orMod + Shift + Lfor the whole document)- Type the new name
Adding Prefixes/Suffixes
- Place cursor before/after repeated text
Mod + Dto add cursors at each occurrence- Type the prefix or suffix
Editing List Items
- Select the common pattern (like
-at line starts) Mod + Shift + Lto select all- Edit all list items at once
When to Use Each Shortcut
| Scenario | Best Shortcut |
|---|---|
| Careful, incremental selection | Mod + D |
| Skip unwanted match | Mod + Shift + D |
| Replace all in the current block | Alt + Mod + Shift + L |
| Replace all in the document | Mod + Shift + L |
| Undo last cursor step | Alt + Mod + Z |
| Edit consecutive lines | Mod + Alt + Up/Down |
| Arbitrary positions | Alt + Click |
| Quick exit | Escape |
Limitations
- Atom nodes: Cannot place cursors inside images, embedded content, or math blocks in WYSIWYG mode
- IME input: When using input methods (Chinese, Japanese, etc.), composition only affects the primary cursor
- Document-wide: Selections are scoped to blocks, not the entire document
Keyboard Reference
| Action | Shortcut |
|---|---|
| Select next occurrence | Mod + D |
| Skip occurrence | Mod + Shift + D |
| Select all occurrences | Mod + Shift + L |
| Soft undo cursor | Alt + Mod + Z |
| Add cursor above | Mod + Alt + Up |
| Add cursor below | Mod + Alt + Down |
| Add/remove cursor | Alt + Click |
| Collapse to single cursor | Escape |
| Move all cursors | Arrow keys |
| Extend all selections | Shift + Arrow |
| Jump by word | Alt + Arrow |
| Jump by line | Mod + Arrow |