diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-15 11:43:31 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-15 11:43:31 +1300 |
commit | 681348d2e808595cad8301355c2036ddec49c211 (patch) | |
tree | 001501fcd7c34c98c66eee02a7fb785bb4507dd3 /vim/after | |
parent | Merge branch 'hotfix/v0.17.2' into develop (diff) | |
parent | Coax sh.vim into accepting #/% param expansion (diff) | |
download | dotfiles-681348d2e808595cad8301355c2036ddec49c211.tar.gz dotfiles-681348d2e808595cad8301355c2036ddec49c211.zip |
Merge branch 'feature/vim-sh' into develop
* feature/vim-sh:
Coax sh.vim into accepting #/% param expansion
Diffstat (limited to 'vim/after')
-rw-r--r-- | vim/after/syntax/sh.vim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/vim/after/syntax/sh.vim b/vim/after/syntax/sh.vim index 8025c567..4d56d3a8 100644 --- a/vim/after/syntax/sh.vim +++ b/vim/after/syntax/sh.vim @@ -119,6 +119,21 @@ if exists('b:is_posix') syntax cluster shCaseList add=shRepeat syntax cluster shFunctionList add=shRepeat + " ${foo%bar}, ${foo%%bar}, ${foo#bar}, and ${foo##bar} are all valid forms + " of parameter expansion in POSIX, but sh.vim makes them conditional on + " Bash or Korn shell. We reinstate them (slightly adapted) here. + syn match shDerefOp contained + \ '##\|#\|%%\|%' + \ nextgroup=@shDerefPatternList + syn match shDerefPattern contained + \ '[^{}]\+' + \ contains=shDeref,shDerefSimple,shDerefPattern,shDerefString,shCommandSub,shDerefEscape + \ nextgroup=shDerefPattern + syn region shDerefPattern contained + \ start='{' end='}' + \ contains=shDeref,shDerefSimple,shDerefString,shCommandSub + \ nextgroup=shDerefPattern + endif " Some corrections for highlighting specific to the Bash mode |