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?
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With