Given:
https://stackoverflow.com/questions/ask
From normal mode at the first character, typing in qaqqaf/xb@aq@a
clears all of the forward slashes.
- qaq clears the a register
- qa starts recording to a
- f/x deletes the next forward slash
- @a re-runs the macro
- q ends the recording
But running normal qaqqaf/xb@aq@a
stops after b -- it seems to bail at the recursive call. The same happens if you try to use map the command.
Is there something wrong with my syntax? Or is it impossible to record a recursive macro with normal
?
Note: I know it's possible to write a recursive macro with let
. I'm wondering if this is the only way to write a recursive macro without recording it manually:
let @a = "f/xb@a"
normal @a
(I ask because of this answer: Remove everything except regex match in Vim )