Home Explore Blog CI



neovim

3rd chunk of `runtime/doc/motion.txt`
1b24f6861137f99935f7fa925e07db3adb269ddf5392654f0000000100000fa2
 and the character below the cursor. >

Be careful with forcing a linewise movement to be used charwise or blockwise,
the column may not always be defined.

							*o_v*
v		When used after an operator, before the motion command: Force
		the operator to work charwise, also when the motion is
		linewise.  If the motion was linewise, it will become
		|exclusive|.
		If the motion already was charwise, toggle
		inclusive/exclusive.  This can be used to make an exclusive
		motion inclusive and an inclusive motion exclusive.

							*o_V*
V		When used after an operator, before the motion command: Force
		the operator to work linewise, also when the motion is
		charwise.

							*o_CTRL-V*
CTRL-V		When used after an operator, before the motion command: Force
		the operator to work blockwise.  This works like Visual block
		mode selection, with the corners defined by the cursor
		position before and after the motion.

==============================================================================
2. Left-right motions					*left-right-motions*

These commands move the cursor to the specified column in the current line.
They stop at the first column and at the end of the line, except "$", which
may move to one of the next lines.  See 'whichwrap' option to make some of the
commands move across line boundaries.

h		or					*h*
<Left>		or					*<Left>*
CTRL-H		or					*CTRL-H* *<BS>*
<BS>			[count] characters to the left.  |exclusive| motion.
			Note: If you prefer <BS> to delete a character, use
			the mapping: >
				:map CTRL-V<BS>		X
<			(to enter "CTRL-V<BS>" type the CTRL-V key, followed
			by the <BS> key)

l		or					*l*
<Right>		or					*<Right>* *<Space>*
<Space>			[count] characters to the right.  |exclusive| motion.
			See the 'whichwrap' option for adjusting the behavior
			at end of line

							*0*
0			To the first character of the line.  |exclusive|
			motion.

							*<Home>* *<kHome>*
<Home>			To the first character of the line.  |exclusive|
			motion.  When moving up or down next, stay in same
			TEXT column (if possible).  Most other commands stay
			in the same SCREEN column.  <Home> works like "1|",
			which differs from "0" when the line starts with a
			<Tab>.

							*^*
^			To the first non-blank character of the line.
			|exclusive| motion.  Any count is ignored.

							*$* *<End>* *<kEnd>*
$  or <End>		To the end of the line.  When a count is given also go
			[count - 1] lines downward, or as far is possible.
			|inclusive| motion.  If a count of 2 or larger is
			given and the cursor is on the last line, that is an
			error and the cursor doesn't move.
			In Visual mode the cursor goes to just after the last
			character in the line.
			When 'virtualedit' is active, "$" may move the cursor
			back from past the end of the line to the last
			character in the line.

							*g_*
g_			To the last non-blank character of the line and
			[count - 1] lines downward |inclusive|.

							*g0* *g<Home>*
g0 or g<Home>		When lines wrap ('wrap' on): To the first character of
			the screen line.  |exclusive| motion.  Differs from
			"0" when a line is wider than the screen.
			When lines don't wrap ('wrap' off): To the leftmost
			character of the current line that is on the screen.
			Differs from "0" when the first character of the line
			is not on the screen.

							*g^*
g^			When lines wrap ('wrap' on): To the first non-blank
			character of the screen line.  |exclusive| motion.
			Differs from "^" when a line is wider than the screen.
			When lines don't wrap ('wrap' off): To the leftmost
			non-blank character of the current line that is on the
			screen.  Differs from "^" when the first non-blank
			character of the line is not on the screen.

							*gm*
gm			Like "g0", but half a screenwidth to the right (or as
			much as possible).

							*gM*
gM			Like "g0", but to halfway the text of the line.
			With a count: to this percentage of text in the line.
			Thus "10gM" is near the start of the text and "90gM"
			is near the

Title: Forcing Motion Types and Left-Right Motions
Summary
This section explains how to force a motion to be linewise, charwise, or blockwise using 'v', 'V', or CTRL-V after an operator. It also details various commands for moving the cursor horizontally within a line, including 'h', 'l', '0', '^', '$', 'g_', 'g0', 'g^', 'gm', and 'gM', explaining their behavior and exceptions based on the 'wrap' and 'virtualedit' options.