Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!ucsd!mvb.saic.com!ncr-sd!iss-rb!booboo!davel From: davel@booboo.SanDiego.NCR.COM (David Lord) Newsgroups: comp.editors Subject: Re: vi delete to # Message-ID: <1990Nov30.220243.16988@SanDiego.NCR.COM> Date: 30 Nov 90 22:02:43 GMT References: <1990Nov21.025246.8298@mthvax.cs.miami.edu> <154293@felix.UUCP> Sender: hdf1@SanDiego.NCR.COM (Harold Ferrari) Reply-To: davel@booboo.SanDiego.NCR.COM (David Lord) Distribution: na Organization: NCR Corporation, Rancho Bernardo Lines: 24 >In article <1990Nov21.025246.8298@mthvax.cs.miami.edu> wb8foz@mthvax.cs.miami.edu (David Lesher) writes: >> I'm looking for a macro that would delete to a given line >> number. For example: You are editing a file, and are on line 5. >> You want to delete everything up to line 17. Now of course, you >> can subtract in your head, and use a 12dd. But my view has always >> computers are supposed to do those things for me! >> >> Any suggestion on a "delete to {or delete through} line #" macro? Don't need a macro to do this, the feature is built into vi already; dG will delete from the current line to line which can be before or after the line you are on. dG deletes from current line to end of file. d1G deletes from current line to line one. d250G deletes from current line to line 250. Alternatively you can use: :,d and replace the appropriate with '.'. -- Dave Lord