~gpanders/dotfiles

3dda0c8f7e604b248f6619aa6facbb05c7de9833 — Gregory Anders 3 months ago 1e9f8dd
vim: preserve current syntax in sh buffers
1 files changed, 4 insertions(+), 0 deletions(-)

M .vim/after/syntax/sh/awkembed.vim
M .vim/after/syntax/sh/awkembed.vim => .vim/after/syntax/sh/awkembed.vim +4 -0
@@ 4,6 4,7 @@
"
" See :h sh-awk
if exists('b:current_syntax')
    let b:save_current_syntax = b:current_syntax
    unlet b:current_syntax
endif



@@ 12,3 13,6 @@ syn region AWKScriptCode matchgroup=AWKCommand start=+[=\\]\@<!'+ skip=+\\'+ end
syn region AWKScriptEmbedded matchgroup=AWKCommand start=+\<awk\>+ skip=+\\$+ end=+[=\\]\@<!'+me=e-1 contains=@shIdList,@shExprList2 nextgroup=AWKScriptCode
syn cluster shCommandSubList add=AWKScriptEmbedded
hi def link AWKCommand Type

let b:current_syntax = b:save_current_syntax
unlet b:save_current_syntax