Let's say I have my cursor lying in the code below:
internal static SingleSelectList<Country, int> CreateCountrySingleSelectList(List<Country> countries, List<Airport> airPorts)
And the cursor is in the head of the line. Now I want to move my cursor to the second <
of this line of code, which is in the WORD List<Country>
, and just doing the key sequence of f<;
will bring me there.
But what if I did something wrong by pressing another ;, that will bring me to the next <
in the line, which is in the word List<Airport>
.
In this situation, how can I get back to the second < using the minimum key strokes?
Is there a fastest way to undo cursor movements, instead of F<
or pressing the key hfor a very long time?
Try CtrlO to go back in cursor history.
http://www.rosipov.com/blog/open-previously-edited-file-in-vim/
The reversible action of ;
is ,
so the answer to your question would be to use ,
one time.
You can look up what the command does by :h ;
; Repeat latest f, t, F or T [count] times.
, Repeat latest f, t, F or T in opposite direction
[count] times
Contrary to Ruslan Osipov's wrong answer, the f
motion does not store the previous position in the jump list (only motions that usually go to non-adjacent lines do).
But nothing prevents you from explicitly setting a jump yourself with m'
. Then, you can return to that position via ``
, or <C-O>
.
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