10

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 1

18

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

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.