This is the first post on the quickies category. Actually it is more like bookmarks to me but usefull quick tips for everybody (i know why not use some bookmarking site, well why not use my site :D).
If you want to replace an occurence of a string in vim to another then use:
:%s/foo/bar/g =
find each occurance of 'foo' and replace it with 'bar' without asking for confirmation
:%s/foo/bar/gc =
find each occurance of 'foo' and replace it with 'bar' asking for confirmation first
:%s/<foo>/bar/gc =
find (match exact word only) and replace each occurance of 'foo' with 'bar'
:%s/foo/bar/gci =
find (case insensitive) and replace each occurance of 'foo' with 'bar'
:%s/foo/bar/gcI =
find (case sensitive) and replace each occurance of 'foo' with 'bar'
Note that the replacement without the ‘g’ option will be done for the first occurence of the string to find. For a detailed help, while in vim, type ‘:help substitude’.
Just what I was looking for, thx.