1,$s / searchstring / replacestring /g
starts from the first byte until eof en does a global search
or
g/ searchstring / s// replacestring / g
Watch out for searching single words or space-containing strings
<cat...@hotmail.com> schreef in bericht
news:3c1Ea.4721...@fe04.atl2.webusenet.com...
:1,$s/string1/string2/g
If you want to be selective in your replaces then doing the following:
/string1
cw
string2
<ESC>
n
.
Use the next to last line to keep finding occurences of string1 and the last
line to do a replacement.
Anne Tuchscherer
Medstar Health
The short form for "The Entire Address Space" is %. % matches 1,$,
which is read "start, finish" so you can also do fun things like 1,.
(top of file to current line), .,$ (current line to end of file), and
.-5,.+4 (five lines before here, four lines after here).
The address space area is often overlooked, or people write it as 1,$
without knowing what it means or how it can be used. No slight
intended, but I wanted others to see how versatile it could be.
For the whole file, use %, eg: :%s/string1/string2/g
-dwiv, CATE/AIX