Monday, June 13, 2016

Re: Spellcheck after Ellipsis again

David Woodfall wrote:
>>> Hi
>>>
>>> Someone on the list gave me a way to stop spellchecker picking up on
>>> uncapitalised words after an ellipsis, which I use in
>>> ~/.vim/ftplugin/tex.vim and it works great.
>>>
>>> However, I found that the same thing in txt.vim doesn't work.
>>>
>>> Any idea why this is not working?
>>>
>>> These are the lines:
>>>
>>> setl spell
>>> syn match Ellipsis /[.][.][.]\s\+\l.*\>/ contains=@NoSpell transparent
>>> syn match Ellipsis2 /[.][.][.]\n\s\+\l.*\>/ contains=@NoSpell
>>> transparent
>>> syn cluster Spell add=Ellipsis
>>> syn cluster Spell add=Ellipsis2
>>>
>>> I also put them in ~/.vim/plugin/settings but that doesn't seem to
>>> work either.
>>
>> OK I have found what the problem is, but haven't yet found a fix.
>>
>> In my txt file I have a modeline:
>>
>> % vim: syn=tex
>>
>> If I take that out it works as expected, but I want to use tex syntax.
>>
>> Any ideas? (Other than renaming my txt files to tex)
>
> Actually, renaming doesn't work either. It seems that some things are
> still spellchecked up the top of the document. If I put an ellipsis
> near the end it's fine.
>
> Stumped...
>
> I'm sure there is a setting for how much of the buffer is checked, but
> I haven't found it yet.
>
Spellchecking is specified on a syntax-region/syntax-match basis. The
syntax-tex file has a lot of regions, and your Ellipsis match is not
contained in any of them; ie. it would apply only to wherever there is
no region/match in effect.

* approach#1: use the hilinks plugin
(http://www.drchip.org/astronaut/vim/index.html#HILINKS) to identify
regions that you want modify contains lists: ex. syn Ellipsis ...
containedin=texSectionZone
* approach#2: add your region to one or more of the clusters that
syntax/tex uses: ex. syn cluster texFoldGroup add=Ellipsis

Regards,
Chip Campbell

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment