Re:Neovim 0.5 is overpowering
by devnonymous on Wednesday May 26, 2021 @03:47PM
(#27295182)
I always find it strange that people recommend a different letter for the register when recommending macros. Why not just use `qq` and `@q` (with the added advantage that clearing the register is `qqq`) ?
The reason I don’t use q is it’s far too easy for me to accidentally hit a 3rd q when I didn’t intend to and not even realize it.
This was a bigger problem when Apple decided to go with those butterfly keys.
Re:Neovim 0.5 is overpowering
by michaelmior on Wednesday May 26, 2021 @12:56PM
(#27293016)
> multi cursors only work for tabular data
There are several plugins which allow for more complex use of multiple cursors.
I did record it with qd...q and repeated it with @d @@
Re:Neovim 0.5 is overpowering
by isaacremuant on Wednesday May 26, 2021 @02:55PM
(#27294596)
Visual select and normal@t (assuming you saved it in t) is a good way to do it once for every line.
Re:Neovim 0.5 is overpowering
by continuational on Wednesday May 26, 2021 @02:10PM
(#27294009)
Nope, you can do find > select all to get multiple selections and edit those simultaneously.
Re:Neovim 0.5 is overpowering
by ThatGeoGuy on Wednesday May 26, 2021 @05:28PM
(#27296347)
This can be done in (neo)vim too, and with a bit better precision and less typing.
:g/<regex>/<command>
is the general form for [g]rabbing lines that match a regex and applying a command over them. You can also chain the command:
:g/<regex1>/g/<regex2>/<command>
I'll admit this isn't exactly something you intuit as easily as a drop-down menu, but (neo)vim does have tools for all these things out of the box.
Re:Neovim 0.5 is overpowering
by chrismorgan on Wednesday May 26, 2021 @09:26PM
(#27298305)
Huh, somehow it’s never occurred to me to get binary logic by chaining :g and :v in this way—I’ve always done things in more complicated ways to make up for the lack.
Multiple cursors is for quick small editing tasks where you don't bother with a macro.
Re:Neovim 0.5 is overpowering
by JamesSwift on Thursday May 27, 2021 @09:24AM
(#27302769)
You probably are familiar, but for some newer folks: I almost always add a "go to beginning of next line" as the end of the macro so that I can e.g. 10@t to repeat it 10 times. Makes it much quicker than @t on each line once you have more than a few.
You don't have to learn command. You simply need to know how to edit with VIM.
And multi cursors only work for tabular data. The macro recordings can work for the entire document where you call a macro on a word/regex you searched for, for example.