Article View: comp.editors
Article #2575Re: VI - finding lines longer than 80 characters
From: Jeff Wang
Date: Fri, 20 Nov 1992 14:48
Date: Fri, 20 Nov 1992 14:48
32 lines
1943 bytes
1943 bytes
night@acm.rpi.edu (Trip Martin) writes:
|> keithv@cory.Berkeley.EDU (Keith Vetter) writes:
|>>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.
|>
|> If you just want to print them out, you can use:
|>
|> :g/.\{81,\}/p
|>
|> Unfortunately, the \{n,m\} construction doesn't work in search mode.
Try this.. Open up a new line (o) and enter the following keystroke sequence -
/<Esc>81a.<Esc>"ddd@d
This will generate the following on the new line -
/.................................................................................
delete the line to buffer d, and execute it to find the next 81-character
sequence. You can then use n/N to keep searching for other lines. You'd have
to expand your tabs to spaces though.
--
#====}==) #===(==} #====}==) #===(==} {==)===# (=={====# {==)===# (=={====#
>> Jeff Wang Net : hjiwa@gruc19.nor.chevron.com <<
>> Chevron Petroleum Technology Company Profs : hjiwa (hovmb) <<
>> Geophysical/Geological Applications Phone : (504) 592-6162 <<
>> 935 Gravier Street, Room 1006 Fax : (504) 592-6958 <<
>> New Orleans, Louisiana 70112 Valeo,vales. Die dulci fruimini!! :) <<
#====}==) #===(==} #====}==) #===(==} {==)===# (=={====# {==)===# (=={====#
Technical Details
Message-ID:
<1992Nov20.084842@gruc19.nor.chevron.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!lhdsy1!nntpserver.chevron.com!gruc19.nor.chevron.com!hjiwaReferences:
<1992Nov20.005343.807@pasteur.Berkeley.EDU> <#nz10s#@rpi.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!lhdsy1!nntpserver.chevron.com!gruc19.nor.chevron.com!hjiwa From: hjiwa@gruc19.nor.chevron.com (Jeff Wang) Newsgroups: comp.editors Subject: Re: VI - finding lines longer than 80 characters Message-ID: <1992Nov20.084842@gruc19.nor.chevron.com> Date: 20 Nov 92 14:48:42 GMT References: <1992Nov20.005343.807@pasteur.Berkeley.EDU> <#nz10s#@rpi.edu> Sender: news@nntpserver.chevron.com (USENET News System) Organization: Chevron Petroleum Technology Company Lines: 32