changing multiple things on one line in vi

Matt Alexander lowbassman at gmail.com
Fri Aug 19 14:58:13 MST 2005


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





More information about the PLUG-discuss mailing list