Step 2 of 5

Walking back and forward

Walking back and forward

Two keys walk the jumplist:

  • Ctrl-o — jump back to the previous position
  • Ctrl-i — jump forward again

Every Ctrl-o takes you one entry further into the past, and Ctrl-i undoes that one entry at a time. Pressing Ctrl-o for the first time also records where you are right now, so Ctrl-i can always bring you all the way back to where you started.

To a terminal, Tab and Ctrl-i are literally the same key, so Tab works for jumping forward as well — some people find it easier to reach.

The checklist below seeds the jumplist with three goto-line jumps, then rides Ctrl-o and Ctrl-i back and forward through those entries. Keep an eye on the line number at the right end of the statusline as you go.

  1. Jump to line 10 Type 10gg — the first entry for the jumplist.
  2. Jump to line 20 20gg — another entry for the jumplist.
  3. Jump to line 30 30gg — one more.
  4. Jump back with Ctrl-o Hold Ctrl and press o once — you'll return to line 20, where you were before the last jump.
  5. Go back once more Press Ctrl-o again — this time you'll land on line 10.
  6. Come forward again with Ctrl-i Hold Ctrl and press i (or press Tab) — forward through the jumplist, back to line 20.
Jump to line 10 Type 10gg — the first entry for the jumplist.

Next: Jump to line 20

Loading editor…