See the following example:
" open a file with 20+ lines. 1gg " jump to line 1 3gg " jump to line 3 5gg " jump to line 5 7gg " jump to line 7 ctrl+O " back to line 5 ctrl+O " back to line 3 20gg " jump to line 20 ctrl+O " back to line 3 ctrl+O " back to line 7!!!! But what I expected is back to line 1
:h jumplist and know why I get this result.
But this bevior is really annoying for me (I use vim to read c++ code and jump through function call stack frequently), what I want is:
ctrl+O and make a new jump, vim can erases jump tags that are later than current position in the jumplist.