Vi/Vim: search and replace.

  • Search and replace strings in vi/vim..

To repl [old_string] with [new_string]...


:%s/[old_string]/[new_string]/gc



'g' option is for global, 'c' option is for vi/vim to ask for confirmation for every matched string.

References:
http://vim.wikia.com/wiki/Search_and_replace

- _

Add Comment

Sorry you must log in first to be able to add a comment. Click here to log in.
*/ ?>