changing multiple things on one line in vi
MCR
mike1071 at yahoo.com
Fri Aug 19 14:27:49 MST 2005
This is along the line of a couple of posts today, so
I thought I would finally ask. When I have a document
open in vi, sometimes I would like to do a change and
have it apply to only one line, I know how to do it
globally, but I can not seem to find out how to do it
for just the one line. Example:
For global: say I have a html document and my image
directory is named "images". I decide to change the
name of the directory to pictures, I know to do this
for the whole document I do:
:%s/images/pictures/g
Now what I can not figure out is if I have the same
document, and on one line I have a file named son.gif
four times. I have the same file name through out the
document, but just on this one line I need to change
all four son.gif to daughter.gif. I do not know how
to do this. I have tried:
:%s/son.gif/daughter.gif <enter>
but this did not work. Could someone please offer
some insight on how to do this. It would save me a
lot of typing. Thank You in advance.
Mike
One is led to truth through the interpretation of a myth.
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs
More information about the PLUG-discuss
mailing list