neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 560108c97d3942efa099607d00a6c966c5a86362
parent 76fdd9b882489b233ca00a0809d719c70e48b164
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Mon, 10 Nov 2025 08:40:20 +0800

Merge pull request #36501 from zeertzjq/vim-8869800

vim-patch: Vim syntax updates
Diffstat:
Mruntime/syntax/vim.vim | 38+++++++++++++++++++++++++++++++++-----
1 file changed, 33 insertions(+), 5 deletions(-)

diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim @@ -232,7 +232,7 @@ syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=@vi syn case match " All vimCommands are contained by vimIsCommand. {{{2 -syn cluster vimCmdList contains=vimAbb,vimAddress,vimAt,vimAutocmd,vimAugroup,vimBehave,vimCall,vimCatch,vimCommandModifier,vimConst,vimDoautocmd,vimDebuggreedy,vimDef,vimDefFold,vimDefer,vimDelcommand,vimDelFunction,@vimEcho,vimElse,vimEnddef,vimEndfunction,vimEndif,vimEval,vimExecute,vimIsCommand,vimExtCmd,vimExFilter,vimExMark,vimFiletype,vimFor,vimFunction,vimFunctionFold,vimGrep,vimGrepAdd,vimGlobal,vimHelpgrep,vimHighlight,vimImport,vimLet,vimLoadkeymap,vimLockvar,vimMake,vimMap,vimMark,vimMatch,vimNotFunc,vimNormal,vimProfdel,vimProfile,vimRedir,vimSet,vimSleep,vimSort,vimSyntax,vimSyntime,vimSynColor,vimSynLink,vimTerminal,vimThrow,vimUniq,vimUnlet,vimUnlockvar,vimUnmap,vimUserCmd,vimVimgrep,vimVimgrepadd,vimWincmd,vimMenu,vimMenutranslate,@vim9CmdList,@vimExUserCmdList,vimLua,vimMzScheme,vimPerl,vimPython,vimPython3,vimPythonX,vimRuby,vimTcl +syn cluster vimCmdList contains=vimAbb,vimAddress,vimAt,vimAutocmd,vimAugroup,vimBehave,vimCall,vimCatch,vimCommandModifier,vimConst,vimDoautocmd,vimDebuggreedy,vimDef,vimDefFold,vimDefer,vimDelcommand,vimDelFunction,vimDoCommand,@vimEcho,vimElse,vimEnddef,vimEndfunction,vimEndif,vimEval,vimExecute,vimIsCommand,vimExtCmd,vimExFilter,vimExMark,vimFiletype,vimFor,vimFunction,vimFunctionFold,vimGrep,vimGrepAdd,vimGlobal,vimHelpgrep,vimHighlight,vimImport,vimLet,vimLoadkeymap,vimLockvar,vimMake,vimMap,vimMark,vimMatch,vimNotFunc,vimNormal,vimProfdel,vimProfile,vimRedir,vimSet,vimSleep,vimSort,vimSyntax,vimSyntime,vimSynColor,vimSynLink,vimTerminal,vimThrow,vimUniq,vimUnlet,vimUnlockvar,vimUnmap,vimUserCmd,vimVimgrep,vimVimgrepadd,vimWincmd,vimMenu,vimMenutranslate,@vim9CmdList,@vimExUserCmdList,vimLua,vimMzScheme,vimPerl,vimPython,vimPython3,vimPythonX,vimRuby,vimTcl syn cluster vim9CmdList contains=vim9Abstract,vim9Class,vim9Const,vim9Enum,vim9Export,vim9Final,vim9For,vim9Interface,vim9Type,vim9Var syn match vimCmdSep "\\\@1<!|" skipwhite nextgroup=@vimCmdList,vimSubst1,@vimFunc syn match vimCmdSep ":\+" skipwhite nextgroup=@vimCmdList,vimSubst1 @@ -304,7 +304,17 @@ syn match vimDebuggreedy "\<0\=debugg\%[reedy]\>" contains=vimCount " Defer {{{2 " ===== -syn match vimDefer "\<defer\=\>" skipwhite nextgroup=@vimFunc +syn match vimDefer "\<defer\=\>" skipwhite nextgroup=@vimFunc,vim9LambdaParams + +" *Do commands {{{2 +" ============ +syn match vimDoCommandBang contained "\a\@1<=!" skipwhite nextgroup=@vimCmdList + +syn keyword vimDoCommand argdo bufd[o] skipwhite nextgroup=vimDoCommandBang,@vimCmdList +syn keyword vimDoCommand tabd[o] wind[o] skipwhite nextgroup=@vimCmdList +syn keyword vimDoCommand cdo cfd[o] skipwhite nextgroup=vimDoCommandBang,@vimCmdList +syn keyword vimDoCommand ld[o] lfd[o] skipwhite nextgroup=vimDoCommandBang,@vimCmdList +syn keyword vimDoCommand foldd[oopen] folddoc[losed] skipwhite nextgroup=@vimCmdList " Exception Handling {{{2 syn keyword vimThrow th[row] skipwhite nextgroup=@vimExprList @@ -561,13 +571,20 @@ syn match vimParamType contained ":\s" skipwhite skipnl nextgroup=@vimType conta syn match vimTypeSep contained ":\%(\s\|\n\)\@=" skipwhite nextgroup=@vimType syn keyword vimType contained blob bool channel float job number string void syn keyword vimTypeAny contained any +syn region vimTypeObject contained + \ matchgroup=vimType + \ start="\<object<" + \ end=">" + \ contains=vimTypeAny,vimTypeObject,vimUserType + \ oneline + \ transparent syn match vimType contained "\<\%(func\)\>" syn region vimCompoundType contained matchgroup=vimType start="\<func(" end=")" nextgroup=vimTypeSep contains=@vim9Continue,@vimType transparent syn region vimCompoundType contained matchgroup=vimType start="\<tuple<" end=">" contains=@vim9Continue,@vimType transparent syn region vimCompoundType contained matchgroup=vimType start="\<\%(list\|dict\)<" end=">" contains=@vimType oneline transparent syn match vimUserType contained "\<\%(\h\w*\.\)*\u\w*\>" -syn cluster vimType contains=vimType,vimTypeAny,vimCompoundType,vimUserType +syn cluster vimType contains=vimType,vimTypeAny,vimTypeObject,vimCompoundType,vimUserType " Classes, Enums And Interfaces: {{{2 " ============================= @@ -1118,6 +1135,13 @@ syn region vim9VariableList contained start="\[" end="]" contains=@vimContinue,@ syn match vim9VariableTypeSep contained "\S\@1<=:\%(\s\|\n\)\@=" skipwhite nextgroup=@vim9VariableType syn keyword vim9VariableType contained blob bool channel float job number string void skipwhite nextgroup=vimLetHeredoc syn keyword vim9VariableTypeAny contained any skipwhite nextgroup=vimLetHeredoc +syn region vim9VariableTypeObject contained + \ matchgroup=vimType + \ start="\<object<" + \ end=">" + \ contains=vimTypeAny,vimTypeObject,vimUserType + \ oneline + \ transparent syn match vim9VariableType contained "\<\%(func\)\>" skipwhite nextgroup=vimLetHeredoc syn region vim9VariableCompoundType contained \ matchgroup=vim9VariableType @@ -1143,7 +1167,7 @@ syn region vim9VariableCompoundType contained \ transparent syn match vim9VariableUserType contained "\<\%(\h\w*\.\)*\u\w*\>" skipwhite nextgroup=vimLetHeredoc -syn cluster vim9VariableType contains=vim9VariableType,vim9VariableTypeAny,vim9VariableCompoundType,vim9VariableUserType +syn cluster vim9VariableType contains=vim9VariableType,vim9VariableTypeAny,vim9VariableTypeObject,vim9VariableCompoundType,vim9VariableUserType " Lockvar and Unlockvar: {{{2 " ===================== @@ -2359,6 +2383,8 @@ if !exists("skip_vim_syntax_inits") hi def link vimDelfunctionBang vimBang hi def link vimDoautocmd vimCommand hi def link vimDoautocmdMod Special + hi def link vimDoCommand vimCommand + hi def link vimDoCommandBang vimBang hi def link vimEcho vimCommand hi def link vimEchohlNone vimGroup hi def link vimEchohl vimCommand @@ -2584,6 +2610,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimTodo Todo hi def link vimType Type hi def link vimTypeAny vimType + hi def link vimTypeObject vimType hi def link vimUniq vimCommand hi def link vimUniqBang vimBang hi def link vimUniqOptions Special @@ -2675,7 +2702,8 @@ if !exists("skip_vim_syntax_inits") hi def link vim9TypeEquals vimOper hi def link vim9Variable vimVar hi def link vim9VariableType vimType - hi def link vim9VariableTypeAny vimType + hi def link vim9VariableTypeAny vimTypeAny + hi def link vim9VariableTypeObject vimTypeObject hi def link vim9Var vimCommand hi def link vim9Vim9ScriptArg Special hi def link vim9Vim9Script vimCommand