- Highlight :@ as a normal Ex command rather than something special.
- Fix erroneous matching of the Ex command as a register variable.
closes: #18624
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
" Language: Vim script
" Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com>
" Doug Kearns <dougkearns@gmail.com>
-" Last Change: 2025 Oct 09
+" Last Change: 2025 Oct 22
" Former Maintainer: Charles E. Campbell
" DO NOT CHANGE DIRECTLY.
syn case match
" All vimCommands are contained by vimIsCommand. {{{2
-syn cluster vimCmdList contains=vimAbb,vimAddress,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,@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
" Complex Repeats: (:h complex-repeat) {{{2
" ===============
syn match vimCmplxRepeat '[^a-zA-Z_/\\()]q[0-9a-zA-Z"]\>'lc=1
-syn match vimCmplxRepeat '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\>\)'
+
+" NOTE: :* as an alias for :@ is not supported, this is considered a :range,
+" see :help cpo-star
+syn match vimAtArg contained +@\@1<=[0-9a-z".=*+:@]+
+syn match vimAt +@[0-9a-z".=*+:@]\ze\s*\%($\|[|"#]\)+ skipwhite nextgroup=vimCmdSep,vimComment,vim9Comment contains=vimAtArg
+" Vim9: avoid LHS assignment mismatching of :@["#]
+syn match vimAt +@\ze\s*\%($\||\|\s["#]\)+ skipwhite nextgroup=vimCmdSep,vimComment,vim9Comment
" Set command and associated set-options (vimOptions) with comment {{{2
syn match vimSet "\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skipwhite nextgroup=vimSetBang,vimCmdSep,vimComment,vimSetArgs
hi def link vimAbb vimCommand
hi def link vimAddress vimMark
+ hi def link vimAt vimCommand
+ hi def link vimAtArg Special
hi def link vimAugroupBang vimBang
hi def link vimAugroupError vimError
hi def link vimAugroupKey vimCommand
@75
@75
|#+0#0000e05&| |S|T|A|R|T| |N|O|T| |M|A|T|C|H|E|D| +0#0000000&@55
-|:|@| @72
-|:|@+0#e000e06&@1| +0#0000000&@71
|:|N|e|x|t| @69
|:|X| @72
|#+0#0000e05&| |E|N|D| |N|O|T| |M|A|T|C|H|E|D| +0#0000000&@57
|:| |h+0#af5f00255&|e|l|p| +0#0000000&@68
@1|:+0#af5f00255&| +0#0000000&|h+0#00e0e07&|e|l|p| +0#0000000&|#+0#0000e05&| |F+0#0000001#ffff4012|I|X|M|E| +0#0000000#ffffff0@59
@75
+|:|@+0#af5f00255&| +0#0000000&@72
+@75
|:|a+0#af5f00255&|b@1|r|e|v|i|a|t|e| +0#0000000&@63
|:|a+0#af5f00255&|b|c|l|e|a|r| +0#0000000&@66
|:|a+0#af5f00255&|b|o|v|e|l|e|f|t| +0#0000000&@64
-|:+0&#ffffff0| |h+0#af5f00255&|e|l|p| +0#0000000&@68
-@1|:+0#af5f00255&| +0#0000000&|h+0#00e0e07&|e|l|p| +0#0000000&|#+0#0000e05&| |F+0#0000001#ffff4012|I|X|M|E| +0#0000000#ffffff0@59
+| +0&#ffffff0@74
+|:|@+0#af5f00255&| +0#0000000&@72
@75
|:|a+0#af5f00255&|b@1|r|e|v|i|a|t|e| +0#0000000&@63
|:|a+0#af5f00255&|b|c|l|e|a|r| +0#0000000&@66
--- /dev/null
+>"+0#0000e05#ffffff0| |V|i|m| |:|@| |c|o|m@1|a|n|d| +0#0000000&@58
+@75
+@75
+|@+0#af5f00255&|0+0#e000e06&| +0#0000000&@72
+|@+0#af5f00255&|1+0#e000e06&| +0#0000000&@72
+|@+0#af5f00255&|2+0#e000e06&| +0#0000000&@72
+|@+0#af5f00255&|3+0#e000e06&| +0#0000000&@72
+|@+0#af5f00255&|4+0#e000e06&| +0#0000000&@72
+|@+0#af5f00255&|5+0#e000e06&| +0#0000000&@72
+|@+0#af5f00255&|6+0#e000e06&| +0#0000000&@72
+|@+0#af5f00255&|7+0#e000e06&| +0#0000000&@72
+|@+0#af5f00255&|8+0#e000e06&| +0#0000000&@72
+|@+0#af5f00255&|9+0#e000e06&| +0#0000000&@72
+@75
+|@+0#af5f00255&|a+0#e000e06&| +0#0000000&@72
+|@+0#af5f00255&|k+0#e000e06&| +0#0000000&@72
+|@+0#af5f00255&|z+0#e000e06&| +0#0000000&@72
+@75
+|@+0#af5f00255&|"+0#e000e06&| +0#0000000&@72
+@57|1|,|1| @10|T|o|p|
--- /dev/null
+| +0&#ffffff0@74
+|@+0#af5f00255&|a+0#e000e06&| +0#0000000&@72
+|@+0#af5f00255&|k+0#e000e06&| +0#0000000&@72
+|@+0#af5f00255&|z+0#e000e06&| +0#0000000&@72
+@75
+>@+0#af5f00255&|"+0#e000e06&| +0#0000000&@72
+|@+0#af5f00255&|.+0#e000e06&| +0#0000000&@72
+|@+0#af5f00255&|=+0#e000e06&| +0#0000000&@72
+|@+0#af5f00255&|*+0#e000e06&| +0#0000000&@72
+|@+0#af5f00255&|++0#e000e06&| +0#0000000&@72
+@75
+|@+0#af5f00255&|:+0#e000e06&| +0#0000000&@72
+@75
+|"+0#0000e05&| |r|e|p|e|a|t|s| +0#0000000&@65
+|@+0#af5f00255&| +0#0000000&@73
+|@+0#af5f00255&|@+0#e000e06&| +0#0000000&@72
+@75
+|@+0#af5f00255&|a+0#e000e06&| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|.@2|"| +0#0000000&@59
+|@+0#af5f00255&|a+0#e000e06&| +0#0000000&|"+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@62
+@57|1|9|,|1| @9|2|7|%|
--- /dev/null
+|@+0#af5f00255#ffffff0|a+0#e000e06&| +0#0000000&|"+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@62
+@75
+@75
+|d+0#af5f00255&|e|f| +0#0000000&|V|i|m|9|C|o|n|t|e|x|t|(+0#e000e06&|)| +0#0000000&@57
+@2|:|@+0#af5f00255&|0+0#e000e06&| +0#0000000&@69
+@2>:|@+0#af5f00255&|1+0#e000e06&| +0#0000000&@69
+@2|:|@+0#af5f00255&|2+0#e000e06&| +0#0000000&@69
+@2|:|@+0#af5f00255&|3+0#e000e06&| +0#0000000&@69
+@2|:|@+0#af5f00255&|4+0#e000e06&| +0#0000000&@69
+@2|:|@+0#af5f00255&|5+0#e000e06&| +0#0000000&@69
+@2|:|@+0#af5f00255&|6+0#e000e06&| +0#0000000&@69
+@2|:|@+0#af5f00255&|7+0#e000e06&| +0#0000000&@69
+@2|:|@+0#af5f00255&|8+0#e000e06&| +0#0000000&@69
+@2|:|@+0#af5f00255&|9+0#e000e06&| +0#0000000&@69
+@75
+@2|:|@+0#af5f00255&|a+0#e000e06&| +0#0000000&@69
+@2|:|@+0#af5f00255&|k+0#e000e06&| +0#0000000&@69
+@2|:|@+0#af5f00255&|z+0#e000e06&| +0#0000000&@69
+@75
+@57|3|7|,|3| @9|6|5|%|
--- /dev/null
+| +0&#ffffff0@74
+@2|:|@+0#af5f00255&|"+0#e000e06&| +0#0000000&@69
+@2|:|@+0#af5f00255&|.+0#e000e06&| +0#0000000&@69
+@2|:|@+0#af5f00255&|=+0#e000e06&| +0#0000000&@69
+@2|:|@+0#af5f00255&|*+0#e000e06&| +0#0000000&@69
+@2>:|@+0#af5f00255&|++0#e000e06&| +0#0000000&@69
+@75
+@2|:|@+0#af5f00255&|:+0#e000e06&| +0#0000000&@69
+@75
+@2|#+0#0000e05&| |r|e|p|e|a|t|s| +0#0000000&@63
+@2|:|@+0#af5f00255&| +0#0000000&@70
+@2|:|@+0#af5f00255&|@+0#e000e06&| +0#0000000&@69
+@75
+@2|:|@+0#af5f00255&|a+0#e000e06&| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|.@2|"| +0#0000000&@56
+@2|:|@+0#af5f00255&|a+0#e000e06&| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@59
+|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68
+@75
+|~+0#4040ff13&| @73
+|~| @73
+| +0#0000000&@56|5@1|,|3| @9|B|o|t|
@75
@75
|"+0#0000e05&| |S|T|A|R|T| |N|O|T| |M|A|T|C|H|E|D| +0#0000000&@55
-|:|@| @72
-|:|@+0#e000e06&@1| +0#0000000&@71
|:|N|e|x|t| @69
|:|P|r|i|n|t| @68
|:|X| @72
|:| |h+0#af5f00255&|e|l|p| +0#0000000&@68
@1|:+0#af5f00255&| +0#0000000&|h+0#00e0e07&|e|l|p| +0#0000000&|#| |F|I|X|M|E| @59
@75
+|:|@+0#af5f00255&| +0#0000000&@72
+@75
|:+0#af5f00255&|a|p@1|e|n|d| +0#0000000&@67
| +0#e000002&@3|t|e|x|t| +0#0000000&@66
|.+0#af5f00255&| +0#0000000&@73
-|:+0&#ffffff0| |h+0#af5f00255&|e|l|p| +0#0000000&@68
-@1|:+0#af5f00255&| +0#0000000&|h+0#00e0e07&|e|l|p| +0#0000000&|#| |F|I|X|M|E| @59
+| +0&#ffffff0@74
+|:|@+0#af5f00255&| +0#0000000&@72
@75
|:+0#af5f00255&|a|p@1|e|n|d| +0#0000000&@67
| +0#e000002&@3|t|e|x|t| +0#0000000&@66
# START NOT MATCHED
-:@
-:@@
:Next
:X
# END NOT MATCHED
: help
: help # FIXME
+:@
+
:abbreviate
:abclear
:aboveleft
--- /dev/null
+" Vim :@ command
+
+
+@0
+@1
+@2
+@3
+@4
+@5
+@6
+@7
+@8
+@9
+
+@a
+@k
+@z
+
+@"
+@.
+@=
+@*
+@+
+
+@:
+
+" repeats
+@
+@@
+
+@a | echo "..."
+@a " comment
+
+
+def Vim9Context()
+ :@0
+ :@1
+ :@2
+ :@3
+ :@4
+ :@5
+ :@6
+ :@7
+ :@8
+ :@9
+
+ :@a
+ :@k
+ :@z
+
+ :@"
+ :@.
+ :@=
+ :@*
+ :@+
+
+ :@:
+
+ # repeats
+ :@
+ :@@
+
+ :@a | echo "..."
+ :@a # comment
+enddef
+
" START NOT MATCHED
-:@
-:@@
:Next
:Print
:X
: help
: help # FIXME
+:@
+
:append
text
.
syn case match
" All vimCommands are contained by vimIsCommand. {{{2
-syn cluster vimCmdList contains=vimAbb,vimAddress,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,@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
" Complex Repeats: (:h complex-repeat) {{{2
" ===============
syn match vimCmplxRepeat '[^a-zA-Z_/\\()]q[0-9a-zA-Z"]\>'lc=1
-syn match vimCmplxRepeat '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\>\)'
+
+" NOTE: :* as an alias for :@ is not supported, this is considered a :range,
+" see :help cpo-star
+syn match vimAtArg contained +@\@1<=[0-9a-z".=*+:@]+
+syn match vimAt +@[0-9a-z".=*+:@]\ze\s*\%($\|[|"#]\)+ skipwhite nextgroup=vimCmdSep,vimComment,vim9Comment contains=vimAtArg
+" Vim9: avoid LHS assignment mismatching of :@["#]
+syn match vimAt +@\ze\s*\%($\||\|\s["#]\)+ skipwhite nextgroup=vimCmdSep,vimComment,vim9Comment
" Set command and associated set-options (vimOptions) with comment {{{2
syn match vimSet "\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skipwhite nextgroup=vimSetBang,vimCmdSep,vimComment,vimSetArgs
hi def link vimAbb vimCommand
hi def link vimAddress vimMark
+ hi def link vimAt vimCommand
+ hi def link vimAtArg Special
hi def link vimAugroupBang vimBang
hi def link vimAugroupError vimError
hi def link vimAugroupKey vimCommand