While working through vimtutor, I tried a variant on
by leaving off the
and expected the substitution to only occur once in the whole file. After all, this mirrors the behavior of
:s/old/new, which operates on the current line and only substitutes once unless the
g flag is present.
:%s substitution command does seem to matter, as both variants operate many times on the whole file. Is this documented anywhere, and how do you make sense of this discrepancy?
I'm aware that I can replace just one instance anywhere in the file with
and decline the prompt after the first substitution. I'm seeking understanding on the non-interactive version without the