vim Simple replacement


Example

:s/foo/bar Replace the first instance of foo with bar on the current line.

:s/foo/bar/g Replace every instance of foo with bar on the current line.

:%s/foo/bar/g Replace foo with bar throughout the entire file.