Reputation: 2401
I know how to highlight long lines. Either :
:match ErrorMsg '\%>140v.\+'
which I rather prefer to the "colorcolumn way" :
:set colorcolumn=140
So, for instance, the text :
Vim is a text editor written by B. Moolenaar and first released publicly in 1991. It is based on the vi editor common to Unix-like systems. Vim is free and open source software.
gets highlighted starting with "Vim is free, etc…"
But how can I achieve the same result for a paragraph (in this example, 3 lines) such as :
[Empty line]
Vim is a text editor written by B. Moolenaar and first released publicly in 1991.
It is based on the vi editor common to Unix-like systems.
Vim is free and open source software
[Empty line]
Thanks in advance
Upvotes: 0
Views: 185
Reputation: 172580
This is difficult, because you have to specify (in a single regular expression)
Here's the best I've achieved; it still somehow matches "into" following paragraphs if the current one is too small:
:match ColorColumn /\%(\%^\|\n\n\)\%(\%(.\+\n\)*.*\)\&\_.\{140}\%(\zs.\|\n\zs.\)/
Explanation:
I'd be happy if someone improves on this.
Upvotes: 1