In VIM, Given the following text:

"HelloWorld:This is a test"

If my cursor/caret is just after :, is there a command for me to delete up until the "?

So it would look like

"HelloWorld:"

0

1 Answer

Yes, use the "till" motion.

dt" 

means delete until a ". There is also the "find" motion, which deletes up to and including the character. Both of these work in reverse if you capitalize them.

From :h t:

 *t* 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. 
0

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy