Wiki

by yszheda

View project onGitHub

Tip 55: Traverse the Jump List

Return to the top: <<Practical Vim>>

  • :jumps: inspect the contents of the jump list
  • <C-i>: jump forward
  • <C-o>: jump backward
  • <C-i>/<C-o> cannot be used in Visual mode or Operator-Pending mode.
  • Each separate window has its own jump list → <C-i> and <C-o> commands will always be scoped to the jump list of the active window.
Command Effect
[count]G Jump to line number
//pattern<CR>/?pattern<CR>/n/N Jump to next/previous occurrence of pattern
% Jump to matching parentheses
(/) Jump to start of previous/next sentence
{/} Jump to start of previous/next paragraph
H/M/L Jump to top/middle/bottom of screen
gf Jump to file name under the cursor
<C-]> Jump to definition of keyword under the cursor
'{mark}/`{mark} Jump to a mark

Beware of Mapping the Tab Key

  • In Insert mode: <C-i> is equivalent to <Tab>.
  • If you map the <Tab> key to something else, it will overwrite the default behavior of the <C-i> command.