home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / editors / 2823 < prev    next >
Encoding:
Internet Message Format  |  1992-11-20  |  1.9 KB

  1. Path: sparky!uunet!lhdsy1!nntpserver.chevron.com!gruc19.nor.chevron.com!hjiwa
  2. From: hjiwa@gruc19.nor.chevron.com (Jeff Wang)
  3. Newsgroups: comp.editors
  4. Subject: Re: VI - finding lines longer than 80 characters
  5. Message-ID: <1992Nov20.084842@gruc19.nor.chevron.com>
  6. Date: 20 Nov 92 14:48:42 GMT
  7. References: <1992Nov20.005343.807@pasteur.Berkeley.EDU> <#nz10s#@rpi.edu>
  8. Sender: news@nntpserver.chevron.com (USENET News System)
  9. Organization: Chevron Petroleum Technology Company
  10. Lines: 32
  11.  
  12. night@acm.rpi.edu (Trip Martin) writes:
  13. |> keithv@cory.Berkeley.EDU (Keith Vetter) writes:
  14. |>>In VI, is there an easy way to find all lines whose length
  15. |>>is greater than 80 characters?  I realize tabs are a problem but
  16. |>>let's assume that there are no tabs.
  17. |> 
  18. |> If you just want to print them out, you can use:
  19. |> 
  20. |> :g/.\{81,\}/p
  21. |> 
  22. |> Unfortunately, the \{n,m\} construction doesn't work in search mode.
  23.  
  24. Try this..  Open up a new line (o) and enter the following keystroke sequence -
  25.  
  26. /<Esc>81a.<Esc>"ddd@d
  27.  
  28. This will generate the following on the new line -
  29.  
  30. /.................................................................................
  31.  
  32. delete the line to buffer d, and execute it to find the next 81-character
  33. sequence.  You can then use n/N to keep searching for other lines.  You'd have
  34. to expand your tabs to spaces though.
  35.  
  36. -- 
  37.  #====}==) #===(==}  #====}==) #===(==}  {==)===# (=={====#  {==)===# (=={====#
  38. >> Jeff Wang                             Net   : hjiwa@gruc19.nor.chevron.com <<
  39. >> Chevron Petroleum Technology Company  Profs : hjiwa (hovmb)                <<
  40. >> Geophysical/Geological Applications   Phone : (504) 592-6162               <<
  41. >> 935 Gravier Street, Room 1006         Fax   : (504) 592-6958               <<
  42. >> New Orleans, Louisiana 70112          Valeo,vales. Die dulci fruimini!! :) <<
  43.  #====}==) #===(==}  #====}==) #===(==}  {==)===# (=={====#  {==)===# (=={====#
  44.