Skip to content


Vim Search and Replace

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: 6% [?]

Posted in Snippets.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.