Spell: Don't check for a capital after an ellipsis?

84 views
Skip to first unread message

David Woodfall

unread,
Aug 2, 2015, 7:00:59 PM8/2/15
to vim...@googlegroups.com
How can I tell vim's spellchecker not to highlight words after an
ellipsis which aren't capitalised?

Thanks

David Woodfall

unread,
Aug 2, 2015, 9:17:22 PM8/2/15
to vim...@googlegroups.com
>How can I tell vim's spellchecker not to highlight words after an
>ellipsis which aren't capitalised?

After some googling I didn't find an exact find, but found a useful
function here:
http://stackoverflow.com/questions/7561603/vim-spell-check-ignore-capitalized-words

which I translated so:

fun! IgnoreEllipsis()
syn match Ellipsis /.*[.][.][.]\s[a-z]*/ contains=@NoSpell transparent
syn cluster Spell add=Ellipsis
endfun

Unfortunately it doesn't work and I'm guessing the regex is wrong, as
a simple 'echomsg "bla"' does show it being called.

Any ideas?

David Woodfall

unread,
Aug 3, 2015, 11:47:33 AM8/3/15
to vim...@googlegroups.com
I gather that spellcapcheck is the culprit here, because it is set to
any number of periods to denote the end of a sentence, instead of just
one:

[.?!][\\])'\"\t\ ]\\+

But when I try to limit it to one period following a word character or
lowercase character (\\w and \\l) highlighting of sentence endings fails.

When I try to limit to 1 occurrence it takes no notice.

I have tried these so far:

\\w[.?!][\\])'\"\t\ ]\\+
\\l[.?!][\\])'\"\t\ ]\\+
[.?!]\\{1}[\\])'\"\t\ ]\\+

None work as desired.


LCD 47

unread,
Aug 3, 2015, 2:28:52 PM8/3/15
to vim...@googlegroups.com
[...]

You could try something like this instead (not tested):

syn match Ellipsis /\%(…|\.\.\.\)\s\+\zs[a-z].\{-}\>/ contains=@NoSpell transparent

However, the effect is to ignore any word starting with a lower case
letter that follows an ellipsis, rather than just stop checking for a
capital letter after an ellipsis.

/lcd
Reply all
Reply to author
Forward
0 new messages