again. Thus you can
move up and down the list. There is a separate jump list for each window.
The maximum number of entries is fixed at 100.
For example, after three jump commands you have this jump list: >
jump line col file/text
3 1 0 some text
2 70 0 another line
1 1154 23 end.
>
<
The "file/text" column shows the file name, or the text at the jump if it is
in the current file (an indent is removed and a long line is truncated to fit
in the window).
The marker ">" indicates the current position in the jumplist. It may not be
shown when filtering the |:jumps| command using |:filter|
You are currently in line 1167. If you then use the CTRL-O command, the
cursor is put in line 1154. This results in: >
jump line col file/text
2 1 0 some text
1 70 0 another line
> 0 1154 23 end.
1 1167 0 foo bar
<
The pointer will be set at the last used jump position. The next CTRL-O
command will use the entry above it, the next CTRL-I command will use the
entry below it. If the pointer is below the last entry, this indicates that
you did not use a CTRL-I or CTRL-O before. In this case the CTRL-O command
will cause the cursor position to be added to the jump list, so you can get
back to the position before the CTRL-O. In this case this is line 1167.
With more CTRL-O commands you will go to lines 70 and 1. If you use CTRL-I
you can go back to 1154 and 1167 again. Note that the number in the "jump"
column indicates the count for the CTRL-O or CTRL-I command that takes you to
this position.
If you use a jump command, the current line number is inserted at the end of
the jump list. If the same line was already in the jump list, it is removed.
The result is that when repeating CTRL-O you will get back to old positions
only once.
When the |:keepjumps| command modifier is used, jumps are not stored in the
jumplist. Jumps are also not stored in other cases, e.g., in a |:global|
command. You can explicitly add a jump by setting the ' mark with "m'". Note
that calling setpos() does not do this.
After the CTRL-O command that got you into line 1154 you could give another
jump command (e.g., "G"). The jump list would then become: >
jump line col file/text
4 1 0 some text
3 70 0 another line
2 1167 0 foo bar
1 1154 23 end.
>
<
The line numbers will be adjusted for deleted and inserted lines. This fails
if you stop editing a file without writing, like with ":n!".
When you split a window, the jumplist will be copied to the new window.
If you have included the ' item in the 'shada' option the jumplist will be
stored in the ShaDa file and restored when starting Vim.
*jumplist-stack*
When 'jumpoptions' option includes "stack", the jumplist behaves like the tag
stack. When jumping to a new location from the middle of the jumplist, the
locations after the current position will be discarded. With this option set
you can move through a tree of jump locations. When going back up a branch and
then down another branch, CTRL-O still takes you further up the tree.
Given a jumplist like the following in which CTRL-O has been used to move back
three times to location X: >
jump line col file/text
2 1260 8 mark.c <-- location X-2
1 685 0 eval.c <-- location X-1
> 0 462 36 eval.c <-- location X
1 479 39 eval.c
2 213 2 mark.c
3 181 0 mark.c
<
jumping to (new) location Y results in the locations after the current
locations being removed: >
jump line col file/text
3 1260 8 mark.c <-- location X-2
2 685 0 eval.c <-- location X-1
1 462 36 eval.c <-- location X
>
<
Then, when yet another location Z is jumped to, the new location Y appears
directly after location X in the jumplist and location X remains in the same
position relative to the locations (X-1, X-2, etc., ...) that had been