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
Press e (“end”) to move the cursor to the last character of the current word.
Motions (as in movements) are how you move around in Vim. They are commands that when typed move the cursor around with high speed and precision. There are many of them, and each one is best suited for different types and lengths of movement.
The end-of-line character ( lcs-eol , $ by default) is displayed at the end of file (EOF), no matter if the file actually ends with a newline. Neither disabling the fixeol setting ( :set nofixeol ), nor starting Vim in binary mode ( vim --clean -b bar ) affects this behavior.
Press ^ to move the cursor to the start of the current line. Press $ to move the cursor to the end of the current line.
$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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With