Is there a shortcut to go back when doing a "go-to character" search in vim? Like if I press f , ; ;
to find the third comma, but accidently press one more ;
then necessary, is there a quick way to back one comma without doing F ,
?
To search backward in vi/vim by pressing ? and then typing your search pattern/word. Once word found in vim, you can press the n key to go directly to the next occurrence of the word in backwards. Press the N key to go directly to the opposite direction, i.e. forwards.
To jump back to line # 300 or previous position press CTRL-O (press and hold Ctrl key and press letter O). To jump back forwards press CTRL-I (press and hold Ctrl key and press letter I).
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.
Comma is actually bound to "Repeat latest f, t, F or T in opposite direction".
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