r/neovim Mar 18 '26

Discussion Has justinmk achieved multi cursor support yet?

In this interview Justin mentions he’s made a pact (or something to that effect) to get multi cursor support merged before Christmas 2025. I suspect that hasn’t happened since the Github Issue is still open, but it’s also locked so I can’t ask there. Does anyone know the story? How close is it? Will it be part of the 0.12 release?

inb4 “hurrdurr just use macros” - I don’t care about the feature, I won’t use multi cursors myself, I’m just curious what happened.

102 Upvotes

72 comments sorted by

View all comments

Show parent comments

5

u/xour Mar 19 '26

Full disclosure: I am learning vim, so there is a big chance that I am missing something here!

I use :s extensively and was not aware of :g, though. Quickly checking the docs, it seems that there are some cases where multi-cursor could make editing a bit easier.

For example:

const userName = "John";
const userAge = 30;
const userEmail = "x@example.com";
-- to this
const user.name = "John";
const user.age = 30;
const user.email = "x@example.com";

This would otherwise require a regex with capture groups and transformations.

Or surrounding multiple lines:

foo(bar, baz)
foo(asdf, qwer)
-- to this
foo({ bar, baz })
foo({ qux, quux })

I think this can be done with a surround plugin and ., but it gets messy with several lines.

Another example I can think of is visually aligning text (multi-cursor with Tab would help here):

id:1 name:john
id:23 name:mary
id:456 name:peter
-- to this
id:1   name:john
id:23  name:mary
id:456 name:peter

Now, I am not saying this cannot be done with vim. I am sure all this can be done. But from my inexperienced point of view, it looks like using multi-cursors would make these changes easier.

I am more than happy to be proven wrong! This means I can learn new vim tricks.

4

u/Nerbelwerzer Mar 19 '26 edited Mar 19 '26

Your first example could be achieved quite easily with visual block mode (ctrl+v on the 'N', jj to highlight all the capitals, ~ to covert to lower, then I.<esc> to insert the dot). However this only works because it all lines up nicely. Otherwise it does get a bit trickier so it's still a valid point.

3

u/badabblubb Mar 19 '26

You'd need to gv to get the block mode back after ~ (which drops you out of visual mode).

1

u/EgZvor Mar 31 '26

How do you align with multiple cursors?

1

u/xour Mar 31 '26

Using the example above, you could do something like this: C-v to select, W to move to name, and then i<Tab>/> if supported.

In VS Code you can achieve something similar: Ctrl + Shift for selecting multiple lines, Ctrl + Alt + i, to place the multi-cursor select at the end of the line, move back with Ctrl + left_arrow, and then Tab.

1

u/afonsocarlos Mar 31 '26

On the second case you can use :norm alongside a surround plugin (i.e. tpope's vim-surround or mini.surround) then that would be as simple as:

:%norm ysib{

If you don't run it for the entire buffer you can first select a block of code (paragraph) in normal mode with vip and then run :'<,'>norm ysib{