spell check for punctuation characters in continuous text with vim

267 views Asked by At

is it possible to check punctuation characters in continuous text with vim? to avoid e.g.

The story of 'Hello World'  :  <CR>
Hello World!Hello World:, Hello World.<CR>
Hello World.    <CR>
1

There are 1 answers

0
Ingo Karkat On BEST ANSWER

Apparently it isn't possible to add all those illegal punctuation combinations to the bad word list; when I select :; from your example and press zW, it isn't highlighted as spell errors.

That leaves only some other sort of highlighting, e.g. via additional syntax highlighting rules:

:syntax match SpellBadPunctuation /[;:,.]\{2,}/
:highlight link SpellBadPunctuation SpellBad

(You may want to refine the regular expression.) That gives you a visual indication, but you still cannot navigate to those errors with the built-in ]s motions!