4
Substitute all matches in a line by default
mbadran posted this on April 18, 2012

set gdefault

When using the :substitute command (AKA :s), substitute all matches in a line instead of just the first.

The /g flag toggles this setting. Append /g to revert to the default behaviour, substituting the first match instead.

No comments found

Must be logged in to comment.