multi-line edit in vi

John M. Anderson sontek at gmail.com
Wed Apr 9 11:02:28 MDT 2008


On Wed, 2008-04-09 at 10:37 -0600, Wade Preston Shearer wrote:
> Is it possible to multi-line edit in vi?
>

What do you mean by this?  Execute the same command on multiple lines
(like a search and replace)?  If so yes, There are lots of ways to do
this...  The first way is to do is use CTRL+V to move down all the lines
you want to edit and then type shift+I, and then after you edit the
first line it'll run the exact same command(s) on all the other lines.

Another way to do search/replace functionality is shift+V to make a
visual selection and then type :s/find/replace/g  and it'll only run on
your visual selection (as long as you leave in the '<,'> section).

Hope this is what you were wondering.

John



More information about the PLUG mailing list