|
2 | 2 | " Language: Vim script |
3 | 3 | " Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com> |
4 | 4 | " Doug Kearns <dougkearns@gmail.com> |
5 | | -" URL: https://github.com/vim-jp/syntax-vim-ex |
6 | 5 | " Last Change: 2024 Aug 30 |
7 | 6 | " Former Maintainer: Charles E. Campbell |
8 | 7 |
|
@@ -185,10 +184,11 @@ syn match vimNumber '\%(^\|\A\)\zs#\x\{6}' skipwhite nextgroup=vimGlobal,vimSub |
185 | 184 | syn case match |
186 | 185 |
|
187 | 186 | " All vimCommands are contained by vimIsCommand. {{{2 |
188 | | -syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutoCmd,vimAugroup,vimBehave,vimCall,vimCatch,vimConst,vimDef,@vimEcho,vimEnddef,vimEndfunction,vimExecute,vimIsCommand,vimExtCmd,vimFor,vimFunction,vimGlobal,vimHighlight,vimLet,vimLoadkeymap,vimMap,vimMark,vimMatch,vimNotFunc,vimNorm,vimSet,vimSleep,vimSyntax,vimThrow,vimUnlet,vimUnmap,vimUserCmd,vimMenu,vimMenutranslate,@vim9CmdList |
| 187 | +syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutoCmd,vimAugroup,vimBehave,vimCall,vimCatch,vimConst,vimDef,vimDelcommand,@vimEcho,vimEnddef,vimEndfunction,vimExecute,vimIsCommand,vimExtCmd,vimFor,vimFunction,vimGlobal,vimHighlight,vimLet,vimLoadkeymap,vimMap,vimMark,vimMatch,vimNotFunc,vimNorm,vimSet,vimSleep,vimSyntax,vimThrow,vimUnlet,vimUnmap,vimUserCmd,vimMenu,vimMenutranslate,@vim9CmdList |
189 | 188 | syn cluster vim9CmdList contains=vim9Const,vim9Final,vim9For,vim9Var |
190 | 189 | syn match vimCmdSep "[:|]\+" skipwhite nextgroup=@vimCmdList,vimSubst1 |
191 | 190 | syn match vimIsCommand "\<\%(\h\w*\|[23]mat\%[ch]\)\>" contains=vimCommand |
| 191 | +syn match vimBang contained "!" |
192 | 192 | syn match vimVar contained "\<\h[a-zA-Z0-9#_]*\>" |
193 | 193 | syn match vimVar "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>" |
194 | 194 | syn match vimVar "\s\zs&\%([lg]:\)\=\a\+\>" |
@@ -362,32 +362,44 @@ syn match vimSpecFileMod "\(:[phtre]\)\+" contained |
362 | 362 | " User-Specified Commands: {{{2 |
363 | 363 | " ======================= |
364 | 364 | syn cluster vimUserCmdList contains=@vimCmdList,vimCmplxRepeat,@vimComment,vimCtrlChar,vimEscapeBrace,vimFunc,vimNotation,vimNumber,vimOper,vimRegister,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange |
365 | | -syn keyword vimUserCommand contained com[mand] |
366 | | -syn match vimUserCmdName contained "\<\u\w*\>" nextgroup=vimUserCmdBlock skipwhite |
367 | | -syn match vimUserCmd "\<com\%[mand]!\=\>.*$" contains=vimUserAttrb,vimUserAttrbError,vimUserCommand,@vimUserCmdList,vimComFilter,vimCmdBlock,vimUserCmdName |
368 | | -syn match vimUserAttrbError contained "-\a\+\ze\s" |
369 | | -syn match vimUserAttrb contained "-nargs=[01*?+]" contains=vimUserAttrbKey,vimOper |
370 | | -syn match vimUserAttrb contained "-complete=" contains=vimUserAttrbKey,vimOper nextgroup=vimUserAttrbCmplt,vimUserCmdError |
371 | | -syn match vimUserAttrb contained "-range\(=%\|=\d\+\)\=" contains=vimNumber,vimOper,vimUserAttrbKey |
372 | | -syn match vimUserAttrb contained "-count\(=\d\+\)\=" contains=vimNumber,vimOper,vimUserAttrbKey |
373 | | -syn match vimUserAttrb contained "-bang\>" contains=vimOper,vimUserAttrbKey |
374 | | -syn match vimUserAttrb contained "-bar\>" contains=vimOper,vimUserAttrbKey |
375 | | -syn match vimUserAttrb contained "-buffer\>" contains=vimOper,vimUserAttrbKey |
376 | | -syn match vimUserAttrb contained "-register\>" contains=vimOper,vimUserAttrbKey |
| 365 | +syn keyword vimUserCmdKey contained com[mand] |
| 366 | +syn match vimUserCmdName contained "\<\u[[:alnum:]]*\>" skipwhite nextgroup=vimUserCmdBlock |
| 367 | +syn match vimUserCmd "\<com\%[mand]\>!\=.*$" contains=vimUserCmdKey,vimBang,vimUserCmdAttr,vimUserCmdAttrError,vimUserCmdName,@vimUserCmdList,vimComFilter |
| 368 | +syn match vimUserCmdAttrError contained "-\a\+\ze\%(\s\|=\)" |
| 369 | +syn match vimUserCmdAttr contained "-addr=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrAddr |
| 370 | +syn match vimUserCmdAttr contained "-bang\>" contains=vimUserCmdAttrKey |
| 371 | +syn match vimUserCmdAttr contained "-bar\>" contains=vimUserCmdAttrKey |
| 372 | +syn match vimUserCmdAttr contained "-buffer\>" contains=vimUserCmdAttrKey |
| 373 | +syn match vimUserCmdAttr contained "-complete=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrCmplt,vimUserCmdError |
| 374 | +syn match vimUserCmdAttr contained "-count\>" contains=vimUserCmdAttrKey |
| 375 | +syn match vimUserCmdAttr contained "-count=" contains=vimUserCmdAttrKey nextgroup=vimNumber |
| 376 | +syn match vimUserCmdAttr contained "-keepscript\>" contains=vimUserCmdAttrKey |
| 377 | +syn match vimUserCmdAttr contained "-nargs=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrNargs |
| 378 | +syn match vimUserCmdAttr contained "-range\>" contains=vimUserCmdAttrKey |
| 379 | +syn match vimUserCmdAttr contained "-range=" contains=vimUserCmdAttrKey nextgroup=vimNumber,vimUserCmdAttrRange |
| 380 | +syn match vimUserCmdAttr contained "-register\>" contains=vimUserCmdAttrKey |
| 381 | + |
| 382 | +syn match vimUserCmdAttrNargs contained "[01*?+]" |
| 383 | +syn match vimUserCmdAttrRange contained "%" |
| 384 | + |
377 | 385 | if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_nousercmderror") |
378 | 386 | syn match vimUserCmdError contained "\S\+\>" |
379 | 387 | endif |
380 | | -syn case ignore |
381 | | -syn keyword vimUserAttrbKey contained bar ban[g] cou[nt] ra[nge] com[plete] n[args] re[gister] |
382 | | -" GEN_SYN_VIM: vimUserAttrbCmplt, START_STR='syn keyword vimUserAttrbCmplt contained', END_STR='' |
383 | | -syn keyword vimUserAttrbCmplt contained custom customlist nextgroup=vimUserAttrbCmpltFunc,vimUserCmdError |
384 | | -syn match vimUserAttrbCmpltFunc contained ",\%([sS]:\|<[sS][iI][dD]>\)\=\%(\h\w*\%([.#]\h\w*\)\+\|\h\w*\)"hs=s+1 nextgroup=vimUserCmdError |
385 | 388 |
|
| 389 | +syn case ignore |
| 390 | +syn keyword vimUserCmdAttrKey contained a[ddr] ban[g] bar bu[ffer] com[plete] cou[nt] k[eepscript] n[args] ra[nge] re[gister] |
| 391 | +" GEN_SYN_VIM: vimUserCmdAttrCmplt, START_STR='syn keyword vimUserCmdAttrCmplt contained', END_STR='' |
| 392 | +syn keyword vimUserCmdAttrCmplt contained custom customlist nextgroup=vimUserCmdAttrCmpltFunc,vimUserCmdError |
| 393 | +syn match vimUserCmdAttrCmpltFunc contained ",\%([sS]:\|<[sS][iI][dD]>\)\=\%(\h\w*\%([.#]\h\w*\)\+\|\h\w*\)"hs=s+1 nextgroup=vimUserCmdError |
| 394 | +" GEN_SYN_VIM: vimUserCmdAttrAddr, START_STR='syn keyword vimUserCmdAttrAddr contained', END_STR='' |
| 395 | +syn match vimUserCmdAttrAddr contained "?" |
386 | 396 | syn case match |
387 | | -syn match vimUserAttrbCmplt contained "custom,\u\w*" |
388 | 397 |
|
389 | 398 | syn region vimUserCmdBlock contained matchgroup=vimSep start="{" end="}" contains=@vimDefBodyList |
390 | 399 |
|
| 400 | +syn match vimDelcommand "\<delc\%[ommand]\>" skipwhite nextgroup=vimDelcommandAttr |
| 401 | +syn match vimDelcommandAttr contained "-buffer\>" |
| 402 | + |
391 | 403 | " Lower Priority Comments: after some vim commands... {{{2 |
392 | 404 | " ======================= |
393 | 405 | if get(g:, "vimsyn_comment_strings", 1) |
@@ -1162,6 +1174,8 @@ if !exists("skip_vim_syntax_inits") |
1162 | 1174 | hi def link vimDefComment vim9Comment |
1163 | 1175 | hi def link vimDefKey vimCommand |
1164 | 1176 | hi def link vimDefParam vimVar |
| 1177 | + hi def link vimDelcommand vimCommand |
| 1178 | + hi def link vimDelcommandAttr vimUserCmdAttr |
1165 | 1179 | hi def link vimEcho vimCommand |
1166 | 1180 | hi def link vimEchohlNone vimGroup |
1167 | 1181 | hi def link vimEchohl vimCommand |
@@ -1319,13 +1333,15 @@ if !exists("skip_vim_syntax_inits") |
1319 | 1333 | hi def link vimUnlet vimCommand |
1320 | 1334 | hi def link vimUnletBang vimBang |
1321 | 1335 | hi def link vimUnmap vimMap |
1322 | | - hi def link vimUserAttrbCmpltFunc Special |
1323 | | - hi def link vimUserAttrbCmplt vimSpecial |
1324 | | - hi def link vimUserAttrbKey vimOption |
1325 | | - hi def link vimUserAttrb vimSpecial |
1326 | | - hi def link vimUserAttrbError Error |
| 1336 | + hi def link vimUserCmdAttrAddr vimSpecial |
| 1337 | + hi def link vimUserCmdAttrCmplt vimSpecial |
| 1338 | + hi def link vimUserCmdAttrNargs vimSpecial |
| 1339 | + hi def link vimUserCmdAttrRange vimSpecial |
| 1340 | + hi def link vimUserCmdAttrKey vimUserCmdAttr |
| 1341 | + hi def link vimUserCmdAttr Special |
| 1342 | + hi def link vimUserCmdAttrError Error |
1327 | 1343 | hi def link vimUserCmdError Error |
1328 | | - hi def link vimUserCommand vimCommand |
| 1344 | + hi def link vimUserCmdKey vimCommand |
1329 | 1345 | hi def link vimUserFunc Normal |
1330 | 1346 | hi def link vimVar Identifier |
1331 | 1347 | hi def link vimWarn WarningMsg |
|
0 commit comments