Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!usc!wuarchive!uunet!maverick.ksu.ksu.edu!unmvax!crowley From: crowley@unmvax.cs.unm.edu (Charlie Crowley) Newsgroups: comp.editors Subject: Re: Global Empty Line Removal in vi? Message-ID: <1991Jan24.163844.7521@unmvax.cs.unm.edu> Date: 24 Jan 91 16:38:44 GMT Sender: crowley@unmvax.cs.unm.edu (Charlie Crowley) Organization: University of New Mexico Lines: 19 In <1991Jan24.064310.8077@midway.uchicago.edu> zi0h@quads.uchicago.edu (W. Ishii) writes: > >Hello there! As a vi novice (maybe a stronger term is called for--vi idiot, >probably), I've been stuck for about a week now trying to figure out how to >globally remove multiple blank lines from text. Another solution is to use the regular expression capabilities of the ex/ed editor underlying vi. To wit: :g/^$/d That is, ':' to signal an ex command, 'g' do this globally, '/^$/ for all blank lines (that is, lines whose beginning (^) and end ($) are right together), 'd' deleted the line Charlie Crowley University of New Mexico