Thursday, November 1, 2012

Re: Spellcheck on Tex-Files

On Wednesday, October 31, 2012 5:45:57 PM UTC-4, DrChip wrote:
> xxx wrote:
>
> > I would really appreciate a specific example on how to acomplish this.
>
> > My last try is syn region texComment matchgroup=texStatement
>
> > start='{tabular}{' end='}' \ contains=@NoSpell but it doesn't work...
>
> You almost had it earlier; you need to have your new region contained in
>
> texDocZone:
>
>
>
> syn region texTabularPos matchgroup=texStatement
>
> start='\\begin\s*{\s*tabular\s*}{' end='}' fold
>
> contains=@texFoldGroup,@texDocGroup,@NoSpell containedin=texDocZone
>
>
>
> That may not be the only region that it needs to be contained in, however.
>
>
>
> I use my :HLT! command available with my plugin hilinks.vim:
>
> http://www.drchip.org/astronaut/vim/index.html#HILINKS
>
>
>
> Then you can move your cursor around and determine which syntax region
>
> is currently active under the cursor.
>
>
>
> Regards,
>
> C Campbell

Thank you very much!
With the help of your plugin HILINKS and your last suggestion I was finally able to get it to work.
The version I have in my config file (which I would not be able to write without your plugin) is:

syn region texTabularPos matchgroup=texStatement
\ start='\\begin\s*{\s*tabular\s*}[^}]*{' end='}' fold
\ contains=@texFoldGroup,@texDocGroup,@NoSpell
\ containedin=texDocZone,texChapterZone,texSectionZone,texSubSectionZone

Since I got this far, I would ask a related question.
Some authors names are first classified as bad spelling. For some names, say
Al-Faiz both words Al and Faiz are spelling errors. They are actually a name but unless they appear together this should be a bad spelling.
An idea I have is to define a command
\nospell and then when writing the name I would just write \nospell{Al-Faiz} and then I could instruct vim not to spell that region, using a technique similar to the above one.
Any idea on this?

Thanks!

--
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

No comments:

Post a Comment