I enjoy Ctrl+O quite a bit, but it tends to jump me to other files. The way I work is I have many files open simultaneously across windows and also across different instances of Vim so I can see them at the same time, and switch between them.
So I'd rather have it just jump within a single file. Ideally I can have two separate commands, one that does the normal <C-O>
that goes across files (and is like a chronological path of where I have been) and another that does this only in the currently opened file.
Is there perhaps a way to script this? Hopefully there's a plugin out there. I think it would just need to scan through the jumplist filtering out all files that are not this file.
You can jump though the changelist (:help changelist
) with g;
(back) and g,
(forth).
It is local so there's no way you'd jump to another buffer but it's a "change"list so only changes are remembered, not motions.
My EnhancedJumps plugin defines variants of <C-o>
that either stay in the current buffer, or immediately jump to a cursor position in another buffer.
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