After words, sentences are the next higher-order logical chunk of text that we work with, and Neovim is able to identify those as well. In Neovim, a sentence is defined as:
- sentence
- a sequence of words and WORDs that end with a
.
,!
, or?
, followed by either aspace
,tab
, orEOL
.
Selecting the "inner" Sentence
Consider the text in the following buffer, noting that the cursor is currently located on line 2, in the middle of the sentence that begins with "For a long time" and ends with "the ferryman". Now, let's visually-select inside a sentence to see which text is included in the sentence text object:
Selecting "around" the Sentence
Note that the cursor remains in its initial position in the middle of the sentence, while the selected text extends both back to the start of the sentence, as well as forward to the end of the sentence. Also note that the content of the sentence consists of both word and WORD text objects.
In the first example we demonstrate selecting "around" a Sentence that contains only alphanumeric characters.
As we saw in the previous section, selecting around the text object included the whitespace that separates this sentence from the following sentence.