Vim Search and Replace

by damonp on March 3, 2006

in Snippets

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: 1%

Most Popular Posts

Damon Parker is a freelance sysadmin and web developer in Texas. He specializes in server setup, server security and high performance server configurations. Need help setting up a web server or getting a server back online after a crash or hack? Email Damon

Leave a Comment

Previous post:

Next post: