|
2 | 2 | " Language: Vim script |
3 | 3 | " Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com> |
4 | 4 | |
5 | | -" Last Change: 2025 Jul 17 |
| 5 | +" Last Change: 2025 Jul 18 |
6 | 6 | " Former Maintainer: Charles E. Campbell |
7 | 7 |
|
8 | 8 | " DO NOT CHANGE DIRECTLY. |
@@ -34,10 +34,22 @@ syn cluster vimCommentGroup contains=vimTodo,@Spell |
34 | 34 | " regular vim commands {{{2 |
35 | 35 | " GEN_SYN_VIM: vimCommand normal, START_STR='syn keyword vimCommand contained', END_STR='nextgroup=vimBang' |
36 | 36 |
|
| 37 | +" Lower priority :syn-match to allow for :command/function() distinction |
| 38 | +syn match vimCommand "\<chd\%[ir]\>" nextgroup=vimBang |
| 39 | +syn match vimCommand "\<co\%[py]\>" nextgroup=vimBang |
| 40 | +syn match vimCommand "\<d\%[elete]\>" nextgroup=vimBang |
| 41 | +syn match vimCommand "\<j\%[oin]\>" nextgroup=vimBang |
| 42 | +syn match vimCommand "\<sp\%[lit]\>" nextgroup=vimBang |
| 43 | +syn match vimCommand "\<sw\%[apname]\>" nextgroup=vimBang |
| 44 | + |
37 | 45 | " GEN_SYN_VIM: vimCommand modifier, START_STR='syn keyword vimCommandModifier', END_STR='skipwhite nextgroup=vimCommandModifierBang,@vimCmdList' |
38 | 46 | " :filter is handled specially elsewhere |
39 | 47 | syn match vimCommandModifierBang contained "\a\@1<=!" skipwhite nextgroup=@vimCmdList |
40 | 48 |
|
| 49 | +" Lower priority :syn-match to allow for :command/function() distinction |
| 50 | +syn match vimCommand "\<bro\%[wse]\>" skipwhite nextgroup=vimCommandModifierBang,@vimCmdList |
| 51 | +syn match vimCommand "\<conf\%[irm]\>" skipwhite nextgroup=vimCommandModifierBang,@vimCmdList |
| 52 | + |
41 | 53 | " Lower priority for _new_ to distinguish constructors from the command. |
42 | 54 | syn match vimCommand contained "\<new\>(\@!" |
43 | 55 | syn match vimCommand contained "\<z[-+^.=]\=\>" |
@@ -230,7 +242,7 @@ syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=@vi |
230 | 242 | syn case match |
231 | 243 |
|
232 | 244 | " All vimCommands are contained by vimIsCommand. {{{2 |
233 | | -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,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,vimSynColor,vimSynLink,vimThrow,vimUniq,vimUnlet,vimUnlockvar,vimUnmap,vimUserCmd,vimVimgrep,vimVimgrepadd,vimMenu,vimMenutranslate,@vim9CmdList,@vimExUserCmdList,vimLua,vimMzScheme,vimPerl,vimPython,vimPython3,vimPythonX,vimRuby,vimTcl |
| 245 | +syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutocmd,vimAugroup,vimBehave,vimCall,vimCatch,vimCommandModifier,vimConst,vimDoautocmd,vimDebuggreedy,vimDef,vimDefFold,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,vimSynColor,vimSynLink,vimThrow,vimUniq,vimUnlet,vimUnlockvar,vimUnmap,vimUserCmd,vimVimgrep,vimVimgrepadd,vimMenu,vimMenutranslate,@vim9CmdList,@vimExUserCmdList,vimLua,vimMzScheme,vimPerl,vimPython,vimPython3,vimPythonX,vimRuby,vimTcl |
234 | 246 | syn cluster vim9CmdList contains=vim9Abstract,vim9Class,vim9Const,vim9Enum,vim9Export,vim9Final,vim9For,vim9Interface,vim9Type,vim9Var |
235 | 247 | syn match vimCmdSep "\\\@1<!|" skipwhite nextgroup=@vimCmdList,vimSubst1,@vimFunc |
236 | 248 | syn match vimCmdSep ":\+" skipwhite nextgroup=@vimCmdList,vimSubst1 |
@@ -1245,6 +1257,16 @@ syn region vimExecute |
1245 | 1257 | \ contains=@vimContinue,@vimExprList |
1246 | 1258 | \ transparent |
1247 | 1259 |
|
| 1260 | +syn region vimEval |
| 1261 | + \ matchgroup=vimCommand |
| 1262 | + \ start="\<ev\%[al]\>" |
| 1263 | + \ skip=+\\|\|||\|\n\s*\%(\\\|["#]\\ \)+ |
| 1264 | + \ end="\ze|" |
| 1265 | + \ excludenl end="$" |
| 1266 | + \ nextgroup=vimCmdSep |
| 1267 | + \ contains=@vimContinue,@vimExprList |
| 1268 | + \ transparent |
| 1269 | + |
1248 | 1270 | " Filter: {{{2 |
1249 | 1271 | " ====== |
1250 | 1272 | syn match vimExFilter "\<filt\%[er]\>" skipwhite nextgroup=vimExFilterBang,vimExFilterPattern |
@@ -2067,7 +2089,7 @@ unlet s:interfaces |
2067 | 2089 | " (following Gautam Iyer's suggestion) |
2068 | 2090 | " ========================== |
2069 | 2091 | syn match vimFunc contained "\<\l\w*\ze\s*(" skipwhite nextgroup=vimOperParen contains=vimFuncName |
2070 | | -syn match vimUserFunc contained "\.\@1<=\l\w*\ze\s*(" skipwhite nextgroup=vimOperParen contains=vimFuncName |
| 2092 | +syn match vimUserFunc contained "\.\@1<=\l\w*\ze\s*(" skipwhite nextgroup=vimOperParen |
2071 | 2093 | syn match vimUserFunc contained "\<\%([[:upper:]_]\|\%(\h\w*\.\)\+\h\)\w*\ze\s*(" skipwhite nextgroup=vimOperParen contains=vim9MethodName,vim9Super,vim9This |
2072 | 2094 | syn match vimUserFunc contained "\<\%(g:\)\=\%(\h\w*#\)\+\h\w*\ze\s*(" skipwhite nextgroup=vimOperParen contains=vimVarScope |
2073 | 2095 | syn match vimUserFunc contained "\%(\<[sgbwtlav]:\|<[sS][iI][dD]>\)\%(\h\w*\.\)*\h\w*\ze\s*(" skipwhite nextgroup=vimOperParen contains=vimVarScope,vimNotation |
@@ -2224,6 +2246,7 @@ if !exists("skip_vim_syntax_inits") |
2224 | 2246 | hi def link vimEnvvar PreProc |
2225 | 2247 | hi def link vimError Error |
2226 | 2248 | hi def link vimEscape Special |
| 2249 | + hi def link vimEval vimCommand |
2227 | 2250 | hi def link vimExFilter vimCommand |
2228 | 2251 | hi def link vimExFilterBang vimBang |
2229 | 2252 | hi def link vimExMark vimCommand |
|
0 commit comments