I scoured through the help, looking in a multitude of places I
deemed sensible, and couldn't find anything documented either.
Thanks, Tim, for confirming this feature.
Bram, could you please add a note to the help for ':s' that
documents this feature?
I thought this was explained somewhere, but I can't find it. I'll add a
remark below the explanation of an empty pattern.
I'm sure I've seen it in the past as well, but couldn't find it
either. Perhaps something directly in the help for ":s"
:[range]s[ubstitute]/{pattern}/{string}/[flags] [count]
For each line in [range] replace a match of
{pattern} with {string}.
For the {pattern} see |pattern|.
{string} can be a literal string, or something
special; see |sub-replace-special|.
as the help already describes that {string} can be "something
special", it's not a far stretch to also note that
1) with no [flags], the trailing slash can be omitted
2) with no {pattern} and no [flags], both trailing slashes can be
omitted.
This might also be visually indicated in the "definition" line
with something like
:[range]s[ubstitute]/{pattern}[/{string}[/[flags] [count]]]
to show that the "/[flags]" portion and the "/{string}/[flags]"
portions are optional.
Just a few ideas,
-tim