I have a macro that looks like:
:reg a
Type Name Content
c "a /^where^MkV%yGo^M-- Some typing...:^[pVG:!/tmp/t.sh^M
It works fine from any starting position in the file when I replay it with @a
but attempting to execute it with :bufdo normal @a
seems to just enter visual mode randomly and then stop. Trying :bufdo execute "normal @a"
seems to be half working and half broken (a bunch of random bits of the file get pasted as well).
How can I reliably run an arbitrary macro over a set of files? How can I debug this, and what might be going wrong?
where
starts with a bracket (such as{
) that is unmatched (by a}
in that case.) In that situation, the%
command seems to fail and interrupt the macro and that leaves it in the visual line that was started just before that command. Do you think it's possible that that's what's causing the issue for you? In the buffer that this is failing, if you execute it normally with@a
at the top, do you see the same behavior? Can you share a snippet of that buffer?bufdo
. I ran neovim with the--noplugin
flag and it worked perfectly, so it appears that one of my plugins was affecting the execution.