Better multi-cursor support (similar to VSCodeVim) to allow per-cursor motions
See original GitHub issueIt’d be wonderful is this extension could treat each cursor that is generated as its own “context”, and allow normal-mode to work with multiple cursors. I have no idea how complicated this would be to execute given the way that it is implemented, but let me explain.
Say I want to use VSCode’s built-in functionality to add a cursor below the current line while in normal
mode. This feels natural to me, and I use things like cmd+d
to add cursors to the next occurrence of a given word all the time (for example). When I have added all the cursors I want, my first thought is “okay time to do a motion”, so I execute something like ciw
. In VSCodeVim, this behaves as I expect, but in vscode-neovim, it does not.
Here are some gifs that explain things visually a lot better than I can via text. Here’s what happens in neovim:
And here’s what happens in VSCodeVim:
In order to get to what I think would be “good multi-cursor support”, I think that the following would probably need to happen:
- Figure out a way to make it so that if you have multiple cursors, the first instance of
ESC
is interpreted as “go into normal mode”. - When in normal mode + multiple cursors, treat each cursor independently, and send motions/commands to those cursors specifically. If I hit
ciw
(like I did in the gifs about) each cursor should interpret its “context” to execute the motion on the text it has
Lastly, I’d just like to note that this issue is pretty much the only thing keeping me on VSCodeVim at this point. Aside from that, I really like this extension’s implementation, and it has a ton of upsides in comparison to VSCodeVim’s “emulation-focused” approach (which requires re-inventing the wheel, which feels like an uphill battle). If this extension got first-class multi-cursor support, there’d be nothing holding me back from singing this extension’s praises and using it every single day.
Please let me know if you have any questions about the above details!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:14 (1 by maintainers)
Thanks trkoch, below is to replicate the functionality fully from
vim-visual-multi
in case anyone wants to copy and pasteFor anyone who wants to give
vim-visual-multi
in VSCode a try, make sure to add this to yourkeybindings.json
.However, I agree
vim-visual-multi
does not work optimal in VSCode and feels like a hack. I can see adding true multi-cursor support is a challenge and lets hope @asvetliakov finds the time to give it a try.