Commit: runtime(vim): Update base syntax, match user-command args
Christian Brabandt <[email protected]>
| Newsgroups | gmane.editors.vim.devel |
|---|---|
| Message-ID | <[email protected]> |
runtime(vim): Update base syntax, match user-command args Commit: https://github.com/vim/vim/commit/21e5e76bac307d860fb7cae7a9c0f2e80305a6fb Author: Doug Kearns <[email protected]> Date: Thu Aug 13 18:37:58 2026 +0000 runtime(vim): Update base syntax, match user-command args - Trailing bar and tail comments are not explicitly supported. The command is matched to EOL. - In Vim9 script the following always matches as an assignment: UserCommand = 2 Use a leading colon to force matching the user command: :UserCommand = 2 - Add highlighting for utility commands VimFold , Vim9, and VimL. fixes: #20854 closes: #21035 Signed-off-by: Doug Kearns <[email protected]> Signed-off-by: Christian Brabandt <[email protected]> diff --git a/runtime/syntax/generator/vim.vim.base b/runtime/syntax/generator/vim.vim.base index aae2864a7..7a72878ea 100644 --- a/runtime/syntax/generator/vim.vim.base +++ b/runtime/syntax/generator/vim.vim.base @@ -2,7 +2,7 @@ " Language: Vim script " Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com> " Doug Kearns <[email protected]> -" Last Change: 2026 Aug 08 +" Last Change: 2026 Aug 12 " Former Maintainer: Charles E. Campbell " DO NOT CHANGE DIRECTLY. @@ -2305,7 +2305,16 @@ syn match vimBracket contained "[\<>]" syn case match " User Command Highlighting: {{{2 -syn match vimUsrCmd contained '\%#=1\<\u[[:alnum:]]*\%([![:space:]]\|$\)\@=' nextgroup=vimBang +" Note: assumes command runs to EOL, no explicit | support + +syn match vimUsrCmd contained '\%#=1\<\u[[:alnum:]]*\%([![:blank:]]\|$\)\@=' skipwhite nextgroup=vimUsrCmdBang,vimUsrCmdArgs +syn match vimUsrCmd_ contained '\%#=1\%(\%(N\%[ext]\|P\%[rint]\|X\)\>\)\@!\u[[:alnum:]]*\%([![:blank:]]\|$\)\@=' skipwhite nextgroup=vimUsrCmdBang,vimUsrCmdArgs +syn match vimUsrCmdBang contained "\w\@1<=!" skipwhite nextgroup=vimUsrCmdArgs +syn region vimUsrCmdArgs contained + \ start="\s\zs\S" + \ skip=+ \s*\%(\\|["#]\ \)+ + \ end="$" + \ contains=@vimContinue " Vim user commands @@ -2324,7 +2333,12 @@ syn match vimSynColorGroup contained "\<\h\w*\>" skipwhite nextgroup=vimHiKeyLis syn keyword vimSynLink contained SynLink skipwhite nextgroup=vimSynLinkGroup syn match vimSynLinkGroup contained "\<\h\w*\>" skipwhite nextgroup=vimGroup contains=vimGroup -syn cluster vimExUserCmdList contains=vimCompilerSet,vimSynColor,vimSynLink,vimSynMenu +" runtime/syntax/vim.vim +syn keyword vimVim9 contained Vim9 skipwhite nextgroup=vimSyntax +syn keyword vimVimL contained VimL skipwhite nextgroup=vimSyntax +syn match vimVimFold contained "\<VimFold \>" skipwhite nextgroup=vimSyntax + +syn cluster vimExUserCmdList contains=vimCompilerSet,vimSynColor,vimSynLink,vimSynMenu,vimVimFold,vimVim9,vimVimL " Errors And Warnings: {{{2 " ==================== @@ -3243,6 +3257,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimUserCmdKey vimCommand hi def link vimUserFunc Normal hi def link vimUserFuncKey vimUserFunc + hi def link vimUsrCmdBang vimBang hi def link vimVar Normal hi def link vimVarKey vimVar hi def link vimVarScope Identifier @@ -3330,10 +3345,13 @@ if !exists("skip_vim_syntax_inits") hi def link vimWincmd_ vimWincmd hi def link vimCompilerSet vimCommand - hi def link vimSynColor vimCommand - hi def link vimSynLink vimCommand + hi def link vimSynColor vimCommand + hi def link vimSynLink vimCommand hi def link vimSynMenu vimCommand hi def link vimSynMenuPath vimMenuName + hi def link vimVimFold vimCommand + hi def link vimVim9 vimCommand + hi def link vimVimL vimCommand endif diff --git a/runtime/syntax/testdir/dumps/vim_ex_command_08.dump b/runtime/syntax/testdir/dumps/vim_ex_command_08.dump index 63a768760..702da91b6 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_command_08.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_command_08.dump @@ -6,8 +6,8 @@ > @74 |"+0#0000e05&| |I|s@1|u|e| |#|1|7|0@1|1| |(|W|r|o|n|g| |v|i|m|U|s|e|r|C|m|d|A|t@1|r|E|r@1|o|r| |h|i|g|h|l|i|g|h|t|i|n|g| |i|n| |v|i|m|.|v|i|m|)| +0#0000000&@8 @75 -|c+0#af5f00255&|o|m@1|a|n|d|!| +0#0000000&|-+0#e000e06&|b|a|n|g| +0#0000000&|-+0#e000e06&|n|a|r|g|s|=|*+0#00e0003&| +0#0000000&|-+0#e000e06&|c|o|m|p|l|e|t|e|=|f+0#00e0003&|i|l|e| +0#0000000&|M+0#0000001#ffff4012|a|k|e| +0#0000000#ffffff0|A|s|y|n|c|R|u|n| |-+0#af5f00255&|p+0#00e0e07&|r|o|g|r|a|m|=+0#af5f00255&|m+0#00e0e07&|a|k|e| +0#0000000&|@| |<+0#e000e06&|a|r|g|s|> -| +0#0000000&@74 +|c+0#af5f00255&|o|m@1|a|n|d|!| +0#0000000&|-+0#e000e06&|b|a|n|g| +0#0000000&|-+0#e000e06&|n|a|r|g|s|=|*+0#00e0003&| +0#0000000&|-+0#e000e06&|c|o|m|p|l|e|t|e|=|f+0#00e0003&|i|l|e| +0#0000000&|M+0#0000001#ffff4012|a|k|e| +0#0000000#ffffff0|A|s|y|n|c|R|u|n| |-|p|r|o|g|r|a|m|=|m|a|k|e| |@| |<|a|r|g|s|> +| @74 @75 |"+0#0000e05&| |I|s@1|u|e| |#|1|7|3|2|6| |(|s|y|n|t|a|x| |h|i|g|h|l|i|g|h|t|i|n|g| |b|r|e|a|k|s| |w|i|t|h| |c|o|m|p|l|e|x| |:|s| |c|o|m|a|m|n|d|)| +0#0000000&@7 @75 diff --git a/runtime/syntax/testdir/dumps/vim_ex_user_command_00.dump b/runtime/syntax/testdir/dumps/vim_ex_user_command_00.dump new file mode 100644 index 000000000..e3bd2a948 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_user_command_00.dump @@ -0,0 +1,20 @@ +>"+0#0000e05#ffffff0| |V|i|m| |u|s|e|r| |c|o|m@1|a|n|d|s| +0#0000000&@55 +|"+0#0000e05&| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |h|i| |l|i|n|k| |v|i|m|U|s|r|C|m|d| |v|i|m|C|o|m@1|a|n|d| +0#0000000&@29 +|"+0#0000e05&| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |h|i| |l|i|n|k| |v|i|m|U|s|r|C|m|d|_| |v|i|m|C|o|m@1|a|n|d| +0#0000000&@28 +|"+0#0000e05&| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |h|i| |l|i|n|k| |v|i|m|U|s|r|C|m|d|A|r|g|s| |T|o|d|o| +0#0000000&@31 +@75 +|F+0#af5f00255&|o@1| +0#0000000&@71 +|:|F+0#af5f00255&|o@1| +0#0000000&@70 +|4+0#e000002&|2|F+0#af5f00255&|o@1| +0#0000000&@69 +|:|4+0#e000002&|2|F+0#af5f00255&|o@1| +0#0000000&@68 +@75 +|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|.@2|"| +0#0000000&||| |F+0#af5f00255&|o@1| +0#0000000&@58 +|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|.@2|"| +0#0000000&||| |:|F+0#af5f00255&|o@1| +0#0000000&@57 +|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|.@2|"| +0#0000000&||| |4+0#e000002&|2|F+0#af5f00255&|o@1| +0#0000000&@56 +|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|.@2|"| +0#0000000&||| |:|4+0#e000002&|2|F+0#af5f00255&|o@1| +0#0000000&@55 +@75 +|F+0#af5f00255&|o@1|!| +0#0000000&@70 +|F+0#af5f00255&|o@1|!| +0#0000000&|a+0#0000001#ffff4012|r|g|1| +0#0000000#ffffff0@65 +| +0#0000001#ffff4012@4|"+0#0000e05#ffffff0|\| |c|o|m@1|e|n|t| +0#0000000&@59 +| +0#0000001#ffff4012@5|\+0#e000e06#ffffff0| +0#0000001#ffff4012|a|r|g|2| +0#0000000#ffffff0@62 +@57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/vim_ex_user_command_01.dump b/runtime/syntax/testdir/dumps/vim_ex_user_command_01.dump new file mode 100644 index 000000000..d492cbdaa --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_user_command_01.dump @@ -0,0 +1,20 @@ +|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|"+0#e000002&|.@2|"| +0#0000000&||| |:|4+0#e000002&|2|F+0#af5f00255&|o@1| +0#0000000&@55 +@75 +|F+0#af5f00255&|o@1|!| +0#0000000&@70 +|F+0#af5f00255&|o@1|!| +0#0000000&|a+0#0000001#ffff4012|r|g|1| +0#0000000#ffffff0@65 +| +0#0000001#ffff4012@4|"+0#0000e05#ffffff0|\| |c|o|m@1|e|n|t| +0#0000000&@59 +| +0#0000001#ffff4012@5>\+0#e000e06#ffffff0| +0#0000001#ffff4012|a|r|g|2| +0#0000000#ffffff0@62 +|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|.@2|"| +0#0000000&@64 +@75 +|F+0#af5f00255&|o@1| +0#0000000&|a+0#0000001#ffff4012|r|g|1| +0#0000000#ffffff0@66 +| +0#0000001#ffff4012@3|"+0#0000e05#ffffff0|\| |c|o|m@1|e|n|t| +0#0000000&@60 +| +0#0000001#ffff4012@3|\+0#e000e06#ffffff0| +0#0000001#ffff4012|a|r|g|2| +0#0000000#ffffff0@64 +|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|.@2|"| +0#0000000&@64 +@75 +|F+0#af5f00255&|o@1| +0#0000000&||+0#0000001#ffff4012| |t|r|a|i|l|i|n|g| |b|a|r| |n|o|t| |s|u|p@1|o|r|t|e|d| +0#0000000#ffffff0@42 +|F+0#af5f00255&|o@1| +0#0000000&|"+0#0000001#ffff4012| |t|a|i|l| |c|o|m@1|e|n|t|s| |n|o|t| |s|u|p@1|o|r|t|e|d| +0#0000000#ffffff0@41 +@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|F+0#af5f00255&|o@1| +0#0000000&@69 +@2|:|F+0#af5f00255&|o@1| +0#0000000&@68 +@57|1|9|,|7| @9|2|7|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_user_command_02.dump b/runtime/syntax/testdir/dumps/vim_ex_user_command_02.dump new file mode 100644 index 000000000..e4967ed77 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_user_command_02.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@1|:|F+0#af5f00255&|o@1| +0#0000000&@68 +@2|:|4+0#e000002&|2|F+0#af5f00255&|o@1| +0#0000000&@66 +@75 +@2|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|.@2|"| +0#0000000&||| |F+0#af5f00255&|o@1| +0#0000000&@56 +@2|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|.@2|"| +0#0000000&||| |:|F+0#af5f00255&|o@1| +0#0000000&@55 +@2>e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|.@2|"| +0#0000000&||| |:|4+0#e000002&|2|F+0#af5f00255&|o@1| +0#0000000&@53 +@75 +@2|F+0#af5f00255&|o@1|!| +0#0000000&@68 +@2|F+0#af5f00255&|o@1|!| +0#0000000&|a+0#0000001#ffff4012|r|g|1| +0#0000000#ffffff0@63 +| +0#0000001#ffff4012@6|#+0#0000e05#ffffff0|\| |c|o|m@1|e|n|t| +0#0000000&@57 +| +0#0000001#ffff4012@7|\+0#e000e06#ffffff0| +0#0000001#ffff4012|a|r|g|2| +0#0000000#ffffff0@60 +@2|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|.@2|"| +0#0000000&@62 +@75 +@2|F+0#af5f00255&|o@1| +0#0000000&|a+0#0000001#ffff4012|r|g|1| +0#0000000#ffffff0@64 +| +0#0000001#ffff4012@5|#+0#0000e05#ffffff0|\| |c|o|m@1|e|n|t| +0#0000000&@58 +| +0#0000001#ffff4012@5|\+0#e000e06#ffffff0| +0#0000001#ffff4012|a|r|g|2| +0#0000000#ffffff0@62 +@2|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|.@2|"| +0#0000000&@62 +@75 +@2|F+0#af5f00255&|o@1| +0#0000000&||+0#0000001#ffff4012| |t|r|a|i|l|i|n|g| |b|a|r| |n|o|t| |s|u|p@1|o|r|t|e|d| +0#0000000#ffffff0@40 +@57|3|7|,|3| @9|6|5|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_user_command_03.dump b/runtime/syntax/testdir/dumps/vim_ex_user_command_03.dump new file mode 100644 index 000000000..276e9445f --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_ex_user_command_03.dump @@ -0,0 +1,20 @@ +| +0&#ffffff0@1|F+0#af5f00255&|o@1| +0#0000000&||+0#0000001#ffff4012| |t|r|a|i|l|i|n|g| |b|a|r| |n|o|t| |s|u|p@1|o|r|t|e|d| +0#0000000#ffffff0@40 +@2|F+0#af5f00255&|o@1| +0#0000000&|#+0#0000001#ffff4012| |t|a|i|l| |c|o|m@1|e|n|t|s| |n|o|t| |s|u|p@1|o|r|t|e|d| +0#0000000#ffffff0@39 +|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 +@75 +@75 +>"+0#0000e05&| |I|s@1|u|e| |#|2|0|8|5|4| |(|C|u|s|t|o|m| |c|o|m@1|a|n|d| |c|a|l@1| |w|i|t|h| |t|h|e| |d|o|t| |i|n| |t|h|e| |e|n|d| |b|r|e|a|k|s| |n|e|x|t| +0#0000000&@3 +|"+0#0000e05&| @2|h|i|g|h|l|i|g|h|t|i|n|g|)| +0#0000000&@57 +@75 +|d+0#af5f00255&|e|f| +0#0000000&|R|u|n|O|d|i|n|(+0#e000e06&|)| +0#0000000&@61 +@4|u+0#af5f00255&|p|d|a|t|e| +0#0000000&@64 +@4|i+0#af5f00255&|f| +0#0000000&|!+0#af5f00255&|e+0#00e0e07&|x|i|s|t|s|(+0#e000e06&|"+0#e000002&|$|W|S|L|_|D|I|S|T|R|O|_|N|A|M|E|"|)+0#e000e06&| +0#0000000&@40 +@8|T+0#af5f00255&|e|r|m|!| +0#0000000&|o+0#0000001#ffff4012|d|i|n| |r|u|n| |.| +0#0000000#ffffff0@50 +@4|e+0#af5f00255&|l|s|e| +0#0000000&@66 +@8|T+0#af5f00255&|e|r|m|!| +0#0000000&|o+0#0000001#ffff4012|d|i|n| |r|u|n| |.| |-|t|h|r|e|a|d|-|c|o|u|n|t|:|1| +0#0000000#ffffff0@34 +@4|e+0#af5f00255&|n|d|i|f| +0#0000000&@65 +|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 +@75 +|~+0#4040ff13&| @73 +|~| @73 +| +0#0000000&@56|5@1|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim_predefined_user_commands_00.dump b/runtime/syntax/testdir/dumps/vim_predefined_user_commands_00.dump index 8d0e81c23..86058c12a 100644 --- a/runtime/syntax/testdir/dumps/vim_predefined_user_commands_00.dump +++ b/runtime/syntax/testdir/dumps/vim_predefined_user_commands_00.dump @@ -1,20 +1,20 @@ >"+0#0000e05#ffffff0| |V|i|m| |p|r|e|d|e|f|i|n|e|d| |u|s|e|r| |c|o|m@1|a|n|d|s| +0#0000000&@44 @75 @75 -|"+0#0000e05&| |:|C|o|m|p|i|l|e|r|S|e|t| |-| |r|u|n|t|i|m|e|/|c|o|m|p|i|l|e|r|/| +0#0000000&@40 +|"+0#0000e05&| |:|C|o|m|p|i|l|e|r|S|e|t| |-| |r|u|n|t|i|m|e|/|c|o|m|p|i|l|e|r|/|*|.|v|i|m| +0#0000000&@35 @75 |C+0#af5f00255&|o|m|p|i|l|e|r|S|e|t| +0#0000000&|m+0#e000e06&|a|k|e|p|r|g|=+0#af5f00255&|a+0#0000000&|n|t| @51 |C+0#af5f00255&|o|m|p|i|l|e|r|S|e|t| +0#0000000&|e+0#e000e06&|r@1|o|r|f|o|r|m|a|t|=+0#af5f00255&|\+0#0000000&| |%|#|[|%|.|%|#|]|\| |%|#|%|f|:+0#e000e06&|%+0#0000000&|l|:+0#e000e06&|%+0#0000000&|v|:+0#e000e06&|%+0#0000000&|*|\@1|d|:+0#e000e06&|%+0#0000000&|*|\@1|d|:+0#e000e06&|\+0#0000000&| |%|t|%|[|%|^|:+0#e000e06&|]+0#0000000&|%|#|:+0#e000e06&|%+0#0000000&|m|,+0#e000e06& | +0#0000000&@3|\+0#e000e06&|%+0#0000000&|A|\| |%|#|[|%|.|%|#|]|\| |%|f|:+0#e000e06&|%+0#0000000&|l|:+0#e000e06&|\+0#0000000&| |%|m|,+0#e000e06&|%+0#0000000&|-|Z|\| |%|#|[|%|.|%|#|]|\| |%|p|^|,+0#e000e06&|%+0#0000000&|C|\| |%|#|[|%|.|%|#|]|\| |%|#|%|m| @7 @75 +|"+0#0000e05&| |:|S|y|n|C|o|l|o|r| |-| |r|u|n|t|i|m|e|/|s|y|n|m|e|n|u|.|v|i|m| +0#0000000&@41 +@75 +|S+0#af5f00255&|y|n|C|o|l|o|r| +0#0000000&|C+0#00e0003&|o|m@1|e|n|t| +0#0000000&|t+0#00e0003&|e|r|m|=+0#0000000&|b+0#e000e06&|o|l|d| +0#0000000&|c+0#00e0003&|t|e|r|m|=+0#0000000&|N+0#e000e06&|O|N|E| +0#0000000&|c+0#00e0003&|t|e|r|m|f|g|=+0#0000000&|C+0#e000002&|y|a|n| +0#0000000&|c+0#00e0003&|t|e|r|m|b|g|=+0#0000000&|N+0#e000e06&|O|N|E| +0#0000000&|g+0#00e0003&|u|i|=+0#0000000&|N+0#e000e06&|O|N|E| +0#0000000&|g+0#00e0003&|u +|i|f|g|=+0#0000000&|#+0#e000002&|8|0|a|0|f@1| +0#0000000&|g+0#00e0003&|u|i|b|g|=+0#0000000&|N+0#e000e06&|O|N|E| +0#0000000&@52 @75 |"+0#0000e05&| |:|S|y|n|M|e|n|u| |-| |r|u|n|t|i|m|e|/|m|a|k|e|m|e|n|u|.|v|i|m| +0#0000000&@41 @75 |S+0#af5f00255&|y|n|M|e|n|u| +0#e000e06&|A|B|.|A|2|p|s|\| |c|o|n|f|i|g|:+0#0000000&|a|2|p|s| @46 |S+0#af5f00255&|y|n|M|e|n|u| +0#e000e06&|A|B|.|A|a|p|:+0#0000000&|a@1|p| @56 |S+0#af5f00255&|y|n|M|e|n|u| +0#e000e06&|A|B|.|A|B|A|P|/|4|:+0#0000000&|a|b|a|p| @52 -|S+0#af5f00255&|y|n|M|e|n|u| +0#e000e06&|A|B|.|A|b|a|q|u|s|:+0#0000000&|a|b|a|q|u|s| @50 -|S+0#af5f00255&|y|n|M|e|n|u| +0#e000e06&|A|B|.|A|B|C|\| |m|u|s|i|c|\| |n|o|t|a|t|i|o|n|:+0#0000000&|a|b|c| @39 -|S+0#af5f00255&|y|n|M|e|n|u| +0#e000e06&|A|B|.|A|B|E|L|:+0#0000000&|a|b|e|l| @54 -|S+0#af5f00255&|y|n|M|e|n|u| +0#e000e06&|A|B|.|A|c|e|D|B|\| |m|o|d|e|l|:+0#0000000&|a|c|e|d|b| @45 @57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/vim_predefined_user_commands_01.dump b/runtime/syntax/testdir/dumps/vim_predefined_user_commands_01.dump index 39475638f..934780272 100644 --- a/runtime/syntax/testdir/dumps/vim_predefined_user_commands_01.dump +++ b/runtime/syntax/testdir/dumps/vim_predefined_user_commands_01.dump @@ -1,20 +1,20 @@ -|S+0#af5f00255#ffffff0|y|n|M|e|n|u| +0#e000e06&|A|B|.|A|a|p|:+0#0000000&|a@1|p| @56 -|S+0#af5f00255&|y|n|M|e|n|u| +0#e000e06&|A|B|.|A|B|A|P|/|4|:+0#0000000&|a|b|a|p| @52 +| +0&#ffffff0@74 +|"+0#0000e05&| |:|S|y|n|M|e|n|u| |-| |r|u|n|t|i|m|e|/|m|a|k|e|m|e|n|u|.|v|i|m| +0#0000000&@41 +@75 +|S+0#af5f00255&|y|n|M|e|n|u| +0#e000e06&|A|B|.|A|2|p|s|\| |c|o|n|f|i|g|:+0#0000000&|a|2|p|s| @46 +|S+0#af5f00255&|y|n|M|e|n|u| +0#e000e06&|A|B|.|A|a|p|:+0#0000000&|a@1|p| @56 +>S+0#af5f00255&|y|n|M|e|n|u| +0#e000e06&|A|B|.|A|B|A|P|/|4|:+0#0000000&|a|b|a|p| @52 |S+0#af5f00255&|y|n|M|e|n|u| +0#e000e06&|A|B|.|A|b|a|q|u|s|:+0#0000000&|a|b|a|q|u|s| @50 |S+0#af5f00255&|y|n|M|e|n|u| +0#e000e06&|A|B|.|A|B|C|\| |m|u|s|i|c|\| |n|o|t|a|t|i|o|n|:+0#0000000&|a|b|c| @39 |S+0#af5f00255&|y|n|M|e|n|u| +0#e000e06&|A|B|.|A|B|E|L|:+0#0000000&|a|b|e|l| @54 ->S+0#af5f00255&|y|n|M|e|n|u| +0#e000e06&|A|B|.|A|c|e|D|B|\| |m|o|d|e|l|:+0#0000000&|a|c|e|d|b| @45 +|S+0#af5f00255&|y|n|M|e|n|u| +0#e000e06&|A|B|.|A|c|e|D|B|\| |m|o|d|e|l|:+0#0000000&|a|c|e|d|b| @45 |S+0#af5f00255&|y|n|M|e|n|u| +0#e000e06&|A|B|.|A|d|a|:+0#0000000&|a|d|a| @56 @75 -|~+0#4040ff13&| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -| +0#0000000&@56|1|9|,|1| @9|B|o|t| +|"+0#0000e05&| |:|V|i|m|F|o|l|d|\|a|,| |:|V|i|m|9|,| |:|V|i|m|L| |-| |r|u|n|t|i|m|e|/|s|y|n|t|a|x|/|v|i|m|.|v|i|m| +0#0000000&@23 +@75 +|V+0#af5f00255&|i|m|F|o|l|d|a| +0#0000000&|s+0#af5f00255&|y|n|t|a|x| +0#0000000&|r+0#00e0003&|e|g|i|o|n| +0#0000000&|v|i|m|F|o@1| |s+0#00e0003&|t|a|r|t|=|"+0#e000002&|f|o@1|"| +0#0000000&|e+0#00e0003&|n|d|=|"+0#e000002&|b|a|r|"| +0#0000000&@23 +@75 +|V+0#af5f00255&|i|m|9| +0#0000000&|s+0#af5f00255&|y|n|t|a|x| +0#0000000&|k+0#00e0003&|e|y|w|o|r|d| +0#0000000&|v|i|m|9|F|o@1| |f|o@1| |n+0#e000e06&|e|x|t|g|r|o|u|p|=|v+0#0000000&|i|m|9|C|o|m@1|e|n|t| @21 +|V+0#af5f00255&|i|m|L| +0#0000000&|s+0#af5f00255&|y|n|t|a|x| +0#0000000&|k+0#00e0003&|e|y|w|o|r|d| +0#0000000&|v|i|m|F|o@1| @1|f|o@1| |n+0#e000e06&|e|x|t|g|r|o|u|p|=|v+0#0000000&|i|m|C|o|m@1|e|n|t| @22 +@75 +@57|1|8|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/input/vim_ex_user_command.vim b/runtime/syntax/testdir/input/vim_ex_user_command.vim new file mode 100644 index 000000000..900d567e6 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_user_command.vim @@ -0,0 +1,66 @@ +" Vim user commands +" VIM_TEST_SETUP hi link vimUsrCmd vimCommand +" VIM_TEST_SETUP hi link vimUsrCmd_ vimCommand +" VIM_TEST_SETUP hi link vimUsrCmdArgs Todo + +Foo +:Foo +42Foo +:42Foo + +echo "..." | Foo +echo "..." | :Foo +echo "..." | 42Foo +echo "..." | :42Foo + +Foo! +Foo! arg1 + "\ comment + \ arg2 +echo "..." + +Foo arg1 + "\ comment + \ arg2 +echo "..." + +Foo | trailing bar not supported +Foo " tail comments not supported + +def Vim9Context() + Foo + :Foo + :42Foo + + echo "..." | Foo + echo "..." | :Foo + echo "..." | :42Foo + + Foo! + Foo! arg1 + #\ comment + \ arg2 + echo "..." + + Foo arg1 + #\ comment + \ arg2 + echo "..." + + Foo | trailing bar not supported + Foo # tail comments not supported +enddef + + +" Issue #20854 (Custom command call with the dot in the end breaks next +" highlighting) + +def RunOdin() + update + if !exists("$WSL_DISTRO_NAME") + Term! odin run . + else + Term! odin run . -thread-count:1 + endif +enddef + diff --git a/runtime/syntax/testdir/input/vim_predefined_user_commands.vim b/runtime/syntax/testdir/input/vim_predefined_user_commands.vim index 8b178909a..653d66a3b 100644 --- a/runtime/syntax/testdir/input/vim_predefined_user_commands.vim +++ b/runtime/syntax/testdir/input/vim_predefined_user_commands.vim @@ -1,12 +1,15 @@ " Vim predefined user commands -" :CompilerSet - runtime/compiler/ +" :CompilerSet - runtime/compiler/*.vim CompilerSet makeprg=ant CompilerSet errorformat=\ %#[%.%#]\ %#%f:%l:%v:%*\d:%*\d:\ %t%[%^:]%#:%m, \%A\ %#[%.%#]\ %f:%l:\ %m,%-Z\ %#[%.%#]\ %p^,%C\ %#[%.%#]\ %#%m +" :SynColor - runtime/synmenu.vim + +SynColor Comment term=bold cterm=NONE ctermfg=Cyan ctermbg=NONE gui=NONE guifg=#80a0ff guibg=NONE " :SynMenu - runtime/makemenu.vim @@ -19,3 +22,10 @@ SynMenu AB.ABEL:abel SynMenu AB.AceDB\ model:acedb SynMenu AB.Ada:ada +" :VimFold , :Vim9, :VimL - runtime/syntax/vim.vim + +VimFolda syntax region vimFoo start="foo" end="bar" + +Vim9 syntax keyword vim9Foo foo nextgroup=vim9Comment +VimL syntax keyword vimFoo foo nextgroup=vimComment + diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 34dec2772..21c9d3b56 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -2,7 +2,7 @@ " Language: Vim script " Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com> " Doug Kearns <[email protected]> -" Last Change: 2026 Aug 10 +" Last Change: 2026 Aug 12 " Former Maintainer: Charles E. Campbell " DO NOT CHANGE DIRECTLY. @@ -2404,7 +2404,16 @@ syn match vimBracket contained "[\<>]" syn case match " User Command Highlighting: {{{2 -syn match vimUsrCmd contained '\%#=1\<\u[[:alnum:]]*\%([![:space:]]\|$\)\@=' nextgroup=vimBang +" Note: assumes command runs to EOL, no explicit | support + +syn match vimUsrCmd contained '\%#=1\<\u[[:alnum:]]*\%([![:blank:]]\|$\)\@=' skipwhite nextgroup=vimUsrCmdBang,vimUsrCmdArgs +syn match vimUsrCmd_ contained '\%#=1\%(\%(N\%[ext]\|P\%[rint]\|X\)\>\)\@!\u[[:alnum:]]*\%([![:blank:]]\|$\)\@=' skipwhite nextgroup=vimUsrCmdBang,vimUsrCmdArgs +syn match vimUsrCmdBang contained "\w\@1<=!" skipwhite nextgroup=vimUsrCmdArgs +syn region vimUsrCmdArgs contained + \ start="\s\zs\S" + \ skip=+ \s*\%(\\|["#]\ \)+ + \ end="$" + \ contains=@vimContinue " Vim user commands @@ -2423,7 +2432,12 @@ syn match vimSynColorGroup contained "\<\h\w*\>" skipwhite nextgroup=vimHiKeyLis syn keyword vimSynLink contained SynLink skipwhite nextgroup=vimSynLinkGroup syn match vimSynLinkGroup contained "\<\h\w*\>" skipwhite nextgroup=vimGroup contains=vimGroup -syn cluster vimExUserCmdList contains=vimCompilerSet,vimSynColor,vimSynLink,vimSynMenu +" runtime/syntax/vim.vim +syn keyword vimVim9 contained Vim9 skipwhite nextgroup=vimSyntax +syn keyword vimVimL contained VimL skipwhite nextgroup=vimSyntax +syn match vimVimFold contained "\<VimFold \>" skipwhite nextgroup=vimSyntax + +syn cluster vimExUserCmdList contains=vimCompilerSet,vimSynColor,vimSynLink,vimSynMenu,vimVimFold,vimVim9,vimVimL " Errors And Warnings: {{{2 " ==================== @@ -3342,6 +3356,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimUserCmdKey vimCommand hi def link vimUserFunc Normal hi def link vimUserFuncKey vimUserFunc + hi def link vimUsrCmdBang vimBang hi def link vimVar Normal hi def link vimVarKey vimVar hi def link vimVarScope Identifier @@ -3429,10 +3444,13 @@ if !exists("skip_vim_syntax_inits") hi def link vimWincmd_ vimWincmd hi def link vimCompilerSet vimCommand - hi def link vimSynColor vimCommand - hi def link vimSynLink vimCommand + hi def link vimSynColor vimCommand + hi def link vimSynLink vimCommand hi def link vimSynMenu vimCommand hi def link vimSynMenuPath vimMenuName + hi def link vimVimFold vimCommand + hi def link vimVim9 vimCommand + hi def link vimVimL vimCommand endif -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/vim_dev/E1wuaQL-0026NO-Hn%40256bit.org.