Syntax file updates. (Charles Campbell)
This commit is contained in:
@ -2,11 +2,11 @@
|
||||
" Language: shell (sh) Korn shell (ksh) bash (sh)
|
||||
" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
|
||||
" Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int>
|
||||
" Last Change: Apr 12, 2010
|
||||
" Version: 112
|
||||
" Last Change: Jul 29, 2010
|
||||
" Version: 113
|
||||
" URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
|
||||
" For options and settings, please use: :help ft-sh-syntax
|
||||
" This file includes many ideas from <EFBFBD>ric Brunet (eric.brunet@ens.fr)
|
||||
" This file includes many ideas from ?ric Brunet (eric.brunet@ens.fr)
|
||||
|
||||
" For version 5.x: Clear all syntax items {{{1
|
||||
" For version 6.x: Quit when a syntax file was already loaded
|
||||
@ -100,12 +100,12 @@ syn cluster shTestList contains=shCharClass,shComment,shCommandSub,shDeref,shDer
|
||||
" Echo: {{{1
|
||||
" ====
|
||||
" This one is needed INSIDE a CommandSub, so that `echo bla` be correct
|
||||
syn region shEcho matchgroup=shStatement start="\<echo\>" skip="\\$" matchgroup=shOperator end="$" matchgroup=NONE end="[<>;&|()]"me=e-1 end="\d[<>]"me=e-2 end="\s#"me=e-2 contains=@shEchoList skipwhite nextgroup=shQuickComment
|
||||
syn region shEcho matchgroup=shStatement start="\<print\>" skip="\\$" matchgroup=shOperator end="$" matchgroup=NONE end="[<>;&|()]"me=e-1 end="\d[<>]"me=e-2 end="\s#"me=e-2 contains=@shEchoList skipwhite nextgroup=shQuickComment
|
||||
syn region shEcho matchgroup=shStatement start="\<echo\>" skip="\\$" matchgroup=shEchoDelim end="$" matchgroup=NONE end="[<>;&|()]"me=e-1 end="\d[<>]"me=e-2 end="\s#"me=e-2 contains=@shEchoList skipwhite nextgroup=shQuickComment
|
||||
syn region shEcho matchgroup=shStatement start="\<print\>" skip="\\$" matchgroup=shEchoDelim end="$" matchgroup=NONE end="[<>;&|()]"me=e-1 end="\d[<>]"me=e-2 end="\s#"me=e-2 contains=@shEchoList skipwhite nextgroup=shQuickComment
|
||||
syn match shEchoQuote contained '\%(\\\\\)*\\["`'()]'
|
||||
|
||||
" This must be after the strings, so that ... \" will be correct
|
||||
syn region shEmbeddedEcho contained matchgroup=shStatement start="\<print\>" skip="\\$" matchgroup=shOperator end="$" matchgroup=NONE end="[<>;&|`)]"me=e-1 end="\d[<>]"me=e-2 end="\s#"me=e-2 contains=shNumber,shExSingleQuote,shSingleQuote,shDeref,shDerefSimple,shSpecialVar,shOperator,shDoubleQuote,shCharClass,shCtrlSeq
|
||||
syn region shEmbeddedEcho contained matchgroup=shStatement start="\<print\>" skip="\\$" matchgroup=shEchoDelim end="$" matchgroup=NONE end="[<>;&|`)]"me=e-1 end="\d[<>]"me=e-2 end="\s#"me=e-2 contains=shNumber,shExSingleQuote,shSingleQuote,shDeref,shDerefSimple,shSpecialVar,shOperator,shDoubleQuote,shCharClass,shCtrlSeq
|
||||
|
||||
" Alias: {{{1
|
||||
" =====
|
||||
@ -211,12 +211,12 @@ else
|
||||
endif
|
||||
syn keyword shCaseIn contained skipwhite skipnl in nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote
|
||||
if exists("b:is_bash")
|
||||
syn region shCaseExSingleQuote matchgroup=shOperator start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial,shSpecial skipwhite skipnl nextgroup=shCaseBar contained
|
||||
syn region shCaseExSingleQuote matchgroup=shQuote start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial,shSpecial skipwhite skipnl nextgroup=shCaseBar contained
|
||||
else
|
||||
syn region shCaseExSingleQuote matchgroup=Error start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained
|
||||
endif
|
||||
syn region shCaseSingleQuote matchgroup=shOperator start=+'+ end=+'+ contains=shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained
|
||||
syn region shCaseDoubleQuote matchgroup=shOperator start=+"+ skip=+\\\\\|\\.+ end=+"+ contains=@shDblQuoteList,shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained
|
||||
syn region shCaseSingleQuote matchgroup=shQuote start=+'+ end=+'+ contains=shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained
|
||||
syn region shCaseDoubleQuote matchgroup=shQuote start=+"+ skip=+\\\\\|\\.+ end=+"+ contains=@shDblQuoteList,shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained
|
||||
syn region shCaseCommandSub start=+`+ skip=+\\\\\|\\.+ end=+`+ contains=@shCommandSubList skipwhite skipnl nextgroup=shCaseBar contained
|
||||
syn region shCaseRange matchgroup=Delimiter start=+\[+ skip=+\\\\+ end=+]+ contained
|
||||
|
||||
@ -268,12 +268,12 @@ if exists("b:is_bash")
|
||||
syn match shSpecial "\\\o\o\o\|\\x\x\x\|\\c[^"]\|\\[abefnrtv]" contained
|
||||
endif
|
||||
if exists("b:is_bash")
|
||||
syn region shExSingleQuote matchgroup=shOperator start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial,shSpecial
|
||||
syn region shExSingleQuote matchgroup=shQuote start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial,shSpecial
|
||||
else
|
||||
syn region shExSingleQuote matchGroup=Error start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial
|
||||
endif
|
||||
syn region shSingleQuote matchgroup=shOperator start=+'+ end=+'+ contains=@Spell
|
||||
syn region shDoubleQuote matchgroup=shOperator start=+"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial,@Spell
|
||||
syn region shSingleQuote matchgroup=shQuote start=+'+ end=+'+ contains=@Spell
|
||||
syn region shDoubleQuote matchgroup=shQuote start=+"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial,@Spell
|
||||
syn match shStringSpecial "[^[:print:] \t]" contained
|
||||
syn match shStringSpecial "\%(\\\\\)*\\[\\"'`$()#]"
|
||||
syn match shSpecial "[^\\]\zs\%(\\\\\)*\\[\\"'`$()#]" nextgroup=shMoreSpecial
|
||||
@ -341,13 +341,13 @@ syn match shSetOption "\s\zs[-+][a-zA-Z0-9]\+\>" contained
|
||||
syn match shVariable "\<\([bwglsav]:\)\=[a-zA-Z0-9.!@_%+,]*\ze=" nextgroup=shSetIdentifier
|
||||
syn match shSetIdentifier "=" contained nextgroup=shPattern,shDeref,shDerefSimple,shDoubleQuote,shSingleQuote,shExSingleQuote
|
||||
if exists("b:is_bash")
|
||||
syn region shSetList oneline matchgroup=shSet start="\<\(declare\|typeset\|local\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shOperator end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+#\|=" contains=@shIdList
|
||||
syn region shSetList oneline matchgroup=shSet start="\<set\>\ze[^/]" end="\ze[;|)]\|$" matchgroup=shOperator end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList
|
||||
syn region shSetList oneline matchgroup=shSet start="\<\(declare\|typeset\|local\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+#\|=" contains=@shIdList
|
||||
syn region shSetList oneline matchgroup=shSet start="\<set\>\ze[^/]" end="\ze[;|)]\|$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList
|
||||
elseif exists("b:is_kornshell")
|
||||
syn region shSetList oneline matchgroup=shSet start="\<\(typeset\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shOperator end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList
|
||||
syn region shSetList oneline matchgroup=shSet start="\<set\>\ze[^/]" end="$" matchgroup=shOperator end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList
|
||||
syn region shSetList oneline matchgroup=shSet start="\<\(typeset\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList
|
||||
syn region shSetList oneline matchgroup=shSet start="\<set\>\ze[^/]" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList
|
||||
else
|
||||
syn region shSetList oneline matchgroup=shSet start="\<\(set\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shOperator end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList
|
||||
syn region shSetList oneline matchgroup=shSet start="\<\(set\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList
|
||||
endif
|
||||
|
||||
" Functions: {{{1
|
||||
@ -419,8 +419,8 @@ if exists("b:is_bash") || exists("b:is_kornshell")
|
||||
syn region shDerefPattern contained start="{" end="}" contains=shDeref,shDerefSimple,shDerefString,shCommandSub nextgroup=shDerefPattern
|
||||
syn match shDerefEscape contained '\%(\\\\\)*\\.'
|
||||
endif
|
||||
syn region shDerefString contained matchgroup=shOperator start=+\%(\\\)\@<!'+ end=+'+ contains=shStringSpecial
|
||||
syn region shDerefString contained matchgroup=shOperator start=+\%(\\\)\@<!"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial
|
||||
syn region shDerefString contained matchgroup=shDerefDelim start=+\%(\\\)\@<!'+ end=+'+ contains=shStringSpecial
|
||||
syn region shDerefString contained matchgroup=shDerefDelim start=+\%(\\\)\@<!"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial
|
||||
syn match shDerefString contained "\\["']" nextgroup=shDerefPattern
|
||||
|
||||
if exists("b:is_bash")
|
||||
@ -448,7 +448,7 @@ syn keyword shCondError elif else then
|
||||
" Useful ksh Keywords: {{{1
|
||||
" ====================
|
||||
if exists("b:is_kornshell") || exists("b:is_bash")
|
||||
syn keyword shStatement autoload bg false fc fg functions getopts hash history integer jobs let nohup print printf r stop suspend times true type unalias whence
|
||||
syn keyword shStatement autoload bg false fc fg functions getopts hash history integer jobs let nohup printf r stop suspend times true type unalias whence
|
||||
if exists("g:is_posix")
|
||||
syn keyword shStatement command
|
||||
else
|
||||
@ -492,6 +492,7 @@ hi def link shCaseBar shConditional
|
||||
hi def link shCaseCommandSub shCommandSub
|
||||
hi def link shCaseDoubleQuote shDoubleQuote
|
||||
hi def link shCaseIn shConditional
|
||||
hi def link shQuote shOperator
|
||||
hi def link shCaseSingleQuote shSingleQuote
|
||||
hi def link shCaseStart shConditional
|
||||
hi def link shCmdSubRegion shShellVariables
|
||||
@ -500,12 +501,14 @@ hi def link shDerefOp shOperator
|
||||
hi def link shDerefPOL shDerefOp
|
||||
hi def link shDerefPPS shDerefOp
|
||||
hi def link shDeref shShellVariables
|
||||
hi def link shDerefDelim shOperator
|
||||
hi def link shDerefSimple shDeref
|
||||
hi def link shDerefSpecial shDeref
|
||||
hi def link shDerefString shDoubleQuote
|
||||
hi def link shDerefVar shDeref
|
||||
hi def link shDoubleQuote shString
|
||||
hi def link shEcho shString
|
||||
hi def link shEchoDelim shOperator
|
||||
hi def link shEchoQuote shString
|
||||
hi def link shEmbeddedEcho shString
|
||||
hi def link shEscape shCommandSub
|
||||
@ -522,6 +525,7 @@ hi def link shPosnParm shShellVariables
|
||||
hi def link shQuickComment shComment
|
||||
hi def link shRange shOperator
|
||||
hi def link shRedir shOperator
|
||||
hi def link shSetListDelim shOperator
|
||||
hi def link shSetOption shOption
|
||||
hi def link shSingleQuote shString
|
||||
hi def link shSource shOperator
|
||||
|
||||
Reference in New Issue
Block a user