Home Explore Blog CI



neovim

6th chunk of `runtime/doc/motion.txt`
995e0d948ce6e6d0bf22c9225256684cfa80dd84c64f46f40000000100000fa3
 |exclusive| motion.

							*e*
e			Forward to the end of word [count] |inclusive|.
			Does not stop in an empty line.

							*E*
E			Forward to the end of WORD [count] |inclusive|.
			Does not stop in an empty line.

<S-Left>	or					*<S-Left>* *b*
b			[count] words backward.  |exclusive| motion.

<C-Left>	or					*<C-Left>* *B*
B			[count] WORDS backward.  |exclusive| motion.

							*ge*
ge			Backward to the end of word [count] |inclusive|.

							*gE*
gE			Backward to the end of WORD [count] |inclusive|.

These commands move over words or WORDS.
							*word*
A word consists of a sequence of letters, digits and underscores, or a
sequence of other non-blank characters, separated with white space (spaces,
tabs, <EOL>).  This can be changed with the 'iskeyword' option.  An empty line
is also considered to be a word.
							*WORD*
A WORD consists of a sequence of non-blank characters, separated with white
space.  An empty line is also considered to be a WORD.

A sequence of folded lines is counted for one word of a single character.
"w" and "W", "e" and "E" move to the start/end of the first word or WORD after
a range of folded lines.  "b" and "B" move to the start of the first word or
WORD before the fold.

Special case: "cw" and "cW" are treated like "ce" and "cE" if the cursor is
on a non-blank.  This is Vi-compatible, see |cpo-_| to change the behavior.

Another special case: When using the "w" motion in combination with an
operator and the last word moved over is at the end of a line, the end of
that word becomes the end of the operated text, not the first word in the
next line.

The original Vi implementation of "e" is buggy.  For example, the "e" command
will stop on the first character of a line if the previous line was empty.
But when you use "2e" this does not happen.  In Vim "ee" and "2e" are the
same, which is more logical.  However, this causes a small incompatibility
between Vi and Vim.

==============================================================================
5. Text object motions					*object-motions*

							*(*
(			[count] |sentence|s backward.  |exclusive| motion.

							*)*
)			[count] |sentence|s forward.  |exclusive| motion.

							*{*
{			[count] |paragraph|s backward.  |exclusive| motion.

							*}*
}			[count] |paragraph|s forward.  |exclusive| motion.

							*]]*
]]			[count] |section|s forward or to the next "{" in the
			first column.  When used after an operator, then also
			stops below a "}" in the first column.  |exclusive|
			Note that |exclusive-linewise| often applies.
			In a :terminal buffer each shell prompt is treated as
			a section. |terminal_]]|

							*][*
][			[count] |section|s forward or to the next '}' in the
			first column.  |exclusive|
			Note that |exclusive-linewise| often applies.

							*[[*
[[			[count] |section|s backward or to the previous "{" in
			the first column.  |exclusive|
			Note that |exclusive-linewise| often applies.
			In a :terminal buffer each shell prompt is treated as
			a section. |terminal_]]|

							*[]*
[]			[count] |section|s backward or to the previous "}" in
			the first column.  |exclusive|
			Note that |exclusive-linewise| often applies.

These commands move over three kinds of text objects.

							*sentence*
A sentence is defined as ending at a '.', '!' or '?' followed by either the
end of a line, or by a space or tab.  Any number of closing ')', ']', '"'
and ''' characters may appear after the '.', '!' or '?' before the spaces,
tabs or end of line.  A paragraph and section boundary is also a sentence
boundary.
If the 'J' flag is present in 'cpoptions', at least two spaces have to
follow the punctuation mark; <Tab>s are not recognized as white space.
The definition of a sentence cannot be changed.

							*paragraph*
A paragraph begins after each empty line, and also at each of a set of
paragraph macros, specified by the pairs of characters in the 'paragraphs'
option.  The default is "IPLPPPQPP TPHPLIPpLpItpplpipbp", which corresponds

Title: Word and Text Object Motions in Vim
Summary
This section expands on word motions (w, W, e, E, b, B, ge, gE), defining 'word' and 'WORD' and explaining how they interact with folded lines. It details special cases like 'cw' and 'cW' behaving like 'ce' and 'cE' when the cursor is on a non-blank, and how 'w' works with operators at the end of lines. The section then transitions to text object motions, describing commands such as (, ), {, }, ]], ][, [[, and [] that move the cursor by sentences, paragraphs, and sections. It defines 'sentence' and 'paragraph', including how they are delimited and influenced by options like 'cpoptions' and 'paragraphs'.