commit 518f95e27e2f720a4c367c70215d644e35ef97fd
parent 85e6feedb0de9c9a5e29ba90815937ed5032f5b4
Author: zeertzjq <zeertzjq@outlook.com>
Date: Sun, 6 Jul 2025 06:20:48 +0800
vim-patch:a9b5e4a: runtime(vim): Update base-syntax and generator, generate command modifiers
Generate Ex command modifiers from the modifier table in src/ex_docmd.c
closes: vim/vim#17564
https://github.com/vim/vim/commit/a9b5e4af43ef1f03f20ebcf980f4dd555a12694d
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Diffstat:
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
@@ -30,6 +30,11 @@ endfunction
syn keyword vimTodo contained COMBAK FIXME TODO XXX
syn cluster vimCommentGroup contains=vimTodo,@Spell
+" GEN_SYN_VIM: vimCommand modifier, START_STR='syn keyword vimCommandModifier', END_STR='skipwhite nextgroup=vimCommandModifierBang,@vimCmdList'
+syn keyword vimCommandModifier abo[veleft] bel[owright] bo[tright] bro[wse] conf[irm] hid[e] hor[izontal] kee[pmarks] keepj[umps] keepp[atterns] keepa[lt] lefta[bove] leg[acy] loc[kmarks] noa[utocmd] nos[wapfile] rightb[elow] san[dbox] sil[ent] tab to[pleft] uns[ilent] verb[ose] vert[ical] vim9[cmd] skipwhite nextgroup=vimCommandModifierBang,@vimCmdList
+" :filter is handled specially elsewhere
+syn match vimCommandModifierBang contained "\a\@1<=!" skipwhite nextgroup=@vimCmdList
+
" Special and plugin vim commands {{{2
syn match vimCommand contained "\<z[-+^.=]\=\>"
syn keyword vimOnlyCommand contained fix[del] op[en] sh[ell] P[rint]
@@ -212,7 +217,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,vimAutocmd,vimAugroup,vimBehave,vimCall,vimCatch,vimConst,vimDoautocmd,vimDebuggreedy,vimDef,vimDefFold,vimDelcommand,vimDelFunction,@vimEcho,vimElse,vimEnddef,vimEndfunction,vimEndif,vimExecute,vimIsCommand,vimExtCmd,vimExFilter,vimExMark,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,vimThrow,vimUniq,vimUnlet,vimUnlockvar,vimUnmap,vimUserCmd,vimVimgrep,vimVimgrepadd,vimMenu,vimMenutranslate,@vim9CmdList,@vimExUserCmdList,vimLua,vimMzScheme,vimPerl,vimPython,vimPython3,vimPythonX,vimRuby,vimTcl
+syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutocmd,vimAugroup,vimBehave,vimCall,vimCatch,vimCommandModifier,vimConst,vimDoautocmd,vimDebuggreedy,vimDef,vimDefFold,vimDelcommand,vimDelFunction,@vimEcho,vimElse,vimEnddef,vimEndfunction,vimEndif,vimExecute,vimIsCommand,vimExtCmd,vimExFilter,vimExMark,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,vimThrow,vimUniq,vimUnlet,vimUnlockvar,vimUnmap,vimUserCmd,vimVimgrep,vimVimgrepadd,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
@@ -1232,7 +1237,6 @@ syn region vimExecute
" Filter: {{{2
" ======
syn match vimExFilter "\<filt\%[er]\>" skipwhite nextgroup=vimExFilterBang,vimExFilterPattern
-syn match vimExFilterBang contained "\a\@1<=!" skipwhite nextgroup=vimExFilterPattern
syn region vimExFilterPattern contained
\ start="[[:ident:]]"
\ end="\ze[[:space:]\n]"
@@ -1247,6 +1251,7 @@ syn region vimExFilterPattern contained
\ skipwhite nextgroup=@vimCmdList
\ contains=@vimSubstList
\ oneline
+syn match vimExFilterBang contained "\a\@1<=!" skipwhite nextgroup=vimExFilterPattern
" Grep and Make: {{{2
" =============
@@ -2160,6 +2165,8 @@ if !exists("skip_vim_syntax_inits")
hi def link vimCatch vimCommand
hi def link vimCmplxRepeat SpecialChar
hi def link vimCommand Statement
+ hi def link vimCommandModifier vimCommand
+ hi def link vimCommandModifierBang vimBang
hi def link vimComment Comment
hi def link vimCommentError vimError
hi def link vimCommentString vimString
@@ -2194,7 +2201,7 @@ if !exists("skip_vim_syntax_inits")
hi def link vimError Error
hi def link vimEscape Special
hi def link vimExFilter vimCommand
- hi def link vimExFilterBang vimCommand
+ hi def link vimExFilterBang vimBang
hi def link vimExMark vimCommand
hi def link vimFBVar vimVar
hi def link vimFgBgAttrib vimHiAttrib