Reputation: 141
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?
Upvotes: 0
Views: 160
Reputation: 27674
Using visual mode to select and ;
to move to next occurrence makes it easier than counting.
vtp;;;x
Upvotes: 1