I'm trying to improve the cmake-syntax-highlighting for vim.
I'm unable to have vim highlight a keyword which is inside a text which is already matching a region. I'm talking about variables:
For example CMAKE_SOURCE_DIR
is a built-in variable which is listed in a syn keyword cmakeVariable
-list.
When accessing values of a variable in cmake you use ${...}
. Highlighting this is done with a region:
syn region cmakeVariableValue start=/\${/ end=/}/
\ contained oneline contains=CONTAINED,cmakeTodo,cmakeVariable
Both highlightings work, except when mixed together. Keywords listed in cmakeVariable
are not highlighted specially when being in a ${}
-region.
How can I tell vim to apply special highlighting in a region when a keyword is used?