Global search & replace in Vim

Reza Beha reza_beha@yahoo.com
Thu, 14 Jun 2001 10:58:19 -0700 (PDT)


--0-531161184-992541499=:9372
Content-Type: text/plain; charset=us-ascii


Greetings, friends.

   I've been fruitlessly seeking a method for replacing every instance of a string in Vim, without needing to know a file length or row range.  The best I've come up with so far is:

:s/string1/string2/g xxx

  Where 'xxx' is the length of the file (like 317 lines, for instance).  What is the proper way to accomplish this?  Thanks in advance.

Migrating from VMS to Linux,

               Reza

 



---------------------------------
Do You Yahoo!?
Yahoo! Buzz Index - Spot the hottest trends in music, movies,and more.
--0-531161184-992541499=:9372
Content-Type: text/html; charset=us-ascii

<P>Greetings, friends.</P>
<P>&nbsp;&nbsp; I've been fruitlessly seeking a method for replacing every instance of a string in Vim, without needing to know a file length or row range.&nbsp; The best I've come up with so far is:</P>
<P>:s/string1/string2/g xxx</P>
<P>&nbsp; Where 'xxx' is the length of the file (like 317 lines, for instance).&nbsp; What is the proper way to accomplish this?&nbsp; Thanks in advance.</P>
<P>Migrating from VMS to Linux,</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Reza</P>
<P>&nbsp;</P><p><br><hr size=1><b>Do You Yahoo!?</b><br>
<B>Yahoo! Buzz Index</B> - Spot the hottest trends in <A
HREF="http://rd.yahoo.com/mail_us/tag/?http://buzz.yahoo.com/leaders/music/">music</A>, <A
HREF="http://rd.yahoo.com/mail_us/tag/?http://buzz.yahoo.com/leaders/actors_and_actresses/">movies</A>,
and <A HREF="http://rd.yahoo.com/mail_us/tag/?http://buzz.yahoo.com/movers/">more</A>.
--0-531161184-992541499=:9372--