I frequently have several buffers open in my Vim session. This means that my jump list stores locations from several buffers. However, frequently when I use the Ctrl+O keyboard shortcut to jump to a previous location, I do not want to leave the buffer and want to jump to previous locations “local” to the current buffer. How do I do this?
For example, assume my jump list looks as follows:
4 10 1 ~/aaa.m
3 20 1 ~/aaa.m
2 12 2 ~/xxx.m
1 15 1 ~/aaa.m
I want to jump to line 15 of file aaa.m
the first time I press Ctrl+O. Importantly, the next time I press Ctrl+O, I do not want to jump to file xxx.m
. Rather, I want to jump to line 20 of file aaa.m
, that is, my previous location within the “current” buffer. The default Vim behaviour, though, is to take me to to line 12 of file xxx.m
.
Any ideas on how I can achieve this?
changelist
fit your needs? You can useg;
andg,
to move back and forth though the change list. – Swordsman