Vim: delete up to nth specified character

Viewed 28

I'm pretty new to vim and I just learned that you can use dtx or dfx to delete up to x and up to and including x respectively. Is there a way to choose which occurrence of x to delete to? For example, if I have the line

peter piper picked a pickled pepper

and I wanted to delete up to the fifth p to obtain

pickled pepper

What commands would I be able to use to do this?

1 Answers

You can give motions counts even within d:

d4tp
Related