Suppose I've got the following sentence:
This |is a sentence for testing purposes.
I want this sentence to be
This purposes.
In fact I want to delete 5 words. Of course, I could do it just as d5w
but this is so inconvenient and painful. I have to count the words first and then execute the appropriate combination.
I tried it the other way. I pushed d
and then I tried to push w
5 times. But it started deleting lines (and that's sensible, because dd
deletes a line).
Is there a way to perform word deletion like we did in general editors (we keep pressing Ctrl
and then press Del
5 times) but in Vim. I suppose this quite common operation and there must be a "fast" solution for it.
dtp
(delete till the nextp
) would work in this case. If you're not sure,vtp
d
so you see what would you delete. More general (,d/ p
Enter
to delete till the searched item, or again, to see what you're doing,v/ p
Enter
d
...