Steve Holdoway wrote:

On Sun, 21 May 2006 15:25:04 +1200
Hadley Rich <[EMAIL PROTECTED]> wrote:

On Sunday 21 May 2006 15:18, Andy George wrote:
...in VI the editor-of-the-gods...

How do you do a word find/replace?
:%s/find/replace/g

Will replace find with replace in the whole document (%) and be greedy (g) i.e. replace more than one occurrence on a line.

Of course you are correct;

http://www.google.co.nz/search?q=vim+search+replace

could easily tell you as well.

hads

--
Make it idiot-proof, and someone will breed a better idiot.
                -- Oliver Elphick
... it'll replace every occurrence of the search string with the replaced 
string, which may be more than you want. For example, %s/Cant/Can/g will also 
convert Canterbury to Canerbury.

And the final peice of the puzzle is, if you want to match the token 'Cant' and not 'Canterbury',
you'll be needing

:%s/\<Cant\>/Can/g

Cheers, Rex

Reply via email to