Description of problem: vim colors the text of a bash script, so that syntactic elements have different colors depending on how bash will interprete them (is this correctly expressed?) For example using "colorscheme murphy" (in ~/.vimrc) the text echo $ALPHA would have the token "echo" in yellow and the token "$ALPHA" in blue for example. The text echo "foo$ALPHA.bar" would have echo in yellow " in yellow $ALPHA in blue (a to be resolved variable) .bar in green (text not part of the variable) A special case is echo $10 This is interpreted by bash as "print the value of $1, then print 0", not as "print the value of $10", which would be "echo ${10}" vim colors this wrongly It colors it with "echo" in yellow, "$10" in blue. It should color it with "echo" in yellow, "$1" in blue, "0" in green. Very obscure indeed. Version-Release number of selected component (if applicable): vim-enhanced-6.3.046-0.40E.7 How reproducible: Always
The current Fedora 10 version seems to get this right, '1' is colored differently than '0' with your testcase. Unfortunately I'm not allowed to push a new package with such a minor fix, but I'll try to get this bugzilla approved when I have to do the next vim erratum (non-security only). I think a fix would be to edit /usr/share/vim/vim63/syntax/sh.vim and replace the line syn match shDerefSimple "\$\w\+" with syn match shDerefSimple "\$\%(\h*\w*\|\d\)"