vim: highlighting inside of brackets

This is a discussion on vim: highlighting inside of brackets within the Editors forums in Theory and Concepts category; Hello everyone ! Please help, I'm having a problem with matching. I have some code: open(unit=1, file='file.txt", status='new') #This is an comment (blah blah) close(unit=1) and wish to highlight the insides of the brackets, but only those behind an "open" statement. Does anyone know of any way to do this ? All ideas and suggestions would, of course, be appreciated. Best regards Luka...

Go Back   Application Development Forum > Theory and Concepts > Editors

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 09-04-2008, 05:00 PM
Luka Djigas
Guest
 
Default vim: highlighting inside of brackets

Hello everyone !

Please help, I'm having a problem with matching.
I have some code:

open(unit=1, file='file.txt", status='new')
#This is an comment (blah blah)
close(unit=1)

and wish to highlight the insides of the brackets, but only those
behind an "open" statement.

Does anyone know of any way to do this ?
All ideas and suggestions would, of course, be appreciated.

Best regards
Luka
Reply With Quote
  #2  
Old 09-04-2008, 05:48 PM
Gary Johnson
Guest
 
Default Re: vim: highlighting inside of brackets

Luka Djigas <ldigas@remove_this.gmail.com> wrote:
> Hello everyone !
>
> Please help, I'm having a problem with matching.
> I have some code:
>
> open(unit=1, file='file.txt", status='new')
> #This is an comment (blah blah)
> close(unit=1)
>
> and wish to highlight the insides of the brackets, but only those
> behind an "open" statement.
>
> Does anyone know of any way to do this ?
> All ideas and suggestions would, of course, be appreciated.


One way would be to use the \zs atom, like this:

:match StatusLine '\<open\s*(\zs[^)]*'

where I used the :match command and the StatusLine group just as an
example. See

:help /\zs

--
Gary Johnson
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 04:47 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.