home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / editors / 2847 < prev    next >
Encoding:
Text File  |  1992-11-22  |  1.4 KB  |  36 lines

  1. Newsgroups: comp.editors
  2. Path: sparky!uunet!spool.mu.edu!agate!iat.holonet.net!dattier
  3. From: dattier@orac.holonet.net (DWT)
  4. Subject: Re: VI - finding lines longer than 80 characters
  5. Message-ID: <By2yuM.6zJ@iat.holonet.net>
  6. Sender: usenet@iat.holonet.net (USENET News System)
  7. Nntp-Posting-Host: holonet.holonet.net
  8. Organization: Information Access Technologies, Inc. of Berkeley, CA
  9. References: <1992Nov20.005343.807@pasteur.Berkeley.EDU>
  10. Date: Sat, 21 Nov 1992 19:15:57 GMT
  11. Lines: 23
  12.  
  13. In article <1992Nov20.005343.807@pasteur.Berkeley.EDU>
  14. keithv@cory.Berkeley.EDU (Keith Vetter) asked:
  15.  
  16. >In VI, is there an easy way to find all lines whose length
  17. >is greater than 80 characters?  I realize tabs are a problem but
  18. >let's assume that there are no tabs.
  19.  
  20. "Easy" is such a subjective term.  I make do with this two-fork hack: a
  21. restaurant critic would give it fewer.
  22.  
  23. :w !cut -c81- | grep -n .
  24.  
  25. (where the period is a regexp for "any character except newline" and not end
  26. punctuation), though even eighty characters (because an eighty-character line
  27. on an eighty-column screen causes a cursor jump and an empty screen line) are
  28. too many for my purposes and I usually use "79" in that formula rather than
  29. "81".
  30.  
  31. It's ugly, but it beats the hell out of typing eighty-one periods in a search
  32. pattern.
  33.  
  34. David W. Tamkin   P. O. Box 59297   Northtown Station, Illinois  60659-0297
  35. dattier@{holonet.net|gagme.chi.il.us}  CIS: 73720,1570   MCI Mail: 426-1818
  36.