I know we can hold cmd and click to select multiple cursors. But it would be great to be able to do the same with the keyboard. Like atom and sublime text does.
Agreed, it is a big pain to be typing and then have to not only alt+click, but also AIM for what you want. The keyboard is much easier to use / harder to screw up.
In sublime/vscode/atom, you can also highlight word with ctrl+d and repeatedly press it to highlight the next instance of that word and drop another cursor there. Itās very handy!
They also have functions like ctrl+shift+down/up-arrow to drop a new cursor on the next/previous line in the same column. Doing that then doing ctrl[+shift]+left/right to move/select by word is the best!
Lack of this feature is really holding obsidian back as a āgo-toā powerful text editor.
+1 For this feature. It one of the main reasons I open up text in VSCode to edit it
+1 a super useful feature in Sublime
+1 - this would be really helpful
+1 - yes, please!
+1 here too
And Iād love to be able to change the default shortcut for multi cusor too.
I was so happy to see Multiple Cursors as an option! This is awesome!
With that said, before I found that I was using Sublime Text back and forth to do big changes because I didnt know I could do the multiple cursors since it uses a non-conventional approach.
I would love to have some Sublime Text stuff like
- Alt+F3 to select all entries of a string.
- Ctrl+Shift+L to add a cursor at the end of every selected line.
- Ctrl+D to select the next entry of a string in the file.
I would love to have all 3 of these but I think Alt+F3 and Ctrl+Shift+L would be the most important functions for me.
Obsidian is already great but this would make if freaking DOPE!
I agree! I keep flipping to Sublime Text to use the keyboard shortcuts for multiple selection.
For reference, hereās what Sublime Text offers:
https://www.sublimetext.com/docs/multiple_selection_with_the_keyboard.html
Of these, the most important for me are:
- Add a line above or below the current cursor/selection
- Add the next occurrence of the current word to the selection
- Add all occurrences of the current word to the selection
Agreed, this is on of the only annoying things about writing in Obsidian.
Good news!
I came across this thread while I was researching for my multi-cursor plugin (personally my pain point was that once you create a multi-selection, you canāt click on it again to deselect).
Since I was feeling groovy, I added the basic sublime text keyboard shortcuts too:
- Ctrl-D: Select next occurrence of selected word
- Ctrl-Alt-Up: Add a cursor to the line above
- Ctrl-Alt-Down: Add a cursor to the line below
Iām just investigating how to publish it, but if youāre interestedā¦
At some point Iāll look at adding the āselect all occurrences of selectionā and āmove every cursor to the end of the lineā too
Iāll post again when itās published!
Also gonna plugin my plugin here: Advanced Cursors can do some of these things and more!
Haha, I saw your plugin just as I was publishing mine!
By the looks of it yours is capable of much more advanced functionality. If you were to steal the āClick to de-selectā functionality from mine I would probably just use yours instead .
Also, in case you didnāt know (or maybe you donāt want to add them), you can supply default keybindings to your commands like this:
this.addCommand({
id: "add-cursor-to-prev-line",
name: "Add New Cursor to Previous Line",
editorCallback: ...
hotkeys: [
{
modifiers: ["Ctrl", "Alt"],
key: "ArrowUp",
},
],
});
Haha I really want to add that functionality I read over your code a bit, and it seems we are approaching it in relatively different ways (as different as can be for two plugins using the editor
).
I think I will add click-to-deselect to mine, just to have it all in one place.
Yeah, I prefer not to set default hotkeys, as they may conflict with existing ones
Sweet! Iāll pull my one out. Makes sense that mine is a bit different as I just hacked away at it until it worked. I suppose when some better docs come out things will probably standardize a bit.
Itās great to see so many options for working with multiple cursors. Still, it doesnāt look like any of these address OPās āmulti-cursor select with keyboardā yet. Is it possible some way?
Big YES
This is just the thing I need for āput a cursor at the end of all selected lines.ā
Is there something I can use for an equivalent to vscodeās āselect all occurrences of current selectionā? When writing, I find this invaluable for quickly renaming something in a longer note.
+1 for this feature