If I define a syntax highlighting region (or a match or keyword, for that matter), is it possible to specify or alter the background color of anything in that region, including things contained in it?
What I had hoped would work (but doesn't, of course) is something like (in ~/.vim/after/syntax/sh.vim)
if exists('b:current_syntax')
let s:current_syntax = b:current_syntax
unlet b:current_syntax
endif
syntax include @AwkSyntax syntax/awk.vim
if exists('s:current_syntax')
let b:current_syntax = s:current_syntax
unlet s:current_syntax
endif
syntax region AwkSglQuotes matchgroup=shQuote
\ start=#\(\<g\=awk\(\s\+[^']\+\)*\s\+\)\@<='#
\ end=#'# contains=AwkScript keepend containedin=shDo
syntax region AwkScript start=#[^']# end=#.\@=# contained
\ matchgroup=SpecialComment contained contains=@AwkSyntax
\ containedin=AwkSglQuotes
highlight AwkScript guibg=#EEEEEE
and then be able to type something like
[shell script with various commands]
BEGIN {a=0}
/cost/ {print $1}
END {print a}
' < $1
and have the AWK portion of the shell script highlighted with AWK syntax and the background of that region be light gray rather than white, to set it off.
That doesn't work (only the non-AWK-highlighted parts are affected), and there doesn't seem to be any way to "add" to the background color.
Is what I'm proposing possible in VIM?