diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-09-28 21:48:16 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-09-28 21:48:16 +0200 |
commit | d58a3bf7dac8d53faf42e13cc1152b110f12c404 (patch) | |
tree | 8718d3d947d850a9ee4492dbf98a4b2150c36a1f /runtime/syntax | |
parent | b45cd36bd90f71e4a35b1ef1f75a3bedef6d8bac (diff) | |
download | vim-git-d58a3bf7dac8d53faf42e13cc1152b110f12c404.tar.gz |
Update runtime files.
Diffstat (limited to 'runtime/syntax')
-rw-r--r-- | runtime/syntax/man.vim | 6 | ||||
-rw-r--r-- | runtime/syntax/sh.vim | 52 | ||||
-rw-r--r-- | runtime/syntax/vim.vim | 22 |
3 files changed, 50 insertions, 30 deletions
diff --git a/runtime/syntax/man.vim b/runtime/syntax/man.vim index 56f6d10de..4e08cd734 100644 --- a/runtime/syntax/man.vim +++ b/runtime/syntax/man.vim @@ -4,7 +4,7 @@ " Previous Maintainer: SungHyun Nam <goweol@gmail.com> " Previous Maintainer: Gautam H. Mudunuri <gmudunur@informatica.com> " Version Info: -" Last Change: 2020 Apr 30 +" Last Change: 2020 Sep 19 " Additional highlighting by Johannes Tanzler <johannes.tanzler@aon.at>: " * manSubHeading @@ -21,8 +21,8 @@ runtime! syntax/ctrlh.vim syn case ignore syn match manReference "\f\+([1-9][a-z]\=)" -syn match manSectionHeading "^[a-z][a-z -]*[a-z]$" -syn match manSubHeading "^\s\{3\}[a-z][a-z -]*[a-z]$" +syn match manSectionHeading "^\a.*$" +syn match manSubHeading "^\s\{3\}\a.*$" syn match manOptionDesc "^\s*[+-][a-z0-9]\S*" syn match manLongOptionDesc "^\s*--[a-z0-9-]\S*" " syn match manHistory "^[a-z].*last change.*$" diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim index 3a2a6e7b0..b66805633 100644 --- a/runtime/syntax/sh.vim +++ b/runtime/syntax/sh.vim @@ -2,8 +2,8 @@ " Language: shell (sh) Korn shell (ksh) bash (sh) " Maintainer: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM> " Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int> -" Last Change: Apr 14, 2020 -" Version: 190 +" Last Change: Aug 10, 2020 +" Version: 193 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH " For options and settings, please use: :help ft-sh-syntax " This file includes many ideas from Eric Brunet (eric.brunet@ens.fr) @@ -20,8 +20,8 @@ if getline(1) =~ '\<ksh$' elseif getline(1) =~ '\<bash$' let b:is_bash = 1 elseif getline(1) =~ '\<dash$' - let b:is_posix = 1 -elseif !exists("g:is_kornshell") && !exists("g:is_bash") && !exists("g:is_posix") && !exists("g:is_sh") + let b:is_dash = 1 +elseif !exists("g:is_kornshell") && !exists("g:is_bash") && !exists("g:is_posix") && !exists("g:is_sh") && !exists("g:is_dash") let s:shell = "" if executable("/bin/sh") let s:shell = resolve("/bin/sh") @@ -33,7 +33,7 @@ elseif !exists("g:is_kornshell") && !exists("g:is_bash") && !exists("g:is_posix" elseif s:shell =~ 'bash$' let b:is_bash = 1 elseif s:shell =~ 'dash$' - let b:is_posix = 1 + let b:is_dash = 1 endif unlet s:shell endif @@ -45,7 +45,7 @@ endif " So, when the user sets "g:is_bash", "g:is_kornshell", " or "g:is_posix", a b:is_sh is converted into b:is_bash/b:is_kornshell, " respectively. -if !exists("b:is_kornshell") && !exists("b:is_bash") +if !exists("b:is_kornshell") && !exists("b:is_bash") && !exists("b:is_dash") if exists("g:is_posix") && !exists("g:is_kornshell") let g:is_kornshell= g:is_posix endif @@ -59,11 +59,21 @@ if !exists("b:is_kornshell") && !exists("b:is_bash") if exists("b:is_sh") unlet b:is_sh endif + elseif exists("g:is_dash") + let b:is_dash= 1 + if exists("b:is_sh") + unlet b:is_sh + endif else let b:is_sh= 1 endif endif +" if b:is_dash, set b:is_posix too +if exists("b:is_dash") + let b:is_posix= 1 +endif + " set up default g:sh_fold_enabled {{{1 " ================================ if !exists("g:sh_fold_enabled") @@ -133,7 +143,7 @@ syn cluster shCurlyList contains=shNumber,shComma,shDeref,shDerefSimple,shDerefS " COMBAK: removing shEscape fromshDblQuoteList fails ksh04:43 syn cluster shDblQuoteList contains=shArithmetic,shCommandSub,shCommandSubBQ,shDeref,shDerefSimple,shPosnParm,shCtrlSeq,shSpecial,shSpecialDQ syn cluster shDerefList contains=shDeref,shDerefSimple,shDerefVar,shDerefSpecial,shDerefWordError,shDerefPSR,shDerefPPS -syn cluster shDerefVarList contains=shDerefOff,shDerefOp,shDerefVarArray,shDerefOpError +syn cluster shDerefVarList contains=shDerefOffset,shDerefOp,shDerefVarArray,shDerefOpError syn cluster shEchoList contains=shArithmetic,shCommandSub,shCommandSubBQ,shDeref,shDerefSimple,shEscape,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shCtrlSeq,shEchoQuote syn cluster shExprList1 contains=shCharClass,shNumber,shOperator,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shExpr,shDblBrace,shDeref,shDerefSimple,shCtrlSeq syn cluster shExprList2 contains=@shExprList1,@shCaseList,shTest @@ -358,7 +368,7 @@ elseif !exists("g:sh_no_error") endif syn region shSingleQuote matchgroup=shQuote start=+'+ end=+'+ contains=@Spell nextgroup=shSpecialStart,shSpecialSQ syn region shDoubleQuote matchgroup=shQuote start=+\%(\%(\\\\\)*\\\)\@<!"+ skip=+\\.+ end=+"+ contains=@shDblQuoteList,shStringSpecial,@Spell nextgroup=shSpecialStart -syn region shDoubleQuote matchgroup=shQuote start=+"+ matchgroup=shSpecial skip=+\\"+ end=+"+ contained contains=@shDblQuoteList,shStringSpecial,@Spell nextgroup=shSpecialStart +syn region shDoubleQuote matchgroup=shQuote start=+"+ matchgroup=shSpecial skip=+\\"+ matchgroup=shQuote end=+"+ contained contains=@shDblQuoteList,shStringSpecial,@Spell nextgroup=shSpecialStart syn match shStringSpecial "[^[:print:] \t]" contained syn match shStringSpecial "[^\\]\zs\%(\\\\\)*\\[\\"'`$()#]" nextgroup=shComment syn match shSpecialSQ "[^\\]\zs\%(\\\\\)*\\[\\"'`$()#]" contained nextgroup=shBkslshSnglQuote,@shNoZSList @@ -424,6 +434,9 @@ if exists("b:is_bash") syn region shSetList oneline matchgroup=shSet start="\<\%(set\|unset\)\>[/a-zA-Z_]\@!" end="\ze[;|#)]\|$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+=" contains=@shIdList nextgroup=shComment elseif exists("b:is_kornshell") || exists("b:is_posix") syn match shSet "^\s*set\ze\s\+$" + if exists("b:is_dash") + syn region shSetList oneline matchgroup=shSet start="\<\%(local\)\>\ze[/]\@!" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList + endif syn region shSetList oneline matchgroup=shSet start="\<\(export\)\>\ze[/]\@!" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList syn region shSetList oneline matchgroup=shSet start="\<\%(set\|unset\>\)\ze[/a-zA-Z_]\@!" end="\ze[;|#)]\|$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList nextgroup=shComment else @@ -471,14 +484,14 @@ endif " bash: ${!prefix*} and ${#parameter}: {{{1 " ==================================== if exists("b:is_bash") - syn region shDeref matchgroup=PreProc start="\${!" end="\*\=}" contains=@shDerefList,shDerefOff + syn region shDeref matchgroup=PreProc start="\${!" end="\*\=}" contains=@shDerefList,shDerefOffset syn match shDerefVar contained "{\@<=!\h\w*" nextgroup=@shDerefVarList endif if exists("b:is_kornshell") syn match shDerefVar contained "{\@<=!\h\w*[[:alnum:]_.]*" nextgroup=@shDerefVarList endif -syn match shDerefSpecial contained "{\@<=[-*@?0]" nextgroup=shDerefOp,shDerefOpError +syn match shDerefSpecial contained "{\@<=[-*@?0]" nextgroup=shDerefOp,shDerefOffset,shDerefOpError syn match shDerefSpecial contained "\({[#!]\)\@<=[[:alnum:]*@_]\+" nextgroup=@shDerefVarList,shDerefOp syn match shDerefVar contained "{\@<=\h\w*" nextgroup=@shDerefVarList syn match shDerefVar contained '\d' nextgroup=@shDerefVarList @@ -502,6 +515,7 @@ syn region shDerefVarArray contained matchgroup=shDeref start="\[" end="]" co " bash : ${parameter^^pattern} Case modification " bash : ${parameter,pattern} Case modification " bash : ${parameter,,pattern} Case modification +" bash : ${@:start:qty} display command line arguments from start to start+qty-1 (inferred) syn cluster shDerefPatternList contains=shDerefPattern,shDerefString if !exists("g:sh_no_error") syn match shDerefOpError contained ":[[:punct:]]" @@ -522,17 +536,19 @@ syn region shDerefString contained matchgroup=shDerefDelim start=+\%(\\\)\@<!'+ syn region shDerefString contained matchgroup=shDerefDelim start=+\%(\\\)\@<!"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial syn match shDerefString contained "\\["']" nextgroup=shDerefPattern -if exists("b:is_bash") - " bash : ${parameter:offset} - " bash : ${parameter:offset:length} - syn region shDerefOff contained start=':[^-=?+]' end='\ze:' end='\ze}' contains=shDeref,shDerefSimple,shDerefEscape nextgroup=shDerefLen,shDeref,shDerefSimple - syn region shDerefOff contained start=':\s-' end='\ze:' end='\ze}' contains=shDeref,shDerefSimple,shDerefEscape nextgroup=shDerefLen,shDeref,shDerefSimple +if exists("b:is_bash") || exists("b:is_kornshell") || exists("b:is_posix") + " bash ksh posix : ${parameter:offset} + " bash ksh posix : ${parameter:offset:length} + syn region shDerefOffset contained start=':[^-=?+]' end='\ze:' end='\ze}' contains=shDeref,shDerefSimple,shDerefEscape nextgroup=shDerefLen,shDeref,shDerefSimple + syn region shDerefOffset contained start=':\s-' end='\ze:' end='\ze}' contains=shDeref,shDerefSimple,shDerefEscape nextgroup=shDerefLen,shDeref,shDerefSimple syn match shDerefLen contained ":[^}]\+" contains=shDeref,shDerefSimple,shArithmetic +endif +if exists("b:is_bash") " bash : ${parameter//pattern/string} " bash : ${parameter//pattern} syn match shDerefPPS contained '/\{1,2}' nextgroup=shDerefPPSleft - syn region shDerefPPSleft contained start='.' skip=@\%(\\\\\)*\\/@ matchgroup=shDerefOp end='/' end='\ze}' nextgroup=shDerefPPSright contains=@shPPSLeftList + syn region shDerefPPSleft contained start='.' skip=@\%(\\\\\)*\\/@ matchgroup=shDerefOp end='/' end='\ze}' end='"' nextgroup=shDerefPPSright contains=@shPPSLeftList syn region shDerefPPSright contained start='.' skip=@\%(\\\\\)\+@ end='\ze}' contains=@shPPSRightList " bash : ${parameter/#substring/replacement} @@ -675,8 +691,8 @@ if !exists("skip_sh_syntax_inits") hi def link bashSpecialVariables shShellVariables hi def link bashStatement shStatement hi def link shCharClass shSpecial - hi def link shDerefOff shDerefOp - hi def link shDerefLen shDerefOff + hi def link shDerefOffset shDerefOp + hi def link shDerefLen shDerefOffset endif if exists("b:is_kornshell") || exists("b:is_posix") hi def link kshSpecialVariables shShellVariables diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 9b20392fa..d4dab09d4 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: Vim 8.0 script " Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz> -" Last Change: July 15, 2020 -" Version: 8.0-41 +" Last Change: Aug 30, 2020 +" Version: 8.0-43 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM " Automatically generated keyword lists: {{{1 @@ -236,7 +236,7 @@ endif " Functions : Tag is provided for those who wish to highlight tagged functions {{{2 " ========= syn cluster vimFuncList contains=vimCommand,vimFunctionError,vimFuncKey,Tag,vimFuncSID -syn cluster vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vim9Comment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimExecute,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimGlobal,vimHighlight,vimIsCommand,vimLet,vimLetHereDoc,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSearch,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUnmap,vimUserCommand +syn cluster vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vim9Comment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimEnvvar,vimExecute,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimGlobal,vimHighlight,vimIsCommand,vimLet,vimLetHereDoc,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSearch,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUnmap,vimUserCommand syn match vimFunction "\<\(fu\%[nction]\|def\)!\=\s\+\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)*\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f' @@ -266,7 +266,7 @@ syn match vimSpecFileMod "\(:[phtre]\)\+" contained " ======================= syn cluster vimUserCmdList contains=vimAddress,vimSyntax,vimHighlight,vimAutoCmd,vimCmplxRepeat,vimComment,vim9Comment,vimCtrlChar,vimEscapeBrace,vimFunc,vimFuncName,vimFunction,vimFunctionError,vimIsCommand,vimMark,vimNotation,vimNumber,vimOper,vimRegion,vimRegister,vimLet,vimSet,vimSetEqual,vimSetString,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange,vimSynLine syn keyword vimUserCommand contained com[mand] -syn match vimUserCmd "\<com\%[mand]!\=\>.*$" contains=vimUserAttrb,vimUserAttrbError,vimUserCommand,@vimUserCmdList +syn match vimUserCmd "\<com\%[mand]!\=\>.*$" contains=vimUserAttrb,vimUserAttrbError,vimUserCommand,@vimUserCmdList,vimComFilter syn match vimUserAttrbError contained "-\a\+\ze\s" syn match vimUserAttrb contained "-nargs=[01*?+]" contains=vimUserAttrbKey,vimOper syn match vimUserAttrb contained "-complete=" contains=vimUserAttrbKey,vimOper nextgroup=vimUserAttrbCmplt,vimUserCmdError @@ -295,12 +295,13 @@ syn match vimComment +\<endif\s\+".*$+lc=5 contains=@vimCommentGroup,vimCommentS syn match vimComment +\<else\s\+".*$+lc=4 contains=@vimCommentGroup,vimCommentString syn region vimCommentString contained oneline start='\S\s\+"'ms=e end='"' " Vim9 comments - TODO: might be highlighted while they don't work -syn match vim9Comment excludenl +^#[^{].*$+ contains=@vimCommentGroup,vimCommentString syn match vim9Comment excludenl +\s#[^{].*$+lc=1 contains=@vimCommentGroup,vimCommentString syn match vim9Comment +\<endif\s\+#[^{].*$+lc=5 contains=@vimCommentGroup,vimCommentString syn match vim9Comment +\<else\s\+#[^{].*$+lc=4 contains=@vimCommentGroup,vimCommentString " Vim9 comment inside expression syn match vim9Comment +\s\zs#[^{].*$+ms=s+1 contains=@vimCommentGroup,vimCommentString +syn match vim9Comment +^\s*#[^{].*$+ contains=@vimCommentGroup,vimCommentString +syn match vim9Comment +^\s*#$+ contains=@vimCommentGroup,vimCommentString " Environment Variables: {{{2 " ===================== @@ -370,7 +371,8 @@ syn match vimAddress ",\zs[.$]" skipwhite nextgroup=vimSubst1 syn match vimAddress "%\ze\a" skipwhite nextgroup=vimString,vimSubst1 syn match vimFilter "^!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile -syn match vimFilter contained "!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile +syn match vimFilter contained "!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile +syn match vimComFilter contained "|!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile " Complex Repeats: (:h complex-repeat) {{{2 " =============== @@ -386,7 +388,7 @@ syn match vimSetMod contained "&vim\=\|[!&?<]\|all&" " Let: {{{2 " === -syn keyword vimLet let unl[et] skipwhite nextgroup=vimVar,vimFuncVar,vimLetHereDoc +syn keyword vimLet let var unl[et] skipwhite nextgroup=vimVar,vimFuncVar,vimLetHereDoc VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='=<<\s\+\%(trim\>\)\=\s*\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\s*\z1\s*$' contains=vimComment,vim9Comment " Abbreviations: {{{2 @@ -397,8 +399,9 @@ syn keyword vimAbb ab[breviate] ca[bbrev] inorea[bbrev] cnorea[bbrev] norea[bbre " ======= syn match vimAutoEventList contained "\(!\s\+\)\=\(\a\+,\)*\a\+" contains=vimAutoEvent nextgroup=vimAutoCmdSpace syn match vimAutoCmdSpace contained "\s\+" nextgroup=vimAutoCmdSfxList -syn match vimAutoCmdSfxList contained "\S*" +syn match vimAutoCmdSfxList contained "\S*" skipwhite nextgroup=vimAutoCmdMod syn keyword vimAutoCmd au[tocmd] do[autocmd] doautoa[ll] skipwhite nextgroup=vimAutoEventList +syn match vimAutoCmdMod "\(++\)\=\(once\|nested\)" " Echo And Execute: -- prefer strings! {{{2 " ================ @@ -634,7 +637,7 @@ syn match vimCtrlChar "[--]" " Beginners - Patterns that involve ^ {{{2 " ========= syn match vimLineComment +^[ \t:]*".*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle -syn match vim9LineComment +^[ \t:]*#.*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle +syn match vim9LineComment +^[ \t]*#.*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle syn match vimCommentTitle '"\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vimCommentTitleLeader,vimTodo,@vimCommentGroup syn match vimContinue "^\s*\\" syn region vimString start="^\s*\\\z(['"]\)" skip='\\\\\|\\\z1' end="\z1" oneline keepend contains=@vimStringGroup,vimContinue @@ -861,6 +864,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimAutoCmdOpt vimOption hi def link vimAutoCmd vimCommand hi def link vimAutoEvent Type + hi def link vimAutoCmdMod Special hi def link vimAutoSet vimCommand hi def link vimBehaveModel vimBehave hi def link vimBehave vimCommand |