Re: A question about syntax file and vim regexps

2007-02-05 Thread DervishD
Hi Kib :)

 * kib2 <[EMAIL PROTECTED]> dixit:
> I wonder if I can highlight more things in Python, I would like to 
> highlight functions call , i.e in a Python source, in the following line:
> 
> os.popen(...)
> 
> be able to highlight the word "popen".
> is it possible ?

Yes, it is. First, check the Python syntax file: if it already has a
syntax group for such constructs, you just need to do:

hi def TheSyntaxGroup ...

See ":help highlight" for that.

If the syntax file doesn't have such construct, you will need to do
something like this (UNTESTED!):

syntax match PythonFunCall \I\i\+.\zs\I\i\+\ze(
hi def PythonFunCall ...

The regex means:

\I   Identifier character except numbers
\i   Identifier character including numbers
\+   One or more of the last atom
.A literal dot
\zs  Here starts the match (so, the coloring)
\I   Id
\i   Id
\+   Id
\ze  Here ends the match (so, the coloring)
(A literal open parentheses

Please note that I'm not sure about "\zs" and "\ze" being legal in a
"syntax match" command. If they aren't, use "[EMAIL PROTECTED]" and family 
instead
(see ":help zero-width" for that).

Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!


A question about syntax file and vim regexps

2007-02-05 Thread kib2

Hi Vimers,

I wonder if I can highlight more things in Python, I would like to 
highlight functions call , i.e in a Python source, in the following line:


os.popen(...)

be able to highlight the word "popen".

is it possible ?

Thanks for your advices
Kib.