[comp.editors] vi help

como@bnlux0.bnl.gov (Andrew Como) (12/18/88)

	Can anyone out there tell me if there is a way
to delete a region  as opposed to deleting by line numbers
when using "vi".

	Really appreciate the help

-- 
		como@bnlux0.bnl.gov
BITNET:		como@bnlux0.BITNET
UUCP:		....philabs!sbcs!bnl!como

malpass@vlsi.ll.mit.edu (Don Malpass) (12/20/88)

In article <707@bnlux0.bnl.gov> como@bnlux0.bnl.gov (Andrew Como) writes:
>
>	Can anyone out there tell me if there is a way
>to delete a region  as opposed to deleting by line numbers

For me the easiest way is to "mark" the top or bottom line, which is
done for example by entering "ma" to mark the line with marker 'a';
then move to the other line that bounds the region and enter "d`a"
(that's a LEFT single quote in front of the a ) which tells vi to delete
everything to marker 'a'.  You're allowed 26 markers (a through z,
naturally), and markers are really handy.  If you simply want to return
to the line you've previously marked with a "mz", simply type `z and
you'll be there.  As a special case, typing `` (TWO left single quotes)
will take you back to the line IMplicitly marked as the "last line you
touched", which often takes you to something you want to return to but
didn't mark explicitly.  All this stuff is very handy for cut and paste
operations.
-- 
Don Malpass   [malpass@LL-vlsi.arpa],  [malpass@gandalf.ll.mit.edu] 
  I've been watching Massachusetts politicians for so long that
    I'm starting to feel like a proctologist.

dbf@myrias.UUCP (David Ferrier) (12/22/88)

:/start/;/end/d 

will delete a set of lines by content, 
starting with the next line containing *start* 
and ending with the first line after that containing *end*.
-- 
David Ferrier                            Edmonton, Alberta
alberta!myrias!dbf                       (403) 428 1616