builder-7000
builder-7000

Reputation: 7627

Vim sentence motion

According to Vim's manual:

A sentence is defined as ending at a '.', '!' or '?' followed by either the end of a line, or by a space or tab.

However ( and ) normal-mode motions seem to have no effect if there's only one space between sentences:

First sentence. Second sentence.

But ( and ) work as expected if there are multiple spaces between sentences:

First sentence.  Second sentence.

My question is why ( and ) have no effect when sentences are separated with a single space?

Upvotes: 17

Views: 8276

Answers (1)

builder-7000
builder-7000

Reputation: 7627

This behavior is documented in Vim's manual (:help sentence):

If the 'J' flag is present in 'cpoptions', at least two spaces have to follow the punctuation mark; Tabs are not recognized as white space.

Upvotes: 8

Related Questions