🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.editors
Article #2638

Re: VI - finding lines longer than 80 characters

#2638
From: DWT
Date: Sat, 21 Nov 1992 19:15
23 lines
1483 bytes
In article <1992Nov20.005343.807@pasteur.Berkeley.EDU>
keithv@cory.Berkeley.EDU (Keith Vetter) asked:

>In VI, is there an easy way to find all lines whose length
>is greater than 80 characters?  I realize tabs are a problem but
>let's assume that there are no tabs.

"Easy" is such a subjective term.  I make do with this two-fork hack: a
restaurant critic would give it fewer.

:w !cut -c81- | grep -n .

(where the period is a regexp for "any character except newline" and not end
punctuation), though even eighty characters (because an eighty-character line
on an eighty-column screen causes a cursor jump and an empty screen line) are
too many for my purposes and I usually use "79" in that formula rather than
"81".

It's ugly, but it beats the hell out of typing eighty-one periods in a search
pattern.

David W. Tamkin   P. O. Box 59297   Northtown Station, Illinois  60659-0297
dattier@{holonet.net|gagme.chi.il.us}  CIS: 73720,1570   MCI Mail: 426-1818
Technical Details
Message-ID: <By2yuM.6zJ@iat.holonet.net>
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!agate!iat.holonet.net!dattier
References: <1992Nov20.005343.807@pasteur.Berkeley.EDU>

Show Full Headers
Complete Article Headers
Newsgroups: comp.editors
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!agate!iat.holonet.net!dattier
From: dattier@orac.holonet.net (DWT)
Subject: Re: VI - finding lines longer than 80 characters
Message-ID: <By2yuM.6zJ@iat.holonet.net>
Sender: usenet@iat.holonet.net (USENET News System)
Nntp-Posting-Host: holonet.holonet.net
Organization: Information Access Technologies, Inc. of Berkeley, CA
References: <1992Nov20.005343.807@pasteur.Berkeley.EDU>
Date: Sat, 21 Nov 1992 19:15:57 GMT
Lines: 23