type: “:help substitute”, then press ctrl+D, to select help topic you want.
Usage: :[range]s[ubstitute]/{pattern}/{string}/[flags] [count]
useful ranges:
%: the entire file
useful flags:
g: replace all occurrence in the same line c: confirm before replacement
An example:
:%s/\<four\>/4/g
:%s/\<four\>/4/gc
Leave a comment