tags:

views:

129

answers:

2

Hi, Suppose I'm in a certain line position in vim and I want to delete up to a certain character, say a semicolon. I would do df; except it would also delete the semicolon. Is there a command that will do the same thing but will not include the character I'm searching for?

+13  A: 

Yes, dt;. From the Vim docs:

t{char}

Till before [count]'th occurrence of {char} to the right. The cursor is placed on the character left of {char} |inclusive|. {char} can be entered like with the |f| command.

Michał Marczyk
+2  A: 

To add to what Michal said, you can also use T and F to do the same thing backwards.

Also ; will repeat the last t,T,f or F motion, and ' will repeat it in the opposite direction.

Dave Kirby