Sunday, January 1, 2012

Help with VIM syntax region regex please....

Hello,

I'm doing something a little complex with my syntax highlighting, and I'm
having a problem.

I want if-blocks to be highlighted differently. I want the if-block to start
with the word "if" and end one-space before the { symbol, but ONLY match if
there is a { symbol. In other words, not to match if the if-statement is a
one or two-line statement that doesn't use curly braces.

So far, I have this:

syntax region blockStartLvl1 start=/if/ end=/{/me=e-1
contains=@blockStartLvl1Contents

Which works fine, as long as the if statement is followed by curly braces.

--
View this message in context: http://vim.1045645.n5.nabble.com/Help-with-VIM-syntax-region-regex-please-tp5113772p5113772.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: