Re:Vimconf 2021 – Oct 29, 30
by iamevn on Friday October 29, 2021 @10:52PM
(#29045604)
What do you do when you solve a problem with a macro and then find that you need to do that a bunch more across other files? Using vim non-interactively always feels awkward
[ Parent
| on HN ]
Re:Vimconf 2021 – Oct 29, 30
by chrismorgan on Friday October 29, 2021 @11:11PM
(#29045681)
Open all the files in Vim either by starting that way or with something like :args, then :bufdo normal @@ to execute the most recently executed macro on all buffers.
On occasions when I’m doing things more iteratively (because I’m using a few macros and personal judgement), I commonly end up with :wn<Enter> in one of the macros.
Not sure if this is rhetorical, but you can (1) use rg -l to open a bunch of files in vim (2) qq make change, select next pattern, esc. (3) qr 100@q :bufferdelete esc (4) 100@r
If it’s a simple replace symbol, its easier to do it with rg -l and sed -i, of course.