Wednesday, February 27, 2008

Search and replace in vi editor

seach and replace globally
:%s/old_text/new_text/g


search and replace interactively
:%s/old_text/new_text/c

search and replace a text in current line
:.s/old_text/new_text