Re: vi editor question
From: Robert Miller (rmiller_at_SMUD.ORG)
Date: 09/30/04
- Previous message: Leyden, Joseph: "Re: vi editor question"
- Maybe in reply to: Leyden, Joseph: "Re: vi editor question"
- Next in thread: Lamar Saxon: "Re: vi editor question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 30 Sep 2004 08:45:32 -0700 To: aix-l@Princeton.EDU
Find out the number of lines you want to delete (can do this by putting your cursor on a line and hitting ctrl-g to display the line number, then go to the first line you want to delete, hit ESC, and type the number of lines you want to delete, followed by 'dd' - like the following:
Say you had 100 lines you wanted to delete, starting at line 105...
Go down to line 105, quickest way is 105G (moves cursor to line 105), then 100dd.
NOTE that vi is case sensitive - the G and the dd do not necessarily mean the same as g and DD (probably mean something similar, but with very different results), so be careful of case.
Also note that the commands I listed above need to be entered when you're in command mode - in other words, the mode you're in when you hit ESC. The easiest way to make sure you're in command mode is to hit ESC at least once - my terminal beeps if I hit ESC when in command mode, so I usually hit it till I hear it beep ;)
--rm
-----Original Message-----
From: IBM AIX Discussion List [mailto:aix-l@Princeton.EDU]On Behalf Of Leyden, Joseph
Sent: Thursday, September 30, 2004 8:31 AM
To: aix-l@Princeton.EDU
Subject: Re: vi editor question
how do I delete a block of lines?
(say from the beginning up to the 10th to the last line)
using man vi - does not easily tells me.
Joe
- Previous message: Leyden, Joseph: "Re: vi editor question"
- Maybe in reply to: Leyden, Joseph: "Re: vi editor question"
- Next in thread: Lamar Saxon: "Re: vi editor question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]