kevin@ttidca.TTI.COM (Kevin Carothers) (03/21/89)
>In article <960@myrias.UUCP> dbf@myrias.UUCP (David Ferrier) writes: >>Thanks for posting an ingenious and elegant solution. > >Another article already posted a better solution so I won't repeat it. > >>It also highlights the problem that in vi there is no EASY, OBVIOUS way >>to delete a large block of text. For dozens of other editors, >>the procedure is "Just Say Delete". When vi also becomes user-friendly, >>clearly documented, and easy to use, please post. > > >There are objects w (for word), G (for last line of file), 'a (for >place marked a), G (for last line of file), ) (for sentence), } (for >paragraph), etc. These objects can take counts too. > >If you want to delete the next 3 paragraphs, you type d3}. What could >be easier? If you want to delete to the end of file, you type dG. Not >very difficult at all and clearly documented. We appear to be rambling on many different questions in this discussion. I know its uncool to follow-up my own follow up, BUT, as *I* remember, the question was about how to avoid "counting" lines of text. NOT how to delete lines. The only way I know how to count lines is to pipe the UNIX "wc" command with the " !" operator from Vi. If anyone knows any other way to do this, then please post. It also looks like we're now on the subject of Vi documentation. The only $0.02 I can add on this is that the best book I've seen on this is Introducing the UNIX System H. McGilton/Rachel Morgan McGraw Hill/ISBN 0-07-045001-3 Its (now) a little outdated, but it gives you a lot of neat tricks on how to pipe commands, cut/paste, Set up cursor movement for different languages, etc... Hope this helps ========================================================================= Kevin Carothers !{csun,psivax,rdlvax}!ttidca!kevin :wq!
badri@valhalla.ee.rochester.edu (Badri Lokanathan) (03/21/89)
In article <4086@ttidca.TTI.COM> kevin@ttidcb.tti.com (Kevin Carothers) writes: >It also looks like we're now on the subject of Vi documentation. > >The only $0.02 I can add on this is that the best book I've seen on this is > Introducing the UNIX System > H. McGilton/Rachel Morgan > McGraw Hill/ISBN 0-07-045001-3 > >Its (now) a little outdated, but it gives you a lot of neat tricks >on how to pipe commands, cut/paste, Set up cursor movement for different >languages, etc... > There is a good amount of vi documentation available. Here are a couple, taken from the C/UNIX Order form in the back of K & R II ed.: (1) vi User's handbook, Bolsky ISBN 013-941733-8, $18.95 paperback (2) Guide to vi, Sonnenschein ISBN 013-371311-3 $19.95 paperback Personally I am quite satisfied with the original documents on vi and ex by Bill Joy (who, apparently drives a Ferrari :-) and Mark Horton. This document, along with the ex reference manual is supplied with most manuals from Berkeley (we have the Mt. Xinu release.) Now for some irony: any documentation on emacs listed on this order form (no prizes for the correct guess.) -- "I care about my fellow man {) badri@ee.rochester.edu Being taken for a ride, //\\ {ames,cmcl2,columbia,cornell, I care that things start changing ///\\\ garp,harvard,ll-xn,rutgers}! But there's no one on my side."-UB40 _||_ rochester!ur-valhalla!badri
les@chinet.chi.il.us (Leslie Mikesell) (03/24/89)
In article <4086@ttidca.TTI.COM> kevin@ttidcb.tti.com (Kevin Carothers) writes: > >I know its uncool to follow-up my own follow up, BUT, as *I* remember, >the question was about how to avoid "counting" lines of text. NOT how to >delete lines. The only way I know how to count lines is to pipe the UNIX >"wc" command with the " !" operator from Vi. If anyone knows any other way >to do this, then please post. How about: (a) :set nu or (b) use ^g to get the line numbers of the start and end lines and subtract them or (c) (to get an actual count) go to the beginning of the range and use :.,/pattern/d where pattern will make its first match on the end line of the range The range will be deleted and the number of lines will be displayed. If you didn't want the range deleted, just undo it as the next step. Les Mikesell