2013/12/24 Ben Fritz <[email protected]>

> On Tuesday, December 24, 2013 1:31:30 PM UTC-6, riemann wrote:
> > I would like to have automatic user defined types syntax highlighting in
> Vim.
> > So that if I have for example a syntax match group for classes
> > and have this in the buffer
> >
> > 1   class mytype {
> > 2   //...
> > 3   };
> > 4
> > 5   mytype a;
> > 6   mytype b;
> >
> > "mytype" is automatically highlighted on lines 5 and 6 besides 1.
> >
> > I would like to modify the source code rather than use scripts, for
> responsiveness of highlight and efficiency reason.
> > I am reading src/syntax.c and I'm trying to answer these questions:
> >
> > 1) Which data structure holds the syntax information of a certain group?
> >
> > 2) Which function triggers on a match event to update this structure?
> >
> > 2) Can I extract from the structure the strings to be highlighted?
> >
> > Any help appreciated,
> > Thanks
>
> Vim doesn't even defined syntax highlighting in source code! You're going
> at this all wrong. Vim always does syntax highlighting via script. There
> are exactly zero languages Vim highlights without a script.
>

We should agree on the fact that in a "language.vim" file the user
specifies
what should be highlighted and how it should be rendered for that
particular
filetype expressing this desired behaviour following the rules indicated in
:help syntax.
Than the implementation of this is of course done in source code as we can
see
in the almost ten thousand lines of code of syntax.c.
But it turns out that the feature in question is not obtainable with the
means
exposed by Vim, so no vim script can do this.
Then there are two choices: use external software (in the case of easytags
that you suggested it's exuberant ctags) or edit syntax.c.
I followed the second for reasons already expressed.

-- 
-- 
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Raspunde prin e-mail lui