Home Explore Blog CI



neovim

7th chunk of `runtime/doc/motion.txt`
445567aeb1f6f4e193cc2d6fd9cc65325b53cbc911efbdef0000000100000fa1
 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 to
the macros ".IP", ".LP", etc.  (These are nroff macros, so the dot must be in
the first column).  A section boundary is also a paragraph boundary.
Note that a blank line (only containing white space) is NOT a paragraph
boundary.
Note: this does not include a '{' or '}' in the first column.

							*section*
A section begins after a form-feed (<C-L>) in the first column and at each of
a set of section macros, specified by the pairs of characters in the
'sections' option.  The default is "SHNHH HUnhsh", which defines a section to
start at the nroff macros ".SH", ".NH", ".H", ".HU", ".nh" and ".sh".
In a :terminal buffer each shell prompt is treated as a section. |terminal_]]|

The "]]" and "[[" commands stop at the '{' in the first column.  This is
useful to find the start of a function in a C program.  To search for a '}' in
the first column, the end of a C function, use "][" (forward) or "[]"
(backward).  Note that the first character of the command determines the
search direction.

If your '{' or '}' are not in the first column, and you would like to use "[["
and "]]" anyway, try these mappings: >
   :map [[ ?{<CR>w99[{
   :map ][ /}<CR>b99]}
   :map ]] j0[[%/{<CR>
   :map [] k$][%?}<CR>
[type these literally, see |<>|]

==============================================================================
6. Text object selection			*object-select* *text-objects*
						*v_a* *v_i*

This is a series of commands that can only be used while in Visual mode or
after an operator.  The commands that start with "a" select "a"n object
including white space, the commands starting with "i" select an "inner" object
without white space, or just the white space.  Thus the "inner" commands
always select less text than the "a" commands.

Also see `gn` and `gN`, operating on the last search pattern.

							*v_aw* *aw*
aw			"a word", select [count] words (see |word|).
			Leading or trailing white space is included, but not
			counted.
			When used in Visual linewise mode "aw" switches to
			Visual charwise mode.

							*v_iw* *iw*
iw			"inner word", select [count] words (see |word|).
			White space between words is counted too.
			When used in Visual linewise mode "iw" switches to
			Visual charwise mode.

							*v_aW* *aW*
aW			"a WORD", select [count] WORDs (see |WORD|).
			Leading or trailing white space is included, but not
			counted.
			When used in Visual linewise mode "aW" switches to
			Visual charwise mode.

							*v_iW* *iW*
iW			"inner WORD", select [count] WORDs (see |WORD|).
			White space between words is counted too.
			When used in Visual linewise mode "iW" switches to
			Visual charwise mode.

							*v_as* *as*
as			"a sentence", select [count] sentences (see
			|sentence|).
			When used in Visual mode it is made charwise.

							*v_is* *is*
is			"inner sentence", select [count] sentences (see
			|sentence|).
			When used in Visual mode it is made charwise.

							*v_ap* *ap*
ap			"a paragraph", select [count] paragraphs (see
			|paragraph|).

Title: Defining Paragraphs, Sections, and Text Object Selection in Vim
Summary
This section defines 'paragraph' and 'section' in Vim, explaining how they are identified using macros specified in the 'paragraphs' and 'sections' options, respectively. It also describes how the "[[", "]]", "[]", and "][" commands interact with '{' and '}' characters, often used to mark function starts and ends in C code, and provides mappings for scenarios where these characters are not in the first column. The section then introduces text object selection commands used in Visual mode or after an operator, differentiating between "a" commands (selecting an object including whitespace) and "i" commands (selecting an "inner" object without whitespace). Specific commands covered include aw, iw, aW, iW, as, is, and ap for selecting words, WORDs, sentences, and paragraphs.