commit 1c12073db6c64eb365748f153f96be9b0fe61070
parent c4886397570692b30a9f5963f27a713debaec150
Author: zeertzjq <zeertzjq@outlook.com>
Date: Sat, 22 Nov 2025 07:13:10 +0800
vim-patch:8da8862: runtime(vim): Update base syntax, match full :history command (#36655)
closes: vim/vim#18784
https://github.com/vim/vim/commit/8da886269a46204180102b932f528cd6dfa472be
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Diffstat:
1 file changed, 13 insertions(+), 1 deletion(-)
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,vimBreakadd,vimBreakdel,vimBreaklist,vimCall,vimCatch,vimCd,vimCommandModifier,vimConst,vimDoautocmd,vimDebug,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,vimPrompt,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,vimBreakadd,vimBreakdel,vimBreaklist,vimCall,vimCatch,vimCd,vimCommandModifier,vimConst,vimDoautocmd,vimDebug,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,vimHistory,vimImport,vimLet,vimLoadkeymap,vimLockvar,vimMake,vimMap,vimMark,vimMatch,vimNotFunc,vimNormal,vimProfdel,vimProfile,vimPrompt,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
@@ -376,6 +376,16 @@ endif
syn keyword vimFTCmd contained filet[ype]
syn keyword vimFTOption contained detect indent off on plugin
+" History {{{2
+" =======
+" TODO: handle Vim9 "history" variable assignment (like :wincmd, but a common variable name)
+syn keyword vimHistory his[tory] skipwhite nextgroup=vimHistoryName,vimHistoryRange,vimCmdSep,vimComment,vim9Comment
+syn keyword vimHistoryName contained c[md] s[earch] e[xpr] i[nput] d[ebug] a[ll] skipwhite nextgroup=vimHistoryRange,vimCmdSep,vimComment,vim9Comment
+syn match vimHistoryName contained "[:/?=@>]" skipwhite nextgroup=vimHistoryRange,vimCmdSep,vimComment,vim9Comment
+syn match vimHistoryRange contained "-\=\<\d\+\>\%(\s*,\)\=" skipwhite nextgroup=vimCmdSep,vimComment,vim9Comment
+syn match vimHistoryRange contained ",\s*-\=\d\+\>" skipwhite nextgroup=vimCmdSep,vimComment,vim9Comment
+syn match vimHistoryRange contained "-\=\<\d\+\s*,\s*-\=\d\+\>" skipwhite nextgroup=vimCmdSep,vimComment,vim9Comment
+
" Import {{{2
" ======
syn keyword vimImportAutoload contained autoload skipwhite nextgroup=vimImportFilename
@@ -2512,6 +2522,8 @@ if !exists("skip_vim_syntax_inits")
hi def link vimHiStartStop vimHiTerm
hi def link vimHiTerm Type
hi def link vimHLGroup vimGroup
+ hi def link vimHistory vimCommand
+ hi def link vimHistoryName Special
hi def link vimImport vimCommand
hi def link vimImportAutoload Special
hi def link vimImportAs vimImport