~gpanders/dotfiles

ref: 3dda0c8f7e604b248f6619aa6facbb05c7de9833 dotfiles/.vim/after/syntax/sh/awkembed.vim -rw-r--r-- 681 bytes
3dda0c8f — Gregory Anders vim: preserve current syntax in sh buffers 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
" AWK Embedding:
" ==============
" Shamelessly ripped from aspperl.vim by Aaron Hope.
"
" See :h sh-awk
if exists('b:current_syntax')
    let b:save_current_syntax = b:current_syntax
    unlet b:current_syntax
endif

syn include @AWKScript syntax/awk.vim
syn region AWKScriptCode matchgroup=AWKCommand start=+[=\\]\@<!'+ skip=+\\'+ end=+'+ contains=@AWKScript contained
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