Friday, May 28, 2010

Re: Syntax Highlighting Minor Groups

Okay, I went here:

http://stackoverflow.com/questions/1199267/braces-and-operators-coloring-in-vim-for-c/1199578#1199578

Tried the following code to see the operator classification:

:map <F3> :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '>
trans<' . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" .
synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR>


And apparently there's no group for the brackets, ++, ;, etc. operators.
Which means we would have to do this with pattern matching huh?


airforceone wrote:
>
> Jürgen,
>
> Thanks! It works! But, for some reason, I am unable to get the Operator
> minor group highlighting to work.
>
> For example,
>
> hi Operator gui=none guifg=Red
>
> Doesn't work for some reason...
>
>
>
>
>
>
> Jürgen Krämer-4 wrote:
>>
>>
>> Hi,
>>
>> airforceone schrieb:
>>>
>>> I'm trying to figure out how to highlight specific portions of the
>>> syntax.
>>> Take a look at this (taken from the vim documentation):
>>>
>>> *Statement any statement
>>> Conditional if, then, else, endif, switch, etc.
>>> Repeat for, do, while, etc.
>>> Label case, default, etc.
>>> Operator "sizeof", "+", "*", etc.
>>> Keyword any other keyword
>>> Exception try, catch, throw
>>>
>>> We can do syntax highlighting for the Statement syntax by doing the
>>> following in vimrc:
>>>
>>> hi Statement gui=none guifg=Red
>>>
>>> That command will apply highlighting to all the minor groups as well
>>> (conditional, repeat, etc.)
>>>
>>> Is it possible to apply highlighting to a specific group (conditional,
>>> repeat, label, etc), rather than the major group (statement)?
>>>
>>> I tried doing pattern matching but that takes way too much work...
>>
>> have you tried
>>
>> hi Conditional guifg=Red
>>
>> ?
>>
>> This worked for me.
>>
>> Regards,
>> Jürgen
>>
>> --
>> Sometimes I think the surest sign that intelligent life exists elsewhere
>> in the universe is that none of it has tried to contact us. (Calvin)
>>
>> --
>> 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
>>
>>
>
>

--
View this message in context: http://old.nabble.com/Syntax-Highlighting-Minor-Groups-tp28702384p28703822.html
Sent from the Vim - General mailing list archive at Nabble.com.

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