Skip to content

Latest commit

 

History

History
16 lines (10 loc) · 313 Bytes

search-and-replace.md

File metadata and controls

16 lines (10 loc) · 313 Bytes

Search and replace

The :substitute command searches for a text and replace it with a another text.

Find each occurrence of foo (in all lines), and replace it with bar:

:%s/foo/bar/g

Change each foo to bar, but ask for confirmation first:

:%s/foo/bar/gc