Step 4 of 5

15. The Changelist Jumplist And Tag Stack

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. Jump to line 20 20G — this gives the jumplist an entry inside exercise.txt.
  2. Open other.txt The statusline will show the new name — type :e other.txt and hit Enter.
  3. Jump to the bottom of other.txt Another jump, this one recorded in the new file — press G.
  4. 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>).
  5. 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.
Jump to line 20 20G — this gives the jumplist an entry inside exercise.txt.

Next: Open other.txt

Loading editor…