vim find and replace command looks as follows:
:%s/one/two/gLooks for 'one' and changes it to 'two' in the whole file
:%s/one/two/gcSearches 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/giSubstitutes '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