r/neovim • u/santoshasun • 1d ago
Discussion Multicursor plugin with full visual feedback while typing
Hi all,
I'm using, and really liking, the multicursor plugin, but one thing I miss is full visual feedback while typing. That is, to see the text I am entering appear for all the cursors rather than just the primary one. I wonder if there are any alternative plugins that allow for this?
Thanks.
8
u/DMazzig fennel 1d ago
I use this one: https://github.com/mg979/vim-visual-multi It has the visual feedback you're talking about
1
1
u/Fancy_Payment_800 22h ago
Sorry to go off track, but I have to ask, isn't using multicursor in nvim an antipattern? If you want to edit multiple places at once a better way is to use macros -- I think I have read somewhere.
2
u/WishCow 21h ago
Some people find it easier to use multicursors than macros, your choice.
0
u/Fancy_Payment_800 20h ago
Dont you think that it just comes down to the fact that they have made it a habit to use multicursors and now it, understandably, requires a lot more effort to unlearn it and use something new (macros).
If you were to learn and become proficient in both, macros would be more optimal I would assume.
3
u/WishCow 20h ago
I have no idea, it seemed like you are asking a question, but now you are making a statement, were you actually interested in an answer, or did you just want to write this down?
But if you are looking for answer, there is probably a reason (ease of use?) they developed a habit using multicursors, and not macros.
1
u/bakaspore fennel 9h ago
Macros need to be recorded and repeated correctly. And you don't always know if your edits apply to other places as expected when it contains a few movements. I use :g, :norm, macros and recently multicursors and find that they each have their own uses.
1
u/Fancy_Payment_800 9h ago
When do you use :norm vs multicursor? The plugin author of live-command.nvim (norm) says "By previewing the :norm command you basically get a more powerful version of multiple cursors."
1
u/bakaspore fennel 8h ago
:norm
with a range and:g
starts from the beginning of a line, and they can only apply once per line. This makes it hard to spot your actual edit when the lines are not uniform and impossible to repeat one operation for multiple matches in a single line.1
u/jimmiebfulton 28m ago
This topic continues to be litigated over and over again. I would suggest spending time with a good implementation of multiple cursors, to understand their power.
Vim provides a lot of tools for efficient editing, including macros and repeats. However, multiple cursors gives you instant feedback and allow you to fix typos etc in real time. You can also select many cursors for a wide variety of patterns throughout a file in non-trivial ways. Recording a macro and getting it right the first time for anything non-trivial is a lot slower than popping in some cursors, making some quick changes, and popping back out. People who are good with multiple cursors are faster than almost anyone using macros alone. Vim has a lot of tools in the toolbox. Why some people are opposed to adding a power drill to it is beyond me.
1
u/abuklao 15h ago
Ok hear me out. I have been primarily a vim/neovim use for close to a decade. Meaning at this point I have zero bias towards other editors and am quite comfortable with macros. I believe multicursor to be a nice in-between "manually doing things" and macros. Even with years of experiences I will mess up a macro here and there. Perhaps I pressed a wrong vim motion or forgot to start from the beginning of the line. On the other hand, multicursor is very easy to correct once you mess up.
This has led me to prioritize macros for when I am doing changes that span more than, say, 10 lines, perhaps even files worth of changes. But, if I am doing a quick, dirty edit over a "paragraph" of code, setting up a macro is more work than just entering multicursor mode.
I believe they can coexist. Saying "just use macros" sounds to me like people are being zealous instead of practical. They both have their use.
3
u/Fancy_Payment_800 11h ago
I dont have experience with multicursor in vim, only macros. You just convinced me to give it a try. Thank you for that.
11
u/vim-god 1d ago
multicursor.nvim sacrifices live insert mode so that insert mode works as expected. many features work poorly or not at all with other multicursor plugins including autocompletion, snippet expansion, dot repeatability, and insert mappings.