Quantcast

highlight groups defintion

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

highlight groups defintion

sinbadd
where can i get the definition for group-name in highlight command.
my vim has :hi Function, but i am not able to find group defn for
Function, is there any way to get this.

cheers

--
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: highlight groups defintion

Ben Fritz
On Friday, May 4, 2012 11:16:34 AM UTC-5, sinbad wrote:
> where can i get the definition for group-name in highlight command.
> my vim has :hi Function, but i am not able to find group defn for
> Function, is there any way to get this.
>
> cheers

What information do you want to know about it?

For where it is defined, and how it is highlighted, do:

:verbose hi Function

Or did you want something else?

--
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: highlight groups defintion

sinbadd
On May 5, 1:57 am, Ben Fritz <[hidden email]> wrote:

> On Friday, May 4, 2012 11:16:34 AM UTC-5, sinbad wrote:
> > where can i get the definition for group-name in highlight command.
> > my vim has :hi Function, but i am not able to find group defn for
> > Function, is there any way to get this.
>
> > cheers
>
> What information do you want to know about it?
>
> For where it is defined, and how it is highlighted, do:
>
> :verbose hi Function
>
> Or did you want something else?

I want to know how it is defined, i checked other syntax commands,
they are defined as regular expressions, so even the "Function"
must be defined as one, But i couldn't find it in the list, when i
type
"syntax" without any parameter.

--
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: highlight groups defintion

Tony Mechelynck
On 06/05/12 04:37, sinbad wrote:

> On May 5, 1:57 am, Ben Fritz <[hidden email]> wrote:
>> On Friday, May 4, 2012 11:16:34 AM UTC-5, sinbad wrote:
>>> where can i get the definition for group-name in highlight command.
>>> my vim has :hi Function, but i am not able to find group defn for
>>> Function, is there any way to get this.
>>
>>> cheers
>>
>> What information do you want to know about it?
>>
>> For where it is defined, and how it is highlighted, do:
>>
>> :verbose hi Function
>>
>> Or did you want something else?
>
> I want to know how it is defined, i checked other syntax commands,
> they are defined as regular expressions, so even the "Function"
> must be defined as one, But i couldn't find it in the list, when i
> type
> "syntax" without any parameter.
>


Well, if you type

        :verbose hi Function

followed by <Enter>, the answer will be on two lines: the value of the
current colors for the Function highlight group, and the script where it
was last set (or nothing for never set or set manually by typing the :hi
command). For instance on my system it says

        Function        xxx links to Identifier
                Last set from /usr/local/share/vim/vim73/syncolor.vim

The Function syntax group is never defined. It is meant to be available
so syntax scripts can link to it: for instance

        :verbose hi VimFuncName

returns

        VimFuncName    xxx links to Function
                Last set from /usr/local/share/vim/vim73/syntax/vim.vim

which means that the syntax group VimFuncName, defined by
syntax/vim.vim, will use the colors defined for the Function group
(which itself links to the Identifier group, see above). The reason
there are distinct Function and Identifier groups is so colorschemes
can, if desired, define different colors for them.

The command

        :verbose hi

will tell you what _all_ highlight groups are and where they were
defined, but beware: there are a lot of them. You can capture this
output (and then paste it for searching), see ":help :redir" and ":help
'more'".


Best regards,
Tony.
--
The rhino is a homely beast,
For human eyes he's not a feast.
Farewell, farewell, you old rhinoceros,
I'll stare at something less prepoceros.
                -- Ogden Nash

--
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: highlight groups defintion

sinbadd
On May 7, 8:12 am, Tony Mechelynck <[hidden email]>
wrote:

> On 06/05/12 04:37, sinbad wrote:
>
>
>
>
>
>
>
>
>
> > On May 5, 1:57 am, Ben Fritz <[hidden email]> wrote:
> >> On Friday, May 4, 2012 11:16:34 AM UTC-5, sinbad wrote:
> >>> where can i get the definition for group-name in highlight command.
> >>> my vim has :hi Function, but i am not able to find group defn for
> >>> Function, is there any way to get this.
>
> >>> cheers
>
> >> What information do you want to know about it?
>
> >> For where it is defined, and how it is highlighted, do:
>
> >> :verbose hi Function
>
> >> Or did you want something else?
>
> > I want to know how it is defined, i checked other syntax commands,
> > they are defined as regular expressions, so even the "Function"
> > must be defined as one, But i couldn't find it in the list, when i
> > type
> > "syntax" without any parameter.
>
> Well, if you type
>
>         :verbose hi Function
>
> followed by <Enter>, the answer will be on two lines: the value of the
> current colors for the Function highlight group, and the script where it
> was last set (or nothing for never set or set manually by typing the :hi
> command). For instance on my system it says
>
>         Function        xxx links to Identifier
>                 Last set from /usr/local/share/vim/vim73/syncolor.vim
>
> The Function syntax group is never defined. It is meant to be available
> so syntax scripts can link to it: for instance
>
>         :verbose hi VimFuncName
>
> returns
>
>         VimFuncName    xxx links to Function
>                 Last set from /usr/local/share/vim/vim73/syntax/vim.vim
>
> which means that the syntax group VimFuncName, defined by
> syntax/vim.vim, will use the colors defined for the Function group
> (which itself links to the Identifier group, see above). The reason
> there are distinct Function and Identifier groups is so colorschemes
> can, if desired, define different colors for them.
>
> The command
>
>         :verbose hi
>
> will tell you what _all_ highlight groups are and where they were
> defined, but beware: there are a lot of them. You can capture this
> output (and then paste it for searching), see ":help :redir" and ":help
> 'more'".
>
> Best regards,
> Tony.
> --
> The rhino is a homely beast,
> For human eyes he's not a feast.
> Farewell, farewell, you old rhinoceros,
> I'll stare at something less prepoceros.
>                 -- Ogden Nash


i am trying to write a regular expression to search
for the c function, the following doesnt seem to work
very well.

[a-z|_|0-9]\+(.\+[^\r\n]\+);\C

for exmaple, in the following example the above re
is selecting the whole text startnig from new_func
till end-of-file. what's wrong with re ?

code
code
new_func(int a, int b);
code
code
end-of-file
~

--
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: highlight groups defintion

Christian Brabandt
Hi sinbad!

On Di, 08 Mai 2012, sinbad wrote:

> i am trying to write a regular expression to search
> for the c function, the following doesnt seem to work
> very well.
>
> [a-z|_|0-9]\+(.\+[^\r\n]\+);\C
>
> for exmaple, in the following example the above re
> is selecting the whole text startnig from new_func
> till end-of-file. what's wrong with re ?
>
> code
> code
> new_func(int a, int b);
> code
> code
> end-of-file

For me, your regular expression matches just what you want, however it
looks kind of strange:

> [a-z|_|0-9]\+(.\+[^\r\n]\+);\C

1) What are the 2 | in the first collation for? I think you can leave
them out.
2) the [^\r\n] is not needed I believe, since collations usually don't
match line breaks. See :h /\_ for details,

regards,
Christian
--
Was die Leute gemeiniglich als Schicksal nennen, sind meistens nur
ihre eigenen dummen Streiche.
                -- Arthur Schopenhauer

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