Article View: comp.editors
Article #3461Re: VI documentation (was: Vi bashing)
From: Leslie Mikesell
Date: Thu, 23 Mar 1989 22:10
Date: Thu, 23 Mar 1989 22:10
19 lines
1395 bytes
1395 bytes
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
Technical Details
Message-ID:
<8004@chinet.chi.il.us>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!ukma!tut.cis.ohio-state.edu!rutgers!att!chinet!lesReferences:
<587@alice.marlow.uucp> <4048@ttidca.TTI.COM> <960@myrias.UUCP> <21985@shemp.CS.UCLA.EDU> <4086@ttidca.TTI.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!ukma!tut.cis.ohio-state.edu!rutgers!att!chinet!les From: les@chinet.chi.il.us (Leslie Mikesell) Newsgroups: comp.editors Subject: Re: VI documentation (was: Vi bashing) Message-ID: <8004@chinet.chi.il.us> Date: 23 Mar 89 22:10:46 GMT References: <587@alice.marlow.uucp> <4048@ttidca.TTI.COM> <960@myrias.UUCP> <21985@shemp.CS.UCLA.EDU> <4086@ttidca.TTI.COM> Reply-To: les@chinet.chi.il.us (Leslie Mikesell) Organization: Chinet - Public Access Unix Lines: 19