From 22f6b9d11fbe19c1ac2125d83e220ac40831ddbc Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 29 Sep 2025 09:14:19 +0800 Subject: [PATCH 1/7] vim-patch:72473ce: runtime(vim): Update base syntax, match generic functions Match Vim9 generic functions, added in vim/vim#17313. closes: vim/vim#17722 https://github.com/vim/vim/commit/72473ce9f8e111072360a7589e2c5bee079305da Co-authored-by: Doug Kearns --- runtime/syntax/vim.vim | 68 ++++++++++++++++++++++++++++++++---------- 1 file changed, 53 insertions(+), 15 deletions(-) diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index ec4c644bb8..33133f4335 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -257,6 +257,8 @@ syn match vimVimVar "\\|[bwglstav]:\)\=\%([[:alnum:]_#.]\+\|{.\{-1,}}\)\+" - \ nextgroup=vimDefParams,vimCmdSep,vimComment,vim9Comment + \ nextgroup=vimDefTypeParams,vimDefParams,vimCmdSep,vimComment,vim9Comment \ contains=vimFunctionError,vimFunctionScope,vimFunctionSID,Tag syn match vimFunction "\" skipwhite nextgroup=vimFunctionBang,vimFunctionName,vimFunctionPattern,vimCmdSep,vimComment @@ -492,8 +494,15 @@ syn region vimDefParams contained \ end=")" \ skipwhite skipempty nextgroup=vimDefBody,vimDefComment,vimEnddef,vimReturnType,vimCommentError \ contains=vimDefParam,vim9Comment,vimFunctionParamEquals,vimOperParen +syn region vimDefTypeParams contained + \ matchgroup=Delimiter + \ start="<" + \ end=">" + \ nextgroup=vimDefParams + \ contains=vim9DefTypeParam syn match vimFunctionParam contained "\<\h\w*\>\|\.\.\." skipwhite nextgroup=vimFunctionParamEquals syn match vimDefParam contained "\<\h\w*\>" skipwhite nextgroup=vimParamType,vimFunctionParamEquals +syn match vim9DefTypeParam contained "\<\u\w*\>" syn match vimFunctionParamEquals contained "=" skipwhite nextgroup=@vimExprList syn match vimFunctionMod contained "\<\%(abort\|closure\|dict\|range\)\>" skipwhite skipempty nextgroup=vimFunctionBody,vimFunctionComment,vimEndfunction,vimFunctionMod,vim9CommentError @@ -525,7 +534,7 @@ if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f' syn region vimDefFold \ start="\" skipwhite nextgroup=vim9MethodDefName,vim9ConstructorDefName - syn match vim9MethodDefName contained "\<\h\w*\>" nextgroup=vim9MethodDefParams contains=@vim9MethodName + syn match vim9MethodDefName contained "\<\h\w*\>" nextgroup=vim9MethodDefParams,vim9MethodDefTypeParams contains=@vim9MethodName syn region vim9MethodDefParams contained \ matchgroup=Delimiter start="(" end=")" \ skipwhite skipnl nextgroup=vim9MethodDefBody,vim9MethodDefComment,vimEnddef,vim9MethodDefReturnType,vimCommentError \ contains=vimDefParam,vim9Comment,vimFunctionParamEquals + syn region vim9MethodDefTypeParams contained + \ matchgroup=Delimiter + \ start="<" + \ end=">" + \ nextgroup=vim9MethodDefParams + \ contains=vim9DefTypeParam syn match vim9ConstructorDefName contained "\<_\=new\w*\>" - \ nextgroup=vim9ConstructorDefParams + \ nextgroup=vim9ConstructorDefParams,vim9ConstuctorDefTypeParams \ contains=@vim9MethodName syn match vim9ConstructorDefParam contained "\<\%(this\.\)\=\h\w*\>" \ skipwhite nextgroup=vimParamType,vimFunctionParamEquals @@ -583,6 +598,12 @@ if s:vim9script \ matchgroup=Delimiter start="(" end=")" \ skipwhite skipnl nextgroup=vim9MethodDefBody,vim9MethodDefComment,vimEnddef,vimCommentError \ contains=vim9ConstructorDefParam,vim9Comment,vimFunctionParamEquals + syn region vim9ConstuctorDefTypeParams contained + \ matchgroup=Delimiter + \ start="<" + \ end=">" + \ nextgroup=vim9ConstructorDefParams + \ contains=vim9DefTypeParam syn region vim9MethodDefReturnType contained \ start=":\%(\s\|\n\)\@=" @@ -616,8 +637,11 @@ if s:vim9script syn cluster vim9MethodName contains=vim9MethodName,vim9MethodNameError if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f' - syn region vim9MethodDefFold contained start="\%(^\s*\%(:\=static\s\+\)\=\)\@16<=:\=def\s\+\h\i*(" end="^\s*:\=enddef\>" contains=vim9MethodDef fold keepend extend transparent - syn region vim9MethodDefFold contained start="^\s*:\=def\s\+_\=new\i*(" end="^\s*:\=enddef\>" contains=vim9MethodDef fold keepend extend transparent + syn region vim9MethodDefFold contained + \ start="\%(^\s*\%(:\=static\s\+\)\=\)\@16<=:\=def\s\+\h\w*[<(]" + \ end="^\s*:\=enddef\>" + \ contains=vim9MethodDef + \ fold keepend extend transparent endif syn cluster vim9MethodDef contains=vim9MethodDef,vim9MethodDefFold @@ -697,7 +721,7 @@ if s:vim9script syn match vim9InterfaceName contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9Extends syn keyword vim9AbstractDef contained def skipwhite nextgroup=vim9AbstractDefName - syn match vim9AbstractDefName contained "\<\h\w*\>" skipwhite nextgroup=vim9AbstractDefParams contains=@vim9MethodName + syn match vim9AbstractDefName contained "\<\h\w*\>" skipwhite nextgroup=vim9AbstractDefParams,vim9AbstractDefTypeParams contains=@vim9MethodName syn region vim9AbstractDefParams contained \ matchgroup=Delimiter start="(" end=")" \ skipwhite skipnl nextgroup=vimDefComment,vim9AbstractDefReturnType,vimCommentError @@ -707,6 +731,12 @@ if s:vim9script \ skipwhite skipnl nextgroup=vimDefComment,vimCommentError \ contains=vimTypeSep \ transparent + syn region vim9AbstractDefTypeParams contained + \ matchgroup=Delimiter + \ start="<" + \ end=">" + \ nextgroup=vim9AbstractDefParams + \ contains=vim9DefTypeParam VimFoldi syn region vim9InterfaceBody start="\" matchgroup=vimCommand end="\" contains=@vim9InterfaceBodyList transparent @@ -1444,7 +1474,7 @@ syn match vimBracket contained "[\\<>]" syn case match " User Command Highlighting: {{{2 -syn match vimUsrCmd '^\s*\zs\u\%(\w*\)\@>\%([.(#[]\|\s\+\%([-+*/%]\=\|\.\.\)=\)\@!' +syn match vimUsrCmd '^\s*\zs\u\%(\w*\)\@>\%([<.(#[]\|\s\+\%([-+*/%]\=\|\.\.\)=\)\@!' " Vim user commands @@ -2115,18 +2145,26 @@ unlet s:interfaces " Function Call Highlighting: {{{2 " (following Gautam Iyer's suggestion) " ========================== -syn match vimFunc contained "\<\l\w*\ze\s*(" skipwhite nextgroup=vimOperParen contains=vimFuncName -syn match vimUserFunc contained "\.\@1<=\l\w*\ze\s*(" skipwhite nextgroup=vimOperParen -syn match vimUserFunc contained "\<\%([[:upper:]_]\|\%(\h\w*\.\)\+\h\)\w*\ze\s*(" skipwhite nextgroup=vimOperParen contains=vim9MethodName,vim9Super,vim9This -syn match vimUserFunc contained "\<\%(g:\)\=\%(\h\w*#\)\+\h\w*\ze\s*(" skipwhite nextgroup=vimOperParen contains=vimVarScope -syn match vimUserFunc contained "\%(\<[sgbwtlav]:\|<[sS][iI][dD]>\)\%(\h\w*\.\)*\h\w*\ze\s*(" skipwhite nextgroup=vimOperParen contains=vimVarScope,vimNotation +syn match vimFunc contained "\<\l\w*\ze\s*(" skipwhite nextgroup=vimOperParen contains=vimFuncName +syn match vimUserFunc contained "\.\@1<=\l\w*\ze\%(\s*(\|<.*>(\)" skipwhite nextgroup=vimOperParen,vim9TypeArgs +syn match vimUserFunc contained "\<\%([[:upper:]_]\|\%(\h\w*\.\)\+\h\)\w*\ze\%(\s*(\|<.*>(\)" skipwhite nextgroup=vimOperParen,vim9TypeArgs contains=vim9MethodName,vim9Super,vim9This +syn match vimUserFunc contained "\<\%(g:\)\=\%(\h\w*#\)\+\h\w*\ze\%(\s*(\|<.*>(\)" skipwhite nextgroup=vimOperParen contains=vimVarScope +syn match vimUserFunc contained "\%(\<[sgbwtlav]:\|<[sS][iI][dD]>\)\%(\h\w*\.\)*\h\w*\ze\%(\s*(\|<.*>(\)" skipwhite nextgroup=vimOperParen,vim9TypeArgs contains=vimVarScope,vimNotation -Vim9 syn match vim9UserFunc "^\s*\zs\%([sgbwtv]:\|<[sS][iI][dD]>\)\=\%(\h\w*[.#]\)*\h\w*\ze(" skipwhite nextgroup=vimOperParen contains=vimVarScope,vimNotation,vim9MethodName,vim9Super,vim9This -Vim9 syn match vim9Func "^\s*\zs\l\w*\ze(" skipwhite nextgroup=vimOperParen contains=vimFuncName +Vim9 syn match vim9UserFunc "^\s*\zs\%([sgbwtv]:\|<[sS][iI][dD]>\)\=\%(\h\w*[.#]\)*\h\w*\ze[<(]" skipwhite nextgroup=vimOperParen,vim9TypeArgs contains=vimVarScope,vimNotation,vim9MethodName,vim9Super,vim9This +Vim9 syn match vim9Func "^\s*\zs\l\w*\ze(" skipwhite nextgroup=vimOperParen contains=vimFuncName syn cluster vimFunc contains=vimFunc,vimUserFunc syn cluster vim9Func contains=vim9Func,vim9UserFunc +syn region vim9TypeArgs contained + \ matchgroup=Delimiter + \ start="<\ze\a" + \ end=">" + \ nextgroup=vimOperParen + \ contains=@vimType + \ oneline + " Beginners - Patterns that involve ^ {{{2 " ========= Vim9 syn region vim9LineComment start=+^[ \t:]*\zs#.*$+ skip=+\n\s*\\\|\n\s*#\\ + end="$" contains=@vimCommentGroup,vimCommentString,vim9CommentTitle extend From 0ebb2ec4e43df20a48104407a601aafeeccbb360 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 29 Sep 2025 09:15:03 +0800 Subject: [PATCH 2/7] vim-patch:4de931d: runtime(vim): Update base syntax, match enum constructor type args closes: vim/vim#17840 https://github.com/vim/vim/commit/4de931daae88784aacd1dc4ecd92ca6fb4a45977 Co-authored-by: Doug Kearns Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com> --- runtime/syntax/vim.vim | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 33133f4335..ec9c5e1ce5 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -692,12 +692,19 @@ if s:vim9script syn cluster vim9EnumNameContinue contains=vim9EnumNameContinue,vim9EnumNameContinueComment " enforce enum value list location - syn match vim9EnumValue contained "\<\a\w*\>" nextgroup=vim9EnumValueArgList,vim9EnumValueListComma,vim9Comment + syn match vim9EnumValue contained "\<\a\w*\>" nextgroup=vim9EnumValueTypeArgs,vim9EnumValueArgList,vim9EnumValueListComma,vim9Comment syn match vim9EnumValueListComma contained "," skipwhite skipempty nextgroup=vim9EnumValue,vim9EnumValueListCommaComment syn region vim9EnumValueListCommaComment contained \ start="#" skip="\n\s*\%(\\\|#\\ \)" end="$" \ skipwhite skipempty nextgroup=vim9EnumValueListCommaComment,vim9EnumValue \ contains=@vimCommentGroup,vimCommentString + syn region vim9EnumValueTypeArgs contained + \ matchgroup=Delimiter + \ start="<\ze\a" + \ end=">" + \ nextgroup=vim9EnumValueArgList + \ contains=@vimType + \ oneline syn region vim9EnumValueArgList contained \ matchgroup=vimParenSep start="(" end=")" \ nextgroup=vim9EnumValueListComma From 6b0365ae2f8b5e1d2b3e5e3a6a49c1d16d80ffa3 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 29 Sep 2025 09:15:31 +0800 Subject: [PATCH 3/7] vim-patch:6f97624: runtime(vim): Update base syntax, fix Vim9 :for loop variable highlighting Highlight the iteration variable's type in Vim9 :for {var} loops. Reported by Aliaksei Budavei. fixes: vim/vim#17961 closes: vim/vim#18163 https://github.com/vim/vim/commit/6f97624e115eb793e5b486244683ecb86959d859 Co-authored-by: Doug Kearns --- runtime/syntax/vim.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index ec9c5e1ce5..5728739a8d 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -1161,7 +1161,7 @@ syn region vimFor \ matchgroup=vimCommand \ start="\" end="\" \ skipwhite skipnl nextgroup=@vimForInContinue,vim9ForInComment,@vimExprList - \ contains=@vimContinue,vimVar,vimVarList,vim9VariableList + \ contains=@vimContinue,vimVar,vimVarList,vim9Variable,vim9VariableList \ transparent syn match vim9ForInComment contained "#.*" skipwhite skipempty nextgroup=vimForInComment,@vimExprList From e9d8d1b061e2adbb03259d9885591ed80594b8b1 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 29 Sep 2025 09:16:30 +0800 Subject: [PATCH 4/7] vim-patch:57d243e: runtime(vim): Update base syntax, fix indented Vim9 :redir highlighting Include post operator whitespace in the Vim9 variable assignment lookahead so that "redir =>" doesn't match as an assignment. fixes: vim/vim#18319 closes: vim/vim#18323 https://github.com/vim/vim/commit/57d243e27da804489e256add0398efb9310a4353 Co-authored-by: Doug Kearns --- runtime/syntax/vim.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 5728739a8d..153fdcdbeb 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -259,9 +259,9 @@ syn cluster vimSpecialVar contains=vimEnvvar,vimLetRegister,vimOptionVar,vimVimV Vim9 syn match vimVar contained "\<\h\w*\ze<" nextgroup=vim9TypeArgs -Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s\+[-+/*%]\==" -Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s\+\.\.=" -Vim9 syn match vim9LhsVariable "\s\=\%([bwgt]:\)\=\h[a-zA-Z0-9#_]*\ze\s\+=<<" skipwhite nextgroup=vimLetHeredoc contains=vimVarScope +Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s\+[-+/*%]\==\%(\s\|$\)" +Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s\+\.\.=\%(\s\|$\)" +Vim9 syn match vim9LhsVariable "\s\=\%([bwgt]:\)\=\h[a-zA-Z0-9#_]*\ze\s\+=<<\s" skipwhite nextgroup=vimLetHeredoc contains=vimVarScope Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\[" nextgroup=vimSubscript Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\." nextgroup=vimOper contains=vim9Super,vim9This Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s*->" contains=vim9Super,vim9This From 2cd899f73092eb8570fb7fcd8b4b6771a13ffc86 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 29 Sep 2025 09:16:59 +0800 Subject: [PATCH 5/7] vim-patch:7bb733f: runtime(vim): Update base syntax, match null_tuple literal closes: vim/vim#18404 https://github.com/vim/vim/commit/7bb733f6bf727efe3455c3355a38430ee9cd9cc7 Co-authored-by: Doug Kearns --- runtime/syntax/vim.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 153fdcdbeb..25bac87660 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -213,7 +213,7 @@ endif " Nulls {{{2 " ===== -Vim9 syn keyword vim9Null null null_blob null_channel null_class null_dict null_function null_job null_list null_object null_partial null_string +Vim9 syn keyword vim9Null null null_blob null_channel null_class null_dict null_function null_job null_list null_object null_partial null_string null_tuple " Booleans {{{2 " ======== From 7c9a4a2a713539c3b7508ed87dd01016bb75bee4 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 29 Sep 2025 09:17:35 +0800 Subject: [PATCH 6/7] vim-patch:f4a6acd: runtime(vim): Update base syntax, allow Vim9 :echo tail comments - Match comments after Vim9 :echo and :execute. - Match comments after Vim9 and legacy :eval. closes: vim/vim#18420 https://github.com/vim/vim/commit/f4a6acd86edfdaf0f2c1fc4fb0c6533069d0469e Co-authored-by: Doug Kearns --- runtime/syntax/vim.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 25bac87660..584b5b6971 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -1272,7 +1272,7 @@ syn region vimEcho \ end="\ze|" \ excludenl end="$" \ nextgroup=vimCmdSep - \ contains=@vimContinue,@vimExprList + \ contains=@vimContinue,@vimExprList,vim9Comment \ transparent syn match vimEchohl "\" skipwhite nextgroup=vimGroup,vimHLGroup,vimEchohlNone,vimOnlyHLGroup,nvimHLGroup @@ -1289,7 +1289,7 @@ syn region vimExecute \ end="\ze|" \ excludenl end="$" \ nextgroup=vimCmdSep - \ contains=@vimContinue,@vimExprList + \ contains=@vimContinue,@vimExprList,vim9Comment \ transparent syn region vimEval @@ -1299,7 +1299,7 @@ syn region vimEval \ end="\ze|" \ excludenl end="$" \ nextgroup=vimCmdSep - \ contains=@vimContinue,@vimExprList + \ contains=@vimContinue,@vimExprList,vimComment,vim9Comment \ transparent " Filter: {{{2 From 11b6fcdfa6a6b25047debd4d260dddc66c5b50da Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 29 Sep 2025 09:19:33 +0800 Subject: [PATCH 7/7] vim-patch:ae20d73: runtime(vim): Update base syntax, improve line-continuation skip patterns Factor out the common prefix in line-continuation :syn-skip patterns. closes: vim/vim#18416 https://github.com/vim/vim/commit/ae20d732ae691793297139f688936c602c674999 Co-authored-by: Doug Kearns --- runtime/syntax/vim.vim | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 584b5b6971..8aa7532120 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -548,7 +548,7 @@ syn match vimDelfunction "\" skipwhite nextgroup=vimDelfunct syn region vimReturnType contained \ start=":\%(\s\|\n\)\@=" - \ skip=+\n\s*\\\|\n\s*#\\ \|^\s*#\\ + + \ skip=+\n\s*\%(\\\|#\\ \)\|^\s*#\\ + \ end="$" \ matchgroup=vim9Comment "\ allow for legacy script tail comment error @@ -607,7 +607,7 @@ if s:vim9script syn region vim9MethodDefReturnType contained \ start=":\%(\s\|\n\)\@=" - \ skip=+\n\s*\\\|\n\s*#\\ \|^\s*#\\ + + \ skip=+\n\s*\%(\\\|#\\ \)\|^\s*#\\ + \ end="$" \ matchgroup=vim9Comment \ end="\ze#" @@ -617,7 +617,7 @@ if s:vim9script syn region vim9MethodDefComment contained \ start="#.*" - \ skip=+\n\s*\\\|\n\s*#\\ + + \ skip=+\n\s*\%(\\\|#\\ \)+ \ end="$" \ skipwhite skipempty nextgroup=vim9MethodDefBody,vimEnddef @@ -1070,7 +1070,7 @@ syn region vimLetVarSubscript contained VimL syn keyword vimUnlet unl[et] skipwhite nextgroup=vimUnletBang,vimUnletVars syn match vimUnletBang contained "\a\@1<=!" skipwhite nextgroup=vimUnletVars syn region vimUnletVars contained - \ start="$\I\|\h" skip=+\n\s*\\\|\n\s*"\\ \|^\s*"\\ + end="$" end="\ze[|"]" + \ start="$\I\|\h" skip=+\n\s*\%(\\\|"\\ \)\|^\s*"\\ + end="$" end="\ze[|"]" \ nextgroup=vimCmdSep,vimComment \ contains=@vimContinue,vimEnvvar,vimVar,vimVimVar @@ -1145,7 +1145,7 @@ syn keyword vimUnlockvar unlo[ckvar] skipwhite nextgroup=vimLockvarBang,vimLockv syn match vimLockvarBang contained "\a\@1<=!" skipwhite nextgroup=vimLockvarVars syn match vimLockvarDepth contained "\<[0-3]\>" skipwhite nextgroup=vimLockvarVars syn region vimLockvarVars contained - \ start="\h" skip=+\n\s*\\\|\n\s*"\\ \|^\s*"\\ + end="$" end="\ze[|"]" + \ start="\h" skip=+\n\s*\%(\\\|"\\ \)\|^\s*"\\ + end="$" end="\ze[|"]" \ nextgroup=vimCmdSep,vimComment \ contains=@vimContinue,vimVar @@ -1432,8 +1432,8 @@ syn case match " GEN_SYN_VIM: vimCommand menu, START_STR='syn keyword vimMenu', END_STR='skipwhite nextgroup=vimMenuBang,vimMenuMod,vimMenuName,vimMenuPriority,vimMenuStatus' syn keyword vimMenu am[enu] an[oremenu] aun[menu] cme[nu] cnoreme[nu] cunme[nu] ime[nu] inoreme[nu] iunme[nu] me[nu] nme[nu] nnoreme[nu] noreme[nu] nunme[nu] ome[nu] onoreme[nu] ounme[nu] sme[nu] snoreme[nu] sunme[nu] tlm[enu] tln[oremenu] tlu[nmenu] tm[enu] tu[nmenu] unme[nu] vme[nu] vnoreme[nu] vunme[nu] xme[nu] xnoreme[nu] xunme[nu] skipwhite nextgroup=vimMenuBang,vimMenuMod,vimMenuName,vimMenuPriority,vimMenuStatus syn keyword vimMenu popu[p] skipwhite nextgroup=vimMenuBang,vimMenuName -syn region vimMenuRhs contained contains=@vimContinue,vimNotation start="|\@!\S" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + end="$" matchgroup=vimSep end="|" -syn region vimMenuRhsContinue contained contains=@vimContinue,vimNotation start=+^\s*\%(\\\|"\\ \)+ skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + end="$" matchgroup=vimSep end="|" +syn region vimMenuRhs contained contains=@vimContinue,vimNotation start="|\@!\S" skip=+\\\\\|\\|\|\n\s*\%(\\\|"\\ \)+ end="$" matchgroup=vimSep end="|" +syn region vimMenuRhsContinue contained contains=@vimContinue,vimNotation start=+^\s*\%(\\\|"\\ \)+ skip=+\\\\\|\\|\|\n\s*\%(\\\|"\\ \)+ end="$" matchgroup=vimSep end="|" syn match vimMenuName "\.\@!\%(\\\s\|\S\)\+" contained contains=vimMenuNotation,vimNotation skipwhite nextgroup=vimCmdSep,vimMenuRhs syn match vimMenuName "\.\@!\%(\\\s\|\S\)\+\ze\s*$" contained contains=vimMenuNotation,vimNotation skipwhite skipnl nextgroup=vimCmdSep,vimMenuRhsContinue syn match vimMenuNotation "&\a\|&&\|\\\s\|\\\." contained @@ -1444,7 +1444,7 @@ syn match vimMenuBang "\a\@1<=!" contained skipwhite nextgroup=vimMenuName,vimMe syn region vimMenutranslate \ matchgroup=vimCommand start="\" - \ skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + + \ skip=+\\\\\|\\|\|\n\s*\%(\\\|"\\ \)+ \ end="$" matchgroup=vimCmdSep end="|" matchgroup=vimMenuClear end="\!\=" skipwhite nextgroup=vimNormalArg contains=vimBang -syn region vimNormalArg contained start="\S" skip=+\n\s*\\\|\n\s*["#]\\ + end="$" contains=@vimContinue +syn region vimNormalArg contained start="\S" skip=+\n\s*\%(\\\|["#]\\ \)+ end="$" contains=@vimContinue " Profile: {{{2 " ======= @@ -1624,7 +1624,7 @@ Vim9 syn match vimWincmd "\s\=\\ze\s\+=\s*\%([#|]\|$\)" skipwhite n " Syntax: {{{2 "======= syn match vimGroupList contained "[^[:space:],]\+\%(\s*,\s*[^[:space:],]\+\)*" contains=vimGroupSpecial -syn region vimGroupList contained start=/^\s*["#]\\ \|^\s*\\\|[^[:space:],]\+\s*,/ skip=/\s*\n\s*\\\|\s*\n\s*["#]\\ \|^\s*\\\|^\s*["#]\\ / end=/[^[:space:],]\s*$\|[^[:space:],]\ze\s\+\w/ contains=@vimContinue,vimGroupSpecial +syn region vimGroupList contained start=/^\s*["#]\\ \|^\s*\\\|[^[:space:],]\+\s*,/ skip=/\s*\n\s*\%(\\\|["#]\\ \)\|^\s*\%(\\\|["#]\\ \)/ end=/[^[:space:],]\s*$\|[^[:space:],]\ze\s\+\w/ contains=@vimContinue,vimGroupSpecial syn keyword vimGroupSpecial contained ALL ALLBUT CONTAINED TOP if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsynerror") @@ -1655,7 +1655,7 @@ syn keyword vimSynType contained clear skipwhite nextgroup=vimGroupList " Syntax: cluster {{{2 syn keyword vimSynType contained cluster skipwhite nextgroup=vimClusterName -syn region vimClusterName contained keepend matchgroup=vimGroupName start="\h\w*\>" skip=+\\\\\|\\\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="$\||" contains=@vimContinue,vimGroupAdd,vimGroupRem,vimSynContains,vimSynError +syn region vimClusterName contained keepend matchgroup=vimGroupName start="\h\w*\>" skip=+\\\\\|\\\|\n\s*\%(\\\|"\\ \)+ matchgroup=vimCmdSep end="$\||" contains=@vimContinue,vimGroupAdd,vimGroupRem,vimSynContains,vimSynError syn match vimGroupAdd contained keepend "\" " Syntax: match {{{2 syn cluster vimSynMtchGroup contains=@vimContinue,vimSynCchar,vimSynContains,vimSynError,vimSynMtchOpt,vimSynNextgroup,vimSynRegPat,vimNotation,vimMtchComment syn keyword vimSynType contained match skipwhite nextgroup=vimSynMatchRegion -syn region vimSynMatchRegion contained keepend matchgroup=vimGroupName start="\h\w*\>" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|\|$" contains=@vimSynMtchGroup +syn region vimSynMatchRegion contained keepend matchgroup=vimGroupName start="\h\w*\>" skip=+\\\\\|\\|\|\n\s*\%(\\\|"\\ \)+ matchgroup=vimCmdSep end="|\|$" contains=@vimSynMtchGroup syn match vimSynMtchOpt contained "\%#=1\<\%(conceal\|transparent\|contained\|excludenl\|keepend\|skipempty\|skipwhite\|display\|extend\|skipnl\|fold\)\>" " Syntax: off and on {{{2 @@ -1701,11 +1701,11 @@ syn keyword vimSynType contained enable list manual off on reset syn cluster vimSynRegPatGroup contains=@vimContinue,vimPatSep,vimNotPatSep,vimSynPatRange,vimSynNotPatRange,vimSubstSubstr,vimPatRegion,vimPatSepErr,vimNotation syn cluster vimSynRegGroup contains=@vimContinue,vimSynCchar,vimSynContains,vimSynNextgroup,vimSynRegOpt,vimSynReg,vimSynMtchGrp syn keyword vimSynType contained region skipwhite nextgroup=vimSynRegion -syn region vimSynRegion contained keepend matchgroup=vimGroupName start="\h\w*" skip=+\\\\\|\\\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|\|$" contains=@vimSynRegGroup +syn region vimSynRegion contained keepend matchgroup=vimGroupName start="\h\w*" skip=+\\\\\|\\\|\n\s*\%(\\\|"\\ \)+ matchgroup=vimCmdSep end="|\|$" contains=@vimSynRegGroup syn match vimSynRegOpt contained "\%#=1\<\%(conceal\%(ends\)\=\|transparent\|contained\|excludenl\|skipempty\|skipwhite\|display\|keepend\|oneline\|extend\|skipnl\|fold\)\>" syn match vimSynReg contained "\<\%(start\|skip\|end\)=" nextgroup=vimSynRegPat syn match vimSynMtchGrp contained "matchgroup=" nextgroup=vimGroup,vimHLGroup,vimOnlyHLGroup,nvimHLGroup -syn region vimSynRegPat contained extend start="\z([-`~!@#$%^&*_=+;:'",./?]\)" skip=/\\\\\|\\\z1\|\n\s*\\\|\n\s*"\\ / end="\z1" contains=@vimSynRegPatGroup skipwhite nextgroup=vimSynPatMod,vimSynReg +syn region vimSynRegPat contained extend start="\z([-`~!@#$%^&*_=+;:'",./?]\)" skip=/\\\\\|\\\z1\|\n\s*\%(\\\|"\\ \)/ end="\z1" contains=@vimSynRegPatGroup skipwhite nextgroup=vimSynPatMod,vimSynReg syn match vimSynPatMod contained "\%#=1\%(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\%([-+]\d\+\)\=" syn match vimSynPatMod contained "\%#=1\%(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\%([-+]\d\+\)\=," nextgroup=vimSynPatMod syn match vimSynPatMod contained "lc=\d\+" @@ -1728,7 +1728,7 @@ if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsyncerror") syn match vimSyncError contained "\i\+" endif -syn region vimSyncArgs contained start="\S" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|\|$" contains=vimSyncLines,vimSyncLinebreak,vimSyncLinecont,vimSyncFromstart,vimSyncCcomment +syn region vimSyncArgs contained start="\S" skip=+\\\\\|\\|\|\n\s*\%(\\\|"\\ \)+ matchgroup=vimCmdSep end="|\|$" contains=vimSyncLines,vimSyncLinebreak,vimSyncLinecont,vimSyncFromstart,vimSyncCcomment syn keyword vimSyncCcomment contained ccomment skipwhite nextgroup=vimGroupName syn keyword vimSyncClear contained clear skipwhite nextgroup=vimSyncGroupName @@ -1779,7 +1779,7 @@ syn match vimHiGuiRgb contained "#\x\{6}" " Highlighting: hi group key=arg ... {{{2 syn cluster vimHiCluster contains=vimGroup,vimHLGroup,vimHiBlend,vimHiGroup,vimHiNone,vimHiTerm,vimHiCTerm,vimHiStartStop,vimHiCtermFgBg,vimHiCtermul,vimHiCtermfont,vimHiGui,vimHiGuiFont,vimHiGuiFgBg,vimHiKeyError,vimNotation,vimComment,vim9comment -syn region vimHiKeyList contained start="\i\+" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|" excludenl end="$" contains=@vimContinue,@vimHiCluster +syn region vimHiKeyList contained start="\i\+" skip=+\\\\\|\\|\|\n\s*\%(\\\|"\\ \)+ matchgroup=vimCmdSep end="|" excludenl end="$" contains=@vimContinue,@vimHiCluster if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_vimhikeyerror") syn match vimHiKeyError contained "\i\+="he=e-1 endif @@ -1803,7 +1803,7 @@ syn keyword vimHiClear contained clear skipwhite nextgroup=vimGroup,vimHLGroup,v " see tst24 (hi def vs hi) (Jul 06, 2018) "syn region vimHiLink contained oneline matchgroup=vimCommand start="\(\\|\\)" end="$" contains=vimHiGroup,vimGroup,vimHLGroup,vimNotation " TODO: simplify and allow line continuations --djk -syn region vimHiLink contained matchgroup=Type start="\%(\\|\\)" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|" excludenl end="$" contains=@vimContinue,@vimHiCluster +syn region vimHiLink contained matchgroup=Type start="\%(\\|\\)" skip=+\\\\\|\\|\|\n\s*\%(\\\|"\\ \)+ matchgroup=vimCmdSep end="|" excludenl end="$" contains=@vimContinue,@vimHiCluster " Control Characters: {{{2 " ================== @@ -2174,8 +2174,8 @@ syn region vim9TypeArgs contained " Beginners - Patterns that involve ^ {{{2 " ========= -Vim9 syn region vim9LineComment start=+^[ \t:]*\zs#.*$+ skip=+\n\s*\\\|\n\s*#\\ + end="$" contains=@vimCommentGroup,vimCommentString,vim9CommentTitle extend -VimL syn region vimLineComment start=+^[ \t:]*\zs".*$+ skip=+\n\s*\\\|\n\s*"\\ + end="$" contains=@vimCommentGroup,vimCommentString,vimCommentTitle extend +Vim9 syn region vim9LineComment start=+^[ \t:]*\zs#.*$+ skip=+\n\s*\%(\\\|#\\ \)+ end="$" contains=@vimCommentGroup,vimCommentString,vim9CommentTitle extend +VimL syn region vimLineComment start=+^[ \t:]*\zs".*$+ skip=+\n\s*\%(\\\|"\\ \)+ end="$" contains=@vimCommentGroup,vimCommentString,vimCommentTitle extend syn match vimCommentTitle '"\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vimCommentTitleLeader,vimTodo,@vimCommentGroup syn match vim9CommentTitle '#\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vim9CommentTitleLeader,vimTodo,@vimCommentGroup