I have Bash file in which I have constructs that include (@)_
as part of the variable name. For example:
(@)_VariableName
${(@)_VariableName[@]}
${#(@)_VariableName[@]}
${!(@)_VariableName[@]}
The Bash files are pre-processed and the literal string (@)_
is replaced with characters so that the final result is valid Bash. The sequence (@)_
, if present, will always be at the beginning of a variable name.
I'd like to modify the sh.vim
syntax file so that variable names are considered to be valid in identifier highlighting and not shown with shDerefWordError
highlighting. I've tried modifying:
syn match shDerefVar contained "{\@<=!\k\+" nextgroup=@shDerefVarList
to:
syn match shDerefVar contained "{\@<=\((@)_\)\?!\k\+" nextgroup=@shDerefVarList
but this has not worked.
Note that this allowance might reasonably be made conditional to a variable such as b:is_eggsh
.
Can anyone suggest a solution?