Thursday, September 26, 2013

Re: Improve context syntax file

Marco wrote:
> On 2013–09–26 Nikolay Pavlov wrote:
>
> > > Does someone have a solution for the remaining two problems?
> >
> > I guess you need to alter iskeyword for the problem with
> > underscore.
>
> But I can't add it permanently. The underscore is only part of a
> word in between the following blocks.
>
> \unprotect … \protect %% or
> \starttexcode … \stoptexcode

Since there is little chance that an underscore will immediately follow a
control sequence anyway, I don't think defining it for the entire syntax file
will cause any problem.

However, you can do something along the following lines:

sy match ControlSequence '\\[a-zA-Z]\+'
sy match SpecialControlSequence '\\[a-zA-Z_]\+' contained
sy region SpecialCode matchgroup=ControlSequence start='\\unprotect' end='\\protect' contains=SpecialControlSequence

Best,
Paul

--
--
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/groups/opt_out.

No comments: