Hacker News new | ask | show | jobs
by msravi 606 days ago
You don't need more than one cursor in vim:

https://medium.com/@schtoeffel/you-don-t-need-more-than-one-...

But if you really want it:

https://github.com/mg979/vim-visual-multi

3 comments

I really love working in neovim but this is a frustrating position that much of the community has taken. Editing multiple sites _simultaneously_ is nowhere as intuitive as with VS Code and IntelliJ/Sublime before it.

- Repeat - `.` - is ok for some bulk manipulations but in my opinion it's not as nice because it's after the fact. I like that in VSC I select all the occurrences I want to edit first and then if the selections match my expectations I go ahead.

- Visual mode only lets you work vertically in a contiguous block of text. That's not the same or as convenient as multi-cursor in VSCode where I can select the word "const" for example and ⌘-D to select more occurrences of it anywhere in the buffer, not just above/below, and bulk edit them to "let".

- Macros are often what I lean and they can do far more than multi-cursor editing could but they are far more tedious to string along and repeat when all I want is to change some text in multiple locations.

- Text replacement (sed) is also fine but not as convenient in my opinion.

Either way, neovim will be getting native multi-cursor support and I'm very excited about that because I'm not particularly fond of VS Code (in terms of perf/resource usage) but I recognise (neo)vim doesn't have a monopoly on good ideas.

There's also vis[0]

It is an editor that combines best parts from vim and plan9 sam[1] (multiple cursors, structural regular expressions).

0 - https://github.com/martanne/vis

1 - https://en.wikipedia.org/wiki/Sam_(text_editor)

I may not need it, but every operation they demonstrated is significantly slower than using multiple cursors, so I definitely want it.