Reputation: 3127
Is there a motion to move to the last of a character?
Example:
[A]pple -> move to last p -> Ap[p]le
I can do that with 2fp
but if there's lots of "p"s in the line then it's not so easy to count them then do 10fp
Upvotes: 5
Views: 234
Reputation: 8248
My Vim plugin improved_ft also allows for this. Set let g:ft_improved_multichars = 1
, press f
and then type p
followed by l
.
Upvotes: 1
Reputation: 172590
My JumpToLastOccurrence plugin extends the built-in f
/ F
/ t
/ T
motions with counterparts (by default bound to ,f
etc.) that move to the last occurrence of {char}
in the line.
Upvotes: 6
Reputation: 196566
There's no such motion.
But you could always do vfp;;;;d
or v$Fpd
.
Or find another more suitable target.
Or use a plugin like Easymotion.
Upvotes: 4
Reputation: 66217
Instead of looking for the last occurrence of a character - move to the end and look backwards for the first:
$Fp
Upvotes: 5
Reputation: 15320
$Fp
$
jumps to the end of the line, F
jumps backwards to the character p
.
This does not work if p
is your last character.
Upvotes: 7