a lost vi command

Bill Campbell linux-sxs at celestial.com
Wed Aug 18 09:56:02 PDT 2010


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.

Bill
-- 
INTERNET:   bill at celestial.com  Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/  PO Box 820; 6641 E. Mercer Way
Voice:          (206) 236-1676  Mercer Island, WA 98040-0820
Fax:            (206) 232-9186  Skype: jwccsllc (206) 855-5792

A government big enough to give you everything you want is strong
enough to take everything you have. -- Thomas Jefferson



More information about the Linux-users mailing list