4 ms·
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
by iamevn 5y ago
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
- chrismorgan 5y agoOpen 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.
- gen220 5y agoNot 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.