Yep.
> but
> if you write ()), nothing will happen! because if something matched
> the 'start' section of region, Vim will think the words next it are
> all in this region. so ')' will matched vimOperParen even if it's not
> matched!!
Not for me. The final ) is highlighted as Error for me.
In what context were you trying it?
> i want more. i want to sign all unmatched bracket, like ()) (() ))
> (( etc. how can i do it?
The first and third work, because the closing brackets are the errors.
The others are hard. You can't really do it with syntax regions. For
good reason, Vim doesn't check for the end of the syntax region when it
finds the start: only the start is enough. This means you can see syntax
highlighting while you type, even before you end the region. But it
means the kind of highlighting you want is hard.
You could possibly do it using the :match command or matchadd()
function, with an appropriate regular expression. It may be slow, though
and I suspect it is not worth it. By developing suitable habits and
using matchparen (:help matchparen), showmatch (:help 'showmatch')
and/or matchit (:help matchit, :help matchit-install) you can easily
keep your brackets nicely matched.
Cheers,
Ben.