BSD
To perform a global search and replace in vi editor, use the search and replace command in command mode:
:%s/search_string/replacement_string/g
The % is a shortcut that tells vi to search all lines of the file for search_string and change it to replacement_string.