diff --git a/runtime/syntax/testdir/dumps/vim_map_00.dump b/runtime/syntax/testdir/dumps/vim_map_00.dump new file mode 100644 index 0000000000..d3a290e9b6 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_map_00.dump @@ -0,0 +1,20 @@ +>"+0#0000e05#ffffff0| |V|i|m| |m|a|p| |c|o|m@1|a|n|d|s| +0#0000000&@56 +@75 +|m+0#af5f00255&|a|p|!| +0#0000000&@70 +|m+0#af5f00255&|a|p|!| +0#0000000&|l|h|s| |r|h|s| @62 +|m+0#af5f00255&|a|p| +0#0000000&@71 +|m+0#af5f00255&|a|p| +0#0000000&|l|h|s| |r|h|s| @63 +@75 +|c+0#af5f00255&|a|l@1| +0#0000000&|m+0#00e0e07&|a|p|(+0#e000e06&|l+0#00e0e07&|i|s|t|,+0#0000000&| |'+0#e000002&|v|:|v|a|l|'|)+0#e000e06&| +0#0000000&@51 +|c+0#af5f00255&|a|l@1| +0#0000000&|m+0#00e0e07&|a|p| +0#0000000&|(+0#e000e06&|l+0#00e0e07&|i|s|t|,+0#0000000&| |'+0#e000002&|v|:|v|a|l|'|)+0#e000e06&| +0#0000000&@50 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|"+0#0000000&|i|n|p|u|t|/|v|i|m|_|m|a|p|.|v|i|m|"| |9|L|,| |1|0|5|B| @28|1|,|1| @10|A|l@1| diff --git a/runtime/syntax/testdir/dumps/vim_map_99.dump b/runtime/syntax/testdir/dumps/vim_map_99.dump new file mode 100644 index 0000000000..f8710b9538 --- /dev/null +++ b/runtime/syntax/testdir/dumps/vim_map_99.dump @@ -0,0 +1,20 @@ +|"+0#0000e05#ffffff0| |V|i|m| |m|a|p| |c|o|m@1|a|n|d|s| +0#0000000&@56 +@75 +|m+0#af5f00255&|a|p|!| +0#0000000&@70 +|m+0#af5f00255&|a|p|!| +0#0000000&|l|h|s| |r|h|s| @62 +|m+0#af5f00255&|a|p| +0#0000000&@71 +|m+0#af5f00255&|a|p| +0#0000000&|l|h|s| |r|h|s| @63 +@75 +|c+0#af5f00255&|a|l@1| +0#0000000&|m+0#00e0e07&|a|p|(+0#e000e06&|l+0#00e0e07&|i|s|t|,+0#0000000&| |'+0#e000002&|v|:|v|a|l|'|)+0#e000e06&| +0#0000000&@51 +>c+0#af5f00255&|a|l@1| +0#0000000&|m+0#00e0e07&|a|p| +0#0000000&|(+0#e000e06&|l+0#00e0e07&|i|s|t|,+0#0000000&| |'+0#e000002&|v|:|v|a|l|'|)+0#e000e06&| +0#0000000&@50 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|"+0#0000000&|i|n|p|u|t|/|v|i|m|_|m|a|p|.|v|i|m|"| |9|L|,| |1|0|5|B| @28|9|,|1| @10|A|l@1| diff --git a/runtime/syntax/testdir/input/vim_map.vim b/runtime/syntax/testdir/input/vim_map.vim new file mode 100644 index 0000000000..7c73b996f4 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_map.vim @@ -0,0 +1,9 @@ +" Vim map commands + +map! +map! lhs rhs +map +map lhs rhs + +call map(list, 'v:val') +call map (list, 'v:val') diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index e9feb35b5b..983c2639a0 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -2,19 +2,22 @@ " Language: Vim 9.0 script " Maintainer: Charles E. Campbell " Last Change: May 09, 2023 -" 2023 Nov 12 by Vim Project (:let-heredoc improvements) -" 2023 Nov 20 by Vim Project (:loadkeymap improvements) -" 2023 Dec 06 by Vim Project (add missing assignment operators) -" 2023 Dec 10 by Vim Project (improve variable matching) -" 2023 Dec 21 by Vim Project (improve ex command matching) -" 2023 Dec 30 by Vim Project (:syntax improvements) -" 2024 Jan 14 by Vim Project (TermResponseAll autocommand) -" 2024 Jan 15 by Vim Project (:hi ctermfont attribute) -" 2024 Jan 23 by Vim Project (add :[23]match commands) -" 2024 Jan 25 by Vim Project (WinNewPre autocommand) -" 2024 Jan 27 by Vim Project (add foreach() function) -" 2024 Jan 28 by Vim Project (improve line-continuation matching & string interpolation) -" 2024 Feb 01 by Vim Project (improve special key matching) +" Vim Project changes: {{{1 +" 2023 Nov 12 (:let-heredoc improvements) +" 2023 Nov 20 (:loadkeymap improvements) +" 2023 Dec 06 (add missing assignment operators) +" 2023 Dec 10 (improve variable matching) +" 2023 Dec 21 (improve ex command matching) +" 2023 Dec 30 (:syntax improvements) +" 2024 Jan 14 (TermResponseAll autocommand) +" 2024 Jan 15 (:hi ctermfont attribute) +" 2024 Jan 23 (add :[23]match commands) +" 2024 Jan 25 (WinNewPre autocommand) +" 2024 Jan 27 (add foreach() function) +" 2024 Jan 28 (improve line-continuation matching & string interpolation) +" 2024 Feb 01 (improve special key matching) +" 2024 Feb 10 (improve :highlight and :map) +" }}} " Version: 9.0-25 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM " Automatically generated keyword lists: {{{1 @@ -481,7 +484,8 @@ syn case match " Maps: {{{2 " ==== -syn match vimMap "\!\=\ze\s*[^(]" skipwhite nextgroup=vimMapMod,vimMapLhs +syn match vimMap "\\ze\s*(\@!" skipwhite nextgroup=vimMapMod,vimMapLhs +syn match vimMap "\