The sh.vim syntax highlighting does not correctly handle parameter expansions of the form ${parameter/pattern}. I'm not sure whether they're legal bash - the man page seems to imply one should use ${parameter/pattern/} - but they work and are used extensively, e.g. in /usr/lib/portage/bin/ebuild.sh. I attach a patch.
Created attachment 78598 [details, diff] sh.vim-bash-pps.patch To vim-core 6.4.
Please send this upstream (if it hasn't been fixed already -- it's been reported). I'm really trying to cut back on syntax patches if at all possible.
Ah... yes, it is fixed upstream: http://cvs.sourceforge.net/viewcvs.py/vim/vim7/runtime/syntax/sh.vim?r1=1.10&r2=1.11&diff_format=u I've also found a bug in case...esac highlighting not fixed upstream; I'll upstream it and not bother you with it (unless vim7 comes out without it).
Created attachment 78611 [details, diff] sh.vim-paren-in-case.patch This fixes case $x in ')' ) echo "x is a paren";; esac I've upstreamed it; I'm just putting it here for completeness.