Vim Search and Replace

by damonp on March 3, 2006

From the Vim help:

:[range]s[ubstitute]/{pattern}/{string}/[&][c][e][g][p][r][i][I] [count]

For each line in [range] replace a match of {pattern} with {string}.
{string} can be a literal string, or something special; see ¦sub-replace-special¦.
When [range] and [count] are omitted, replace in the current line only.
When [count] is given, replace in [count] lines, starting with the last line in [range]. When [range] is omitted start in the current line.
Also see ¦cmdline-ranges¦.
See ¦:s_flags¦ for the flags.

Popularity: 2% [?]

Leave a Comment

Previous post:

Next post: