Split Selection Into Lines

Coming to Obsidian from text editors like Sublime or VS Code, a customary feature that might do well in Obsidian is the ability to split the selection into lines. This feature is also called multiple selections etc.

image

Use case or problem

User has pasted in several lines of similar text. Perhaps the lines all contain something similar that needs to be edited out or revised. Perhaps the lines need to be all formatted as a list.

Proposed solution

With a command and a keyboard shortcut, the user can select the group of lines and then “split” the selection so that there is one cursor on each of the lines. The cursors can be moved along the lines to make similar additions or deletions to each. This can all be done from the keyboard, faster than using a find/replace (and specifically only within the selected lines).

Current workaround (optional)

copy the selection to a new file, then run find/replace, or manually edit each line.

3 Likes

There is something close in Obsidian already. If you hold the Alt key and click, it will put a cursor wherever you have clicked. I am unaware of how to do this with a keyboard shortcut, though.

Also want to add, that there are some common scenarios with this feature, which looks this way:

  1. user spam command - select line some times,
    (ctrl+L), just push ctrl and spam L
    after use command to split on multiplecursors
    ctrl+shift+L

  2. user select some expression, as example word “test”
    use command - add next searched expr. to current selection
    so, I’ll spam Ctrl+D combo 10 times, and get one big selection with 10 words “test”
    Next I use command to split, ctrl+shift+L, and get 10 multicursors for each word test.

Please consider this scenarios, normally multicursors used at 99% such cases

Oh, searched a bit, it solved with plugin “Obsidian Editor Shorcuts”