Home Explore Blog CI



neovim

14th chunk of `runtime/doc/motion.txt`
1687805bd37a343762e4b6d69bb22dd3e423027f3705efc00000000100000fa1
 numbers in quickfix positions
			- positions in the |jumplist|
			- positions in the |tagstack|
			These items will still be adjusted:
			- previous context mark ''
			- the cursor position
			- the view of a window on a buffer
			- folds
			- diffs

:kee[pmarks] {command}				*:kee* *:keep* *:keepmarks*
			Currently only has effect for the filter command
			|:range!|:
			- When the number of lines after filtering is equal to
			  or larger than before, all marks are kept at the
			  same line number.
			- When the number of lines decreases, the marks in the
			  lines that disappeared are deleted.
			In any case the marks below the filtered text have
			their line numbers adjusted, thus stick to the text,
			as usual.
			When the 'R' flag is missing from 'cpoptions' this has
			the same effect as using ":keepmarks".

							*:keepj* *:keepjumps*
:keepj[umps] {command}
			Moving around in {command} does not change the |''|,
			|'.| and |'^| marks, the |jumplist| or the
			|changelist|.
			Useful when making a change or inserting text
			automatically and the user doesn't want to go to this
			position.  E.g., when updating a "Last change"
			timestamp in the first line: >

				:let lnum = line(".")
				:keepjumps normal gg
				:call SetLastChange()
				:keepjumps exe "normal " .. lnum .. "G"
<
			Note that ":keepjumps" must be used for every command.
			When invoking a function the commands in that function
			can still change the jumplist.  Also, for
			`:keepjumps exe 'command '` the "command" won't keep
			jumps.  Instead use: `:exe 'keepjumps command'`

==============================================================================
8. Jumps					*jump-motions*

A "jump" is a command that normally moves the cursor several lines away.  If
you make the cursor "jump" the position of the cursor before the jump is
remembered.  You can return to that position with the "''" and "``" commands,
unless the line containing that position was changed or deleted.  The
following commands are "jump" commands: "'", "`", "G", "/", "?", "n", "N",
"%", "(", ")", "[[", "]]", "{", "}", ":s", ":tag", "L", "M", "H" and the
commands that start editing a new file.

							*CTRL-O*
CTRL-O			Go to [count] Older cursor position in jump list
			(not a motion command).

<Tab>		or					*CTRL-I* *<Tab>*
CTRL-I			Go to [count] newer cursor position in jump list
			(not a motion command).

			NOTE: In the GUI and in a terminal supporting
			|tui-modifyOtherKeys| or |tui-csiu|, CTRL-I can be
			mapped separately from <Tab>, on the condition that
			both keys are mapped, otherwise the mapping applies to
			both. Except in tmux: https://github.com/tmux/tmux/issues/2705

							*:ju* *:jumps*
:ju[mps]		Print the jump list (not a motion command).

							*:cle* *:clearjumps*
:cle[arjumps]		Clear the jump list of the current window.

							*jumplist*
Jumps are remembered in a jump list.  With the CTRL-O and CTRL-I command you
can go to cursor positions before older jumps, and back 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

Title: Vim Commands: Marks, Jumps, and Navigation
Summary
This section describes the ':keepmarks' and ':keepjumps' commands, focusing on how they affect mark adjustments and cursor movement during filtering and other operations. It details which marks and positions are adjusted or preserved. Additionally, the section covers jump motions, defining 'jump' commands and explaining how Vim remembers cursor positions before jumps. It introduces commands like CTRL-O, CTRL-I, :jumps, and :clearjumps for navigating and managing the jump list, and explains the jump list's structure and usage.