From the docs, the syntax of the :global command is:
:[range]g[lobal]/{pattern}/[cmd]
Execute the Ex command [cmd] (default ":p") on the
lines within [range] where {pattern} matches.
I've also come across such usages of :g:
:g/apples/+1,/peaches/ s/^/# /g
:g/start/+1,$ sort n
Does /apples/+1,/peaches/ here belong to the {pattern}? Where is this syntax documented?
I just found an explanation for this very usage of
:globalin Vim Tips Wiki:So
,/peaches/here defines a range for the substitution command. The somewhat confusing part (which i didn't find mentioned in the docs) is that the initial'.'is optional in a range. Adding it makes the command more obvious: