Re: changing multiple things on one line in vi

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Randy Melder
Date:  
To: Main PLUG discussion list
Subject: Re: changing multiple things on one line in vi
Simply place the cursor on the line that needs multiple replacements and...
:s/images/pictures/g

notice, there's no % ... that limites it to the current line only.

:s/son.gif/daughter.gif/g

:s/original/replace/g

Hope this helps!

; ) .randy


On 8/19/05, Matt Alexander <> wrote:
> MCR wrote:
>
> >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
> >
> >
> >
>
> Instead of %s, use just the line number you want to edit. So, to change
> only line 34...
>
> :34s/images/pictures/g
>
>
>
> ---------------------------------------------------
> PLUG-discuss mailing list -
> To subscribe, unsubscribe, or to change you mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>



--

..::Randy Melder::..
http://www.spininternetmedia.com
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss