Skip to content

Multi-Cursor Editing

VMark supports powerful multi-cursor editing in both WYSIWYG and Source modes, allowing you to edit multiple locations simultaneously.

Quick Start

ActionShortcut
Add cursor at next matchMod + D
Skip match, jump to nextMod + Shift + D
Add cursors at all matchesMod + Shift + L
Undo last cursor additionAlt + Mod + Z
Add cursor aboveMod + Alt + Up
Add cursor belowMod + Alt + Down
Add/remove cursor at clickAlt + Click
Collapse to single cursorEscape

TIP

Mod = Cmd on macOS, Ctrl on Windows/Linux Alt = Option on macOS

Adding Cursors

Select Next Occurrence (Mod + D)

  1. Select a word or place cursor on a word
  2. Press Mod + D to add a cursor at the next occurrence
  3. Press again to add more cursors
  4. Type to edit all locations at once
Example: To rename a variable count to total:
  1. Double-click count to select it
  2. Press Mod + D repeatedly to select each occurrence
  3. Type total — all occurrences update simultaneously

Select All Occurrences (Mod + Shift + L)

Select all occurrences of the current word or selection at once:

  1. Select a word or text
  2. Press Mod + Shift + L
  3. All matching occurrences in the current block are selected
  4. 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:

  1. Press Mod + D to start adding matches
  2. If the latest match is unwanted, press Mod + Shift + D to skip it
  3. 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:

  1. Press Mod + D several times to build up cursors
  2. If you added one too many, press Alt + Mod + Z
  3. 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:

  1. Place your cursor on a line
  2. Press Mod + Alt + Down to add a cursor on the next line
  3. Press again to keep adding cursors downward
  4. Use Mod + Alt + Up to 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
  • 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, or strike jump 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

Block Scoping

Multi-cursor operations are scoped to the current block to prevent unintended edits across unrelated sections.

In WYSIWYG Mode

  • Cursors cannot cross code block boundaries
  • If your primary cursor is inside a code block, new cursors stay within that block

In Source Mode

  • Blank lines act as block boundaries
  • Mod + D and Mod + Shift + L only match within the current paragraph
Why block scoping?

This prevents accidentally editing a variable name in unrelated code sections or changing text in different paragraphs that happen to match.

Collapsing Cursors

Press Escape to collapse back to a single cursor at the primary position.

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

FeatureWYSIWYGSource
Mod + D
Mod + Shift + D (Skip)
Mod + Shift + L
Alt + Mod + Z (Soft Undo)
Mod + Alt + Up/Down
Alt + Click
Block scopingCode fencesBlank lines
Wrap-around search

Tips & Best Practices

Renaming Variables

  1. Double-click the variable name
  2. Mod + Shift + L to select all in the block
  3. Type the new name

Adding Prefixes/Suffixes

  1. Place cursor before/after repeated text
  2. Mod + D to add cursors at each occurrence
  3. Type the prefix or suffix

Editing List Items

  1. Select the common pattern (like - at line starts)
  2. Mod + Shift + L to select all
  3. Edit all list items at once

When to Use Each Shortcut

ScenarioBest Shortcut
Careful, incremental selectionMod + D
Skip unwanted matchMod + Shift + D
Replace all in blockMod + Shift + L
Undo last cursor stepAlt + Mod + Z
Edit consecutive linesMod + Alt + Up/Down
Arbitrary positionsAlt + Click
Quick exitEscape

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

ActionShortcut
Select next occurrenceMod + D
Skip occurrenceMod + Shift + D
Select all occurrencesMod + Shift + L
Soft undo cursorAlt + Mod + Z
Add cursor aboveMod + Alt + Up
Add cursor belowMod + Alt + Down
Add/remove cursorAlt + Click
Collapse to single cursorEscape
Move all cursorsArrow keys
Extend all selectionsShift + Arrow
Jump by wordAlt + Arrow
Jump by lineMod + Arrow