a lost vi command

Michael Hipp Michael at hipp.com
Wed Aug 18 10:53:07 PDT 2010


On 8/18/2010 11:56 AM, Bill Campbell wrote:
> On Wed, Aug 18, 2010, Vu Pham wrote:
>> I thought a friend of mine told me how to do this in VI but now I cannot
>> remember how to do it.
>>
>> I have the below sentence:
>>
>> this is an example blah1 blah2 blah3.
>>
>> The cursor is currently at the letter 'e' of the word example. I want to
>> delete the text "example blah1 blah2". IIRC, I was told to use 2 with
>> some command ( or some command with 2 ) but I cannot remember what it is.
>>
> Assuming that you're on the first e of example, ``3dw'' (3 times
> delete workd) should do the trick.  Another way would be ``df2''
> delete from the cursor up to an including the character 2.  Yet
> another would be ``3dt '' delete up to but not including the 3rd
> space character.

Also, 'D' will delete to end of line. But that may not be exactly what you're 
looking for.

Michael





More information about the Linux-users mailing list