I just accidentally did f], how do I return the cursor to where it previously was?
Ctrl-O doesn't work of course because f is not regarded as a jump.
, doesn't work because I wasn't on a ] previously.
I just accidentally did f], how do I return the cursor to where it previously was?
Ctrl-O doesn't work of course because f is not regarded as a jump.
, doesn't work because I wasn't on a ] previously.
You can't.
But f only works in the current line, so you must be near anyway. This also true in general: if motion doesn't appear in the jumplist then it is probably an intra-line motion.
Use the plugin Houl/repmo, to extend these abilities by providing pairs of forward and reversed(backward) motions. Like [s, ]s. It usually overrides the normal keys for repeating motion ;, ,.
Notice that you can't exactly undo f], but it does F], which mostly is good enough. It is better in the example I gave (next/prev spelling error).