The jumplist works across files
The great thing about the jumplist is that it works across files. If you’re a programmer, this is really useful if you’re using some kind of jump-to-definition plugin — you can jump, then return back using <C-o>.
There’s a second file alongside the editor’s exercise.txt called other.txt. The checklist below has you jump around in exercise.txt, hop over to other.txt and jump around in there too, then use <C-o> and <C-i> to traverse the whole trail — file boundaries included.
1 2 3 4 5
Jump to line 20 20G — this gives the jumplist an entry inside exercise.txt.
Open other.txt The statusline will show the new name — type :e other.txt and hit Enter.
Jump to the bottom of other.txt Another jump, this one recorded in the new file — press G.
Ride Ctrl-o back into exercise.txt After retracing the jump inside other.txt, it carries you across the file boundary — keep pressing Ctrl-o (or Backspace, after :nnoremap <BS> <C-o>).
Ride Ctrl-i forward into other.txt Ctrl-i retraces the same trail the other way — press it until you're back in other.txt.
Next: Open other.txt
Next: Jump to the bottom of other.txt
Next: Ride Ctrl-o back into exercise.txt
Next: Ride Ctrl-i forward into other.txt
Last one — goal check runs when it's done
Nice work!
Up next: The tag stack.