vim find and replace command looks as follows:
:%s/one/two/g
Looks for 'one' and changes it to 'two' in the whole file
:%s/one/two/gc
Searches strings 'one' and replaces with 'two'. 'c' option means that vim is asking for confirmation first.
:%s/one\/two/gc
This command is changing 'one' to 'two' only if word 'one' matches completely
:%s/one/two/gi
Substitutes 'one' with 'two' with case insensitive option
:%s/one/two/gI
Find and replaces 'one' with 'two' with case sensitive option
No comments:
Post a Comment