Search and replace in vi / vim


vi search and replace: (in command mode)

The following strings illustrate how to perform a search and replace in the Unix vi editor.


Replace EOL (end of line)


where $ is EOL and \t = a tab

The start of line can be equally easily searched and replaced – using the carat ^ symbol.