Better Multi Cursor Support

Use case or problem

A large part of the reason I prefer markdown-based editors for note taking is that a lot of what I do is code or configuration, which can be represented in code blocks. I very frequently use multi-line editing to change large numbers of lines efficiently. While Obsidian does have support for multi-line editing, it is currently quite rudimentary.

The best way to explain this is to provide an example. As my primary text editor I use Sublime Text, which has by far the best multi-line editing I’ve seen:

  1. Multiple cursors can be placed by holding Ctrl and left clicking.
    • The above also works with double-click to select multiple words.
  2. Multiple cursors can be added by holding Ctrl+Alt and using the up/down arrow keys.
  3. Multiple cursors can be added by selecting multiple lines as normal and then pressing Ctrl+Shift+L to split the selection into one selection per line.
  4. Selecting some text and then pressing Ctrl+D will add the next instance of that text to the selection.
    • This is extremely useful for editing repeated data such as addresses, names, etc.
  5. Selecting some text and then pressing Alt+F3 will select all instances of that text
  6. Multiple adjacent cursors can be placed by holding Shift and dragging right-click.
    • The above also works to select large regions (similar to visual block in vim).

Once multiple lines are selected, all operations with the selections work as expected, e.g.:

  • Using the arrow keys will move all cursors at the same time.
  • Holding Ctrl and pressing the arrow keys will jump the cursors by word.
  • Holding shift and pressing the arrow keys will add/remove from the selection.
  • Holding Ctrl and Shift will add/remove from the selection by word.
  • Holding Ctrl and pressing Delete or Backspace will delete the word.
  • Using formatting hotkeys or the command palette will execute the operation on all selected text.

Proposed solution

Obsidian currently does the first of those, though it uses a different hotkey (Alt). This hotkey does not seem to be rebindable. Ideally, the user could rebind this to retain their muscle memory when switching between applications.

The missing features are extremely useful when editing sections of repetitive text. Note that I am not proposing Obsidian turn into an IDE or even a text editor, but these features are very useful for editing snippets and data inside notes, including the contents of tables.

1 Like

would be nice.

also: the cursors blinking out of order (not synced) is driving me mad

Hello,
Thankyou for sharing this information!

Best regards,
Dora

1 Like