for the example text below, the curser is in the first space:
This is the sentence.
is it awesome that I can use command like
fe
to jump to the last e in the end of the line
but unfortunately f and F only can search according to the current cursor position, Is there a command that I can search a character backwards from the end of line?
Use b to go back a word. You may also want to check out W and B to advance/go back a WORD (which consists of a sequence of non-blank characters separated with white space, according to :h WORD ).
Use / followed by the appropriate regular expression. To search for a string at the start of a line, use ^string as the expression. To search for a string at the end of a line, use string$ as the expression.
You can type f<character> to put the cursor on the next character and F<character> for the previous one. You can also use ; to repeat the operation and use , to repeat it in opposite direction.
If you press "F", Vim will move the cursor backwards instead of forward. Given the previous sentence, if pressed "Fq", and the cursor was at the end of the line, it would move to the "q" in "quick".
You can use $
to go to the end of the line. And then you can do a F
from there to search backwards.
You can use 0
to go to the beginning of the line (first non whitespace). And then you can use f
to search forwards.
$F
search backwards from end of line.0f
search forwards from beginning of 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