I am trying to color different levels of parentheses differently in vim -like rainbow parentheses. But I couldn't do it without breaking, for example, css highlighting.
Problem is that: syntax of whatever text goes into curly braces for a css file, very reasonably defined as "contained", like:
syn keyword cssColor contained aqua
syn region cssDefinition transparent start='{' end='}' contains=cssColor
With this definition, "aqua" keyword is highlighted if it's in the braces , but not otherwise.
Now, when I define regions for braces like:
syn region brace1 transparent contains=brace2
syn region brace2 transparent contained contains=brace3
syn region brace3 transparent contained contains=brace1
to be able to color them differently, I am breaking containment of cssColor by cssDefinition. saying contains ALL obviously not working.
So the question is, is it possible to write a code to get the elements that original syntax group for braces contain, and add them to freshly defined syntax groups? I know this doesn't make real sense for css files, but it does in general.