I want to delete whitespace backwards until end of previous word.

Say, I have the cursor on the character "d" in the word "dog":

horse cat dog

If I press Ctrl-W (Insert mode) or db (Normal mode), then "cat" is deleted, which I don't want.

Any ideas?


3 Answers 3


In normal mode:


Then press space

  • This only works when the previous word ends in "t". Nov 12, 2020 at 16:35

How about hdiw? I.e. move into the space and then delete the "word" formed by the whitespace. That will give you:

horse catdog

To keep 1 space between cat and dog, the best I can think of is ge2ldw, i.e. go to the end of the previous word, move to the second space in the gap, and delete to the start of the next word.


Using Vim's jump to first letter in line can be useful in situations like this.


delete backwards until you reach letter t, but dont include letter itself.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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