Dup Goto 📝

Execute Macro in All Buffers

PT2/editor/vim/macros vim macro 02-12 01:10:18
To Pop
27 lines, 68 words, 357 chars Monday 2024-02-12 01:10:18
:argdo execute "normal @a"

Example: prepend license

Record a macro a that does

:0r license.txt
:w

then

:args *.c

and either

:argdo execute "normal @a"

or

:argdo normal @a

and the macro will be executed for each file. The execute variant allows us to use the | to do

:argdo execute "normal @a" | write