runtime(vim): Update base-syntax, bug fixes
- Allow trailing backslashes in option values.
- Match :map-special modifier.
- Match :map-arguments case-sensitively.
- Remove <*Leader> from map modifier list and allow in RHS of a mapping.
closes: #16822
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/runtime/syntax/generator/vim.vim.base b/runtime/syntax/generator/vim.vim.base
index 8ae6929..01786ab 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 <dougkearns@gmail.com>
-" Last Change: 2025 Feb 27
+" Last Change: 2025 Mar 06
" Former Maintainer: Charles E. Campbell
" DO NOT CHANGE DIRECTLY.
@@ -716,9 +716,9 @@
syn match vimCmplxRepeat '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\>\)'
" Set command and associated set-options (vimOptions) with comment {{{2
-syn match vimSet "\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skipwhite nextgroup=vimSetBang,vimSetRegion
-syn region vimSetRegion contained start="\S" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*["#]\\ + matchgroup=vimCmdSep end="|" end="$" matchgroup=vimNotation end="<[cC][rR]>" keepend contains=@vimComment,@vimContinue,vimErrSetting,vimOption,vimSetAll,vimSetTermcap
-syn region vimSetEqual contained matchgroup=vimOper start="[=:]\|[-+^]=" skip=+\\\\\|\\|\|\\\s\|\n\s*\\\|\n\s*["#]\\ \|^\s*\\\|^\s*["#]\\ + matchgroup=vimCmdSep end="|" end="\ze\s" end="$" contains=@vimContinue,vimCtrlChar,vimEnvvar,vimNotation,vimSetSep
+syn match vimSet "\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skipwhite nextgroup=vimSetBang,vimSetArgs
+syn region vimSetArgs contained start="\S" skip=+\\|\|\n\s*\\\|\n\s*["#]\\ + matchgroup=vimCmdSep end="|" end="$" matchgroup=vimNotation end="<[cC][rR]>" keepend contains=@vimComment,@vimContinue,vimErrSetting,vimOption,vimSetAll,vimSetTermcap
+syn region vimSetEqual contained matchgroup=vimOper start="[=:]\|[-+^]=" skip=+\\|\|\\\s\|\n\s*\\\|\n\s*["#]\\ \|^\s*\\\|^\s*["#]\\ + matchgroup=vimCmdSep end="|" end="\ze\s" end="$" contains=@vimContinue,vimCtrlChar,vimEnvvar,vimNotation,vimSetSep
syn match vimSetBang contained "\a\@1<=!" skipwhite nextgroup=vimSetAll,vimSetTermcap
syn keyword vimSetAll contained all nextgroup=vimSetMod
syn keyword vimSetTermcap contained termcap
@@ -835,15 +835,17 @@
" GEN_SYN_VIM: vimCommand unmap, START_STR='syn keyword vimUnmap', END_STR='skipwhite nextgroup=vimMapMod,vimMapLhs'
syn keyword vimUnmap unm[ap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
-syn match vimMapLhs contained "\%(.\|\S\)\+" contains=vimCtrlChar,vimNotation skipwhite nextgroup=vimMapRhs
-syn match vimMapLhs contained "\%(.\|\S\)\+\ze\s*$" contains=vimCtrlChar,vimNotation skipwhite skipnl nextgroup=vimMapRhsContinue
+syn match vimMapLhs contained "\%(.\|\S\)\+" contains=vimCtrlChar,vimNotation,vimMapLeader skipwhite nextgroup=vimMapRhs
+syn match vimMapLhs contained "\%(.\|\S\)\+\ze\s*$" contains=vimCtrlChar,vimNotation,vimMapLeader skipwhite skipnl nextgroup=vimMapRhsContinue
syn match vimMapBang contained "\a\@1<=!" skipwhite nextgroup=vimMapMod,vimMapLhs
-syn match vimMapMod contained "\%#=1\c<\(buffer\|expr\|\(local\)\=leader\|nowait\|plug\|script\|sid\|unique\|silent\)\+>" contains=vimMapModKey,vimMapModErr skipwhite nextgroup=vimMapMod,vimMapLhs
-syn region vimMapRhs contained start="\S" skip=+\\|\|\@1<=|\|\n\s*\\\|\n\s*"\\ + end="|" end="$" contains=@vimContinue,vimCtrlChar,vimNotation skipnl nextgroup=vimMapRhsContinue
+syn match vimMapMod contained "\%#=1<\%(buffer\|expr\|nowait\|script\|silent\|special\|unique\)\+>" contains=vimMapModKey,vimMapModErr skipwhite nextgroup=vimMapMod,vimMapLhs
+syn region vimMapRhs contained start="\S" skip=+\\|\|\@1<=|\|\n\s*\\\|\n\s*"\\ + end="|" end="$" contains=@vimContinue,vimCtrlChar,vimNotation,vimMapLeader skipnl nextgroup=vimMapRhsContinue
" assume a continuation comment introduces the RHS
-syn region vimMapRhsContinue contained start=+^\s*\%(\\\|"\\ \)+ skip=+\\|\|\@1<=|\|\n\s*\\\|\n\s*"\\ + end="|" end="$" contains=@vimContinue,vimCtrlChar,vimNotation
+syn region vimMapRhsContinue contained start=+^\s*\%(\\\|"\\ \)+ skip=+\\|\|\@1<=|\|\n\s*\\\|\n\s*"\\ + end="|" end="$" contains=@vimContinue,vimCtrlChar,vimNotation,vimMapLeader
+syn match vimMapLeader contained "\%#=1\c<\%(local\)\=leader>" contains=vimMapLeaderKey
+syn keyword vimMapModKey contained buffer expr nowait script silent special unique
syn case ignore
-syn keyword vimMapModKey contained buffer expr leader localleader nowait plug script sid silent unique
+syn keyword vimMapLeaderKey contained leader localleader
syn case match
" Menus: {{{2
@@ -908,7 +910,7 @@
" Vim user commands
" Compiler plugins
-syn match vimCompilerSet "\<CompilerSet\>" skipwhite nextgroup=vimSetRegion
+syn match vimCompilerSet "\<CompilerSet\>" skipwhite nextgroup=vimSetArgs
" runtime/makemenu.vim
syn match vimSynMenu "\<SynMenu\>" skipwhite nextgroup=vimSynMenuPath
@@ -1487,6 +1489,8 @@
hi def link vimLetRegister Special
hi def link vimLineComment vimComment
hi def link vimMapBang vimBang
+ hi def link vimMapLeader vimBracket
+ hi def link vimMapLeaderKey vimNotation
hi def link vimMapModKey vimFuncSID
hi def link vimMapMod vimBracket
hi def link vimMap vimCommand
diff --git a/runtime/syntax/testdir/dumps/vim_ex_map_00.dump b/runtime/syntax/testdir/dumps/vim_ex_map_00.dump
index 763e641..0f5ccdb 100644
--- a/runtime/syntax/testdir/dumps/vim_ex_map_00.dump
+++ b/runtime/syntax/testdir/dumps/vim_ex_map_00.dump
@@ -5,16 +5,16 @@
|m+0#af5f00255&|a|p| +0#0000000&@71
|m+0#af5f00255&|a|p| +0#0000000&|l|h|s| |r|h|s| @63
@75
-|m+0#af5f00255&|a|p|c|l|e|a|r| +0#0000000&@1|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@56
-|m+0#af5f00255&|a|p|c|l|e|a|r|!| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@56
-|n+0#af5f00255&|m|a|p|c|l|e|a|r| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@56
-|v+0#af5f00255&|m|a|p|c|l|e|a|r| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@56
-|x+0#af5f00255&|m|a|p|c|l|e|a|r| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@56
-|s+0#af5f00255&|m|a|p|c|l|e|a|r| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@56
-|o+0#af5f00255&|m|a|p|c|l|e|a|r| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@56
-|i+0#af5f00255&|m|a|p|c|l|e|a|r| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@56
-|l+0#af5f00255&|m|a|p|c|l|e|a|r| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@56
-|c+0#af5f00255&|m|a|p|c|l|e|a|r| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@56
-|t+0#af5f00255&|m|a|p|c|l|e|a|r| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@56
+|m+0#af5f00255&|a|p| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>|<|e|x|p|r|>|<|n|o|w|a|i|t|>|<|s|c|r|i|p|t|>|<|s|i|l|e|n|t|>|<|s|p|e|c|i|a|l|>|<|u|n|i|q|u|e|>| +0#0000000&|l|h|s| |r|h|s| @7
+|m+0#af5f00255&|a|p| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&|<+0#e000e06&|e|x|p|r|>| +0#0000000&|<+0#e000e06&|n|o|w|a|i|t|>| +0#0000000&|<+0#e000e06&|s|c|r|i|p|t|>| +0#0000000&|<+0#e000e06&|s|i|l|e|n|t|>| +0#0000000&|<+0#e000e06&|s|p|e|c|i|a|l|>| +0#0000000&|<+0#e000e06&|u|n|i|q|u|e|>| +0#0000000&|l|h|s| |r|h|s| @1
+@75
+|"+0#0000e05&| |:|m|a|p| |s|p|e|c|i|a|l| |a|r|g|u|m|e|n|t|s| |a|r|e| |c|a|s|e| |s|e|n|s|i|t|i|v|e|,| |<|B|U|F@1|E|R|>| |i|s| |t|h|e| |L|H|S| +0#0000000&@10
+|m+0#af5f00255&|a|p| +0#0000000&|<|B|U|F@1|E|R|>| |r|h|s| @58
+@75
+|m+0#af5f00255&|a|p| +0#0000000&|<+0#e000e06&|L|e|a|d|e|r|>|l+0#0000000&|h|s| @5|r|h|s| @50
+|m+0#af5f00255&|a|p| +0#0000000&|<+0#e000e06&|L|o|c|a|l|L|e|a|d|e|r|>|l+0#0000000&|h|s| |r|h|s| @50
+@75
+|m+0#af5f00255&|a|p| +0#0000000&|l|h|s| |<+0#e000e06&|L|e|a|d|e|r|>|r+0#0000000&|h|s| @55
+|m+0#af5f00255&|a|p| +0#0000000&|l|h|s| |<+0#e000e06&|L|o|c|a|l|L|e|a|d|e|r|>|r+0#0000000&|h|s| @50
@75
@57|1|,|1| @10|T|o|p|
diff --git a/runtime/syntax/testdir/dumps/vim_ex_map_01.dump b/runtime/syntax/testdir/dumps/vim_ex_map_01.dump
index 0d9edd4..5129951 100644
--- a/runtime/syntax/testdir/dumps/vim_ex_map_01.dump
+++ b/runtime/syntax/testdir/dumps/vim_ex_map_01.dump
@@ -1,20 +1,20 @@
-|o+0#af5f00255#ffffff0|m|a|p|c|l|e|a|r| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@56
+|m+0#af5f00255#ffffff0|a|p| +0#0000000&|<+0#e000e06&|L|e|a|d|e|r|>|l+0#0000000&|h|s| @5|r|h|s| @50
+|m+0#af5f00255&|a|p| +0#0000000&|<+0#e000e06&|L|o|c|a|l|L|e|a|d|e|r|>|l+0#0000000&|h|s| |r|h|s| @50
+@75
+|m+0#af5f00255&|a|p| +0#0000000&|l|h|s| |<+0#e000e06&|L|e|a|d|e|r|>|r+0#0000000&|h|s| @55
+|m+0#af5f00255&|a|p| +0#0000000&|l|h|s| |<+0#e000e06&|L|o|c|a|l|L|e|a|d|e|r|>|r+0#0000000&|h|s| @50
+> @74
+|m+0#af5f00255&|a|p| +0#0000000&|l|h|s| |<+0#e000e06&|P|l|u|g|>|r+0#0000000&|h|s| @57
+@75
+|m+0#af5f00255&|a|p|c|l|e|a|r| +0#0000000&@1|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@56
+|m+0#af5f00255&|a|p|c|l|e|a|r|!| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@56
+|n+0#af5f00255&|m|a|p|c|l|e|a|r| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@56
+|v+0#af5f00255&|m|a|p|c|l|e|a|r| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@56
+|x+0#af5f00255&|m|a|p|c|l|e|a|r| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@56
+|s+0#af5f00255&|m|a|p|c|l|e|a|r| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@56
+|o+0#af5f00255&|m|a|p|c|l|e|a|r| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@56
|i+0#af5f00255&|m|a|p|c|l|e|a|r| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@56
|l+0#af5f00255&|m|a|p|c|l|e|a|r| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@56
|c+0#af5f00255&|m|a|p|c|l|e|a|r| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@56
|t+0#af5f00255&|m|a|p|c|l|e|a|r| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@56
-> @74
-@75
-|"+0#0000e05&| |:|h|e|l|p| |m|a|p|-|b|a|r| +0#0000000&@59
-@75
-|"+0#0000e05&| |<|B|a|r|>| @4|'|<|'| |i|s| |n|o|t| |i|n| |'|c|p|o|p|t|i|o|n|s|'| +0#0000000&@37
-|m+0#af5f00255&|a|p| +0#0000000&|_|l| |:|!|l|s| |<+0#e000e06&|B|a|r|>| +0#0000000&|m|o|r|e|^|M|:|e|c|h|o| |"|r|h|s|"|<+0#e000e06&|C|R|>| +0#0000000&@35
-|"+0#0000e05&| |\||| @7|'|b|'| |i|s| |n|o|t| |i|n| |'|c|p|o|p|t|i|o|n|s|'| +0#0000000&@37
-|m+0#af5f00255&|a|p| +0#0000000&|_|l| |:|!|l|s| |\||| |m|o|r|e|^|M|:|e|c|h|o| |"|r|h|s|"|<+0#e000e06&|C|R|>| +0#0000000&@38
-|"+0#0000e05&| |^|V||| @6|a|l|w|a|y|s|,| |i|n| |V|i|m| |a|n|d| |V|i| +0#0000000&@41
-|m+0#af5f00255&|a|p| +0#0000000&|_|l| |:|!|l|s| |^+0#0000e05&|V||+0#0000000&| |m|o|r|e|^|M|:|e|c|h|o| |"|r|h|s|"|<+0#e000e06&|C|R|>| +0#0000000&@37
-@75
-|m+0#af5f00255&|a|p| +0#0000000&|l|h|s| |:|s|e|a|r|c|h|(|'|f|o@1|\@1|||b|a|r|'|)|<+0#e000e06&|C|R|>|:+0#0000000&|e|c|h|o| |"|r|h|s|"|<+0#e000e06&|C|R|>| +0#0000000&@27
-@75
-@75
-@57|1|9|,|0|-|1| @7|1|5|%|
+@57|1|9|,|0|-|1| @7|1|3|%|
diff --git a/runtime/syntax/testdir/dumps/vim_ex_map_02.dump b/runtime/syntax/testdir/dumps/vim_ex_map_02.dump
index 58ec003..a05d8a2 100644
--- a/runtime/syntax/testdir/dumps/vim_ex_map_02.dump
+++ b/runtime/syntax/testdir/dumps/vim_ex_map_02.dump
@@ -1,20 +1,20 @@
-| +0&#ffffff0@74
+|t+0#af5f00255#ffffff0|m|a|p|c|l|e|a|r| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&@56
+@75
+@75
+|"+0#0000e05&| |:|h|e|l|p| |m|a|p|-|b|a|r| +0#0000000&@59
+@75
+>"+0#0000e05&| |<|B|a|r|>| @4|'|<|'| |i|s| |n|o|t| |i|n| |'|c|p|o|p|t|i|o|n|s|'| +0#0000000&@37
+|m+0#af5f00255&|a|p| +0#0000000&|_|l| |:|!|l|s| |<+0#e000e06&|B|a|r|>| +0#0000000&|m|o|r|e|^|M|:|e|c|h|o| |"|r|h|s|"|<+0#e000e06&|C|R|>| +0#0000000&@35
+|"+0#0000e05&| |\||| @7|'|b|'| |i|s| |n|o|t| |i|n| |'|c|p|o|p|t|i|o|n|s|'| +0#0000000&@37
+|m+0#af5f00255&|a|p| +0#0000000&|_|l| |:|!|l|s| |\||| |m|o|r|e|^|M|:|e|c|h|o| |"|r|h|s|"|<+0#e000e06&|C|R|>| +0#0000000&@38
+|"+0#0000e05&| |^|V||| @6|a|l|w|a|y|s|,| |i|n| |V|i|m| |a|n|d| |V|i| +0#0000000&@41
+|m+0#af5f00255&|a|p| +0#0000000&|_|l| |:|!|l|s| |^+0#0000e05&|V||+0#0000000&| |m|o|r|e|^|M|:|e|c|h|o| |"|r|h|s|"|<+0#e000e06&|C|R|>| +0#0000000&@37
+@75
+|m+0#af5f00255&|a|p| +0#0000000&|l|h|s| |:|s|e|a|r|c|h|(|'|f|o@1|\@1|||b|a|r|'|)|<+0#e000e06&|C|R|>|:+0#0000000&|e|c|h|o| |"|r|h|s|"|<+0#e000e06&|C|R|>| +0#0000000&@27
+@75
+@75
|"+0#0000e05&| |m|u|l|t|i|l|i|n|e| |R|H|S| +0#0000000&@59
@75
-|m+0#af5f00255&|a|p| +0#0000000&|<+0#e000e06&|l|e|a|d|e|r|>|b+0#0000000&|a|z| @59
-@2|\+0#e000e06&| +0#0000000&|:|e|c|h|o| |(|<+0#e000e06&|b|a|r|>| +0#0000000&@58
-@2>\+0#e000e06&| +0#0000000&@71
-@2|\+0#e000e06&|'+0#0000000&|b|a|r|'|)|<+0#e000e06&|c|r|>| +0#0000000&@61
-@2|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@62
-@75
-|m+0#af5f00255&|a|p| +0#0000000&|l|h|s| @67
-@2|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@62
-@2|\+0#e000e06&| +0#0000000&|e|c|h|o| |"|f|o@1|"| @60
-@75
-|m+0#af5f00255&|a|p| +0#0000000&|l|h|s| @67
-@2|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@62
-@2|\+0#e000e06&| +0#0000000&|e|c|h|o| |"|f|o@1|"| @60
-@75
-|m+0#af5f00255&|a|p| +0#0000000&|l|h|s|^+0#0000e05&|V| +0#0000000&@65
-@2|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@62
-@57|3|7|,|3| @9|3|6|%|
+|m+0#af5f00255&|a|p| +0#0000000&|<+0#e000e06&|L|e|a|d|e|r|>|b+0#0000000&|a|z| @59
+@2|\+0#e000e06&| +0#0000000&|:|e|c|h|o| |(|<+0#e000e06&|B|a|r|>| +0#0000000&@58
+@57|3|7|,|1| @9|3|1|%|
diff --git a/runtime/syntax/testdir/dumps/vim_ex_map_03.dump b/runtime/syntax/testdir/dumps/vim_ex_map_03.dump
index 62966be..d6dbe57 100644
--- a/runtime/syntax/testdir/dumps/vim_ex_map_03.dump
+++ b/runtime/syntax/testdir/dumps/vim_ex_map_03.dump
@@ -1,20 +1,20 @@
-| +0&#ffffff0@1|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@62
-@2|\+0#e000e06&| +0#0000000&|e|c|h|o| |"|f|o@1|"| @60
-@75
-|m+0#af5f00255&|a|p| +0#0000000&|l|^+0#0000e05&|V| +0#0000000&|h|s| @64
+| +0&#ffffff0@1|\+0#e000e06&| +0#0000000&|:|e|c|h|o| |(|<+0#e000e06&|B|a|r|>| +0#0000000&@58
+@2|\+0#e000e06&| +0#0000000&@71
+@2|\+0#e000e06&|'+0#0000000&|b|a|r|'|)|<+0#e000e06&|C|R|>| +0#0000000&@61
@2|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@62
-@2>\+0#e000e06&| +0#0000000&|e|c|h|o| |"|f|o@1|"| @60
@75
-|m+0#af5f00255&|a|p| +0#0000000&|l|^+0#0000e05&|V| +0#0000000&|h|s| @64
+>m+0#af5f00255&|a|p| +0#0000000&|l|h|s| @67
@2|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@62
@2|\+0#e000e06&| +0#0000000&|e|c|h|o| |"|f|o@1|"| @60
@75
-|m+0#af5f00255&|a|p| +0#0000000&|l|h|s| |r|h|s| @63
-|m+0#af5f00255&|a|p| +0#0000000&|l|^+0#0000e05&|V| +0#0000000&|h|^+0#0000e05&|V| +0#0000000&|s|^+0#0000e05&|V| +0#0000000&@1|r|h|s| @54
-@75
|m+0#af5f00255&|a|p| +0#0000000&|l|h|s| @67
-@2|"+0#0000e05&|\| |c|o|m@1|e|n|t| |(|m|a|t|c|h|e|s| |a|s| |R|H|S| |b|u|t| |h|a|r|m|l|e|s@1|)| +0#0000000&@32
-|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|c|l|e|a|r|"| +0#0000000&@62
+@2|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@62
+@2|\+0#e000e06&| +0#0000000&|e|c|h|o| |"|f|o@1|"| @60
@75
+|m+0#af5f00255&|a|p| +0#0000000&|l|h|s|^+0#0000e05&|V| +0#0000000&@65
+@2|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@62
+@2|\+0#e000e06&| +0#0000000&|e|c|h|o| |"|f|o@1|"| @60
@75
-@57|5@1|,|3| @9|5|6|%|
+|m+0#af5f00255&|a|p| +0#0000000&|l|^+0#0000e05&|V| +0#0000000&|h|s| @64
+@2|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@62
+@57|5@1|,|1| @9|4|9|%|
diff --git a/runtime/syntax/testdir/dumps/vim_ex_map_04.dump b/runtime/syntax/testdir/dumps/vim_ex_map_04.dump
index 7f12539..feb06ed 100644
--- a/runtime/syntax/testdir/dumps/vim_ex_map_04.dump
+++ b/runtime/syntax/testdir/dumps/vim_ex_map_04.dump
@@ -1,20 +1,20 @@
-| +0&#ffffff0@74
+| +0&#ffffff0@1|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@62
+@2|\+0#e000e06&| +0#0000000&|e|c|h|o| |"|f|o@1|"| @60
+@75
+|m+0#af5f00255&|a|p| +0#0000000&|l|^+0#0000e05&|V| +0#0000000&|h|s| @64
+@2|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@62
+@2>\+0#e000e06&| +0#0000000&|e|c|h|o| |"|f|o@1|"| @60
+@75
+|m+0#af5f00255&|a|p| +0#0000000&|l|h|s| |r|h|s| @63
+|m+0#af5f00255&|a|p| +0#0000000&|l|^+0#0000e05&|V| +0#0000000&|h|^+0#0000e05&|V| +0#0000000&|s|^+0#0000e05&|V| +0#0000000&@1|r|h|s| @54
+@75
+|m+0#af5f00255&|a|p| +0#0000000&|l|h|s| @67
+@2|"+0#0000e05&|\| |c|o|m@1|e|n|t| |(|m|a|t|c|h|e|s| |a|s| |R|H|S| |b|u|t| |h|a|r|m|l|e|s@1|)| +0#0000000&@32
+|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|c|l|e|a|r|"| +0#0000000&@62
+@75
+@75
|"+0#0000e05&| |D|i|f@1|e|r|e|n|t|i|a|t|e| |m|a|p|(|)| |f|r|o|m| |:|m|a|p| +0#0000000&@43
@75
|m+0#af5f00255&|a|p| +0#0000000&|(| |:|e|c|h|o| |"|o|p|e|n|-|p|a|r|e|n|"|<+0#e000e06&|C|R|>| +0#0000000&@46
@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
-@75
-|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&@60
-@2|m+0#af5f00255&|a|p| +0#0000000&|(| |:|e|c|h|o| |"|o|p|e|n|-|p|a|r|e|n|"|<+0#e000e06&|C|R|>| +0#0000000&@44
-@2|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&@49
-@2|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&@48
-|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@63
-@75
-|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&@65
-@2|m+0#af5f00255&|a|p| +0#0000000&|(| |:|e|c|h|o| |"|o|p|e|n|-|p|a|r|e|n|"|<+0#e000e06&|C|R|>| +0#0000000&@44
-@2|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&@54
-| +0#0000e05&@1|#| |:|m|a|p| |L|H|S|=|(|l|i|s|t|,| |R|H|S|=|'|v|:|v|a|l|'|)| +0#0000000&@42
-@2|m+0#af5f00255&|a|p| +0#0000000&|(|l|i|s|t|,| |'|v|:|v|a|l|'|)| @53
-@57|7|3|,|1| @9|7@1|%|
+@57|7|3|,|3| @9|6|7|%|
diff --git a/runtime/syntax/testdir/dumps/vim_ex_map_05.dump b/runtime/syntax/testdir/dumps/vim_ex_map_05.dump
index 4bb04c0..9f2285e 100644
--- a/runtime/syntax/testdir/dumps/vim_ex_map_05.dump
+++ b/runtime/syntax/testdir/dumps/vim_ex_map_05.dump
@@ -1,20 +1,20 @@
-| +0&#ffffff0@1|m+0#af5f00255&|a|p| +0#0000000&|(|l|i|s|t|,| |'|v|:|v|a|l|'|)| @53
+| +0&#ffffff0@74
+|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
+@75
+|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&@60
+@2>m+0#af5f00255&|a|p| +0#0000000&|(| |:|e|c|h|o| |"|o|p|e|n|-|p|a|r|e|n|"|<+0#e000e06&|C|R|>| +0#0000000&@44
+@2|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&@49
+@2|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&@48
+|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@63
+@75
+|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&@65
+@2|m+0#af5f00255&|a|p| +0#0000000&|(| |:|e|c|h|o| |"|o|p|e|n|-|p|a|r|e|n|"|<+0#e000e06&|C|R|>| +0#0000000&@44
+@2|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&@54
+| +0#0000e05&@1|#| |:|m|a|p| |L|H|S|=|(|l|i|s|t|,| |R|H|S|=|'|v|:|v|a|l|'|)| +0#0000000&@42
+@2|m+0#af5f00255&|a|p| +0#0000000&|(|l|i|s|t|,| |'|v|:|v|a|l|'|)| @53
|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68
@75
@75
|"+0#0000e05&| |I|s@1|u|e| @1|#|1|2|6|7|2| +0#0000000&@59
-> @74
-|n+0#af5f00255&@1|o|r|e|m|a|p| +0#0000000&|<+0#e000e06&|l|e|a|d|e|r|>|f+0#0000000&|o@1| |:|e|c|h|o| |c|a|l@1|(| @42
-@2|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@62
-@2|\+0#e000e06&| +0#0000000&|{|x|-|>|x|}|,| @63
-@2|\+0#e000e06&| +0#0000000&|[|'|f|o@1|'|]|)|<+0#e000e06&|c|r|>| +0#0000000&@58
-@75
-|n+0#af5f00255&@1|o|r|e|m|a|p| +0#0000000&|<+0#e000e06&|l|e|a|d|e|r|>|b+0#0000000&|a|r| |:|e|c|h|o| |(| @46
-@2|\+0#e000e06&| +0#0000000&@71
-@2|\+0#e000e06&| +0#0000000&|'|b|a|r|'|)|<+0#e000e06&|c|r|>| +0#0000000&@60
-@75
-@75
-|"+0#0000e05&| +0#0000000&|E+0#e000e06&|x|a|m|p|l|e|:| +0#0000000&@64
-|"+0#0000e05&| @2|/|a|u|t|o|l|o|a|d|/|n|e|t|r|w|.|v|i|m| +0#0000000&@51
-@75
-@57|9|1|,|0|-|1| @7|9|8|%|
+@57|9|1|,|3| @9|8|5|%|
diff --git a/runtime/syntax/testdir/dumps/vim_ex_map_06.dump b/runtime/syntax/testdir/dumps/vim_ex_map_06.dump
index 35e9022..f047296 100644
--- a/runtime/syntax/testdir/dumps/vim_ex_map_06.dump
+++ b/runtime/syntax/testdir/dumps/vim_ex_map_06.dump
@@ -1,20 +1,20 @@
-| +0&#ffffff0@74
->i+0#af5f00255&|f| +0#0000000&|!+0#af5f00255&|h+0#00e0e07&|a|s|m|a|p|t|o|(+0#e000e06&|'+0#e000002&|<|P|l|u|g|>|N|e|t|r|w|O|p|e|n|F|i|l|e|'|)+0#e000e06&| +0#0000000&@9|||n+0#af5f00255&|m|a|p| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&|<+0#e000e06&|s|i|l|e|n|t|>| +0#0000000&|<+0#e000e06&|n|o|w|a|i
+|"+0#0000e05#ffffff0| |I|s@1|u|e| @1|#|1|2|6|7|2| +0#0000000&@59
+@75
+|n+0#af5f00255&@1|o|r|e|m|a|p| +0#0000000&|<+0#e000e06&|L|e|a|d|e|r|>|f+0#0000000&|o@1| |:|e|c|h|o| |c|a|l@1|(| @42
+@2|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@62
+@2|\+0#e000e06&| +0#0000000&|{|x|-|>|x|}|,| @63
+@2>\+0#e000e06&| +0#0000000&|[|'|f|o@1|'|]|)|<+0#e000e06&|C|R|>| +0#0000000&@58
+@75
+|n+0#af5f00255&@1|o|r|e|m|a|p| +0#0000000&|<+0#e000e06&|L|e|a|d|e|r|>|b+0#0000000&|a|r| |:|e|c|h|o| |(| @46
+@2|\+0#e000e06&| +0#0000000&@71
+@2|\+0#e000e06&| +0#0000000&|'|b|a|r|'|)|<+0#e000e06&|C|R|>| +0#0000000&@60
+@75
+@75
+|"+0#0000e05&| +0#0000000&|E+0#e000e06&|x|a|m|p|l|e|:| +0#0000000&@64
+|"+0#0000e05&| @2|/|a|u|t|o|l|o|a|d|/|n|e|t|r|w|.|v|i|m| +0#0000000&@51
+@75
+|i+0#af5f00255&|f| +0#0000000&|!+0#af5f00255&|h+0#00e0e07&|a|s|m|a|p|t|o|(+0#e000e06&|'+0#e000002&|<|P|l|u|g|>|N|e|t|r|w|O|p|e|n|F|i|l|e|'|)+0#e000e06&| +0#0000000&@9|||n+0#af5f00255&|m|a|p| +0#0000000&|<+0#e000e06&|b|u|f@1|e|r|>| +0#0000000&|<+0#e000e06&|s|i|l|e|n|t|>| +0#0000000&|<+0#e000e06&|n|o|w|a|i
|t|>| +0#0000000&|%| |<+0#e000e06&|P|l|u|g|>|N+0#0000000&|e|t|r|w|O|p|e|n|F|i|l|e|||e+0#af5f00255&|n|d|i|f| +0#0000000&@44
|~+0#4040ff13&| @73
|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
-| +0#0000000&@56|1|0|5|,|1| @8|B|o|t|
+| +0#0000000&@56|1|0|9|,|3| @8|B|o|t|
diff --git a/runtime/syntax/testdir/dumps/vim_ex_set_01.dump b/runtime/syntax/testdir/dumps/vim_ex_set_01.dump
index bb5989d..6c1421a 100644
--- a/runtime/syntax/testdir/dumps/vim_ex_set_01.dump
+++ b/runtime/syntax/testdir/dumps/vim_ex_set_01.dump
@@ -17,4 +17,4 @@
|s+0#af5f00255&|e|t| +0#0000000&|a+0#e000e06&|l|e|p|h|++0#af5f00255&|=|9+0#0000000&|6| @61
|s+0#af5f00255&|e|t| +0#0000000&|a+0#e000e06&|l|e|p|h|^+0#af5f00255&|=|2+0#0000000&| @62
|s+0#af5f00255&|e|t| +0#0000000&|a+0#e000e06&|l|e|p|h|-+0#af5f00255&|=|9+0#0000000&|6| @61
-@57|1|9|,|1| @9|1|5|%|
+@57|1|9|,|1| @9|1|3|%|
diff --git a/runtime/syntax/testdir/dumps/vim_ex_set_02.dump b/runtime/syntax/testdir/dumps/vim_ex_set_02.dump
index 81f282c..0765de0 100644
--- a/runtime/syntax/testdir/dumps/vim_ex_set_02.dump
+++ b/runtime/syntax/testdir/dumps/vim_ex_set_02.dump
@@ -17,4 +17,4 @@
|"+0#0000e05&| |:|h|e|l|p| |o|p|t|i|o|n|-|b|a|c|k|s|l|a|s|h| +0#0000000&@50
@75
|"+0#0000e05&| |W|h|e|n| |s|e|t@1|i|n|g| |o|p|t|i|o|n|s| |u|s|i|n|g| |||:|l|e|t||| |a|n|d| |||l|i|t|e|r|a|l|-|s|t|r|i|n|g|||,| |y|o|u| |n|e@1|d| |t|o| |u|s|@+0#4040ff13&@2
-| +0#0000000&@56|3|7|,|0|-|1| @7|3|7|%|
+| +0#0000000&@56|3|7|,|0|-|1| @7|3|2|%|
diff --git a/runtime/syntax/testdir/dumps/vim_ex_set_03.dump b/runtime/syntax/testdir/dumps/vim_ex_set_03.dump
index 0f3d999..5d2285f 100644
--- a/runtime/syntax/testdir/dumps/vim_ex_set_03.dump
+++ b/runtime/syntax/testdir/dumps/vim_ex_set_03.dump
@@ -17,4 +17,4 @@
|"+0#0000e05&| |T|h|i|s| |e|x|a|m|p|l|e| |s|e|t|s| |t|h|e| |'|t|i|t|l|e|s|t|r|i|n|g|'| |o|p|t|i|o|n| |t|o| |"+0#e000002&|h|i|||t|h|e|r|e|"|:+0#0000e05&| +0#0000000&@15
|s+0#af5f00255&|e|t| +0#0000000&|t+0#e000e06&|i|t|l|e|s|t|r|i|n|g|=+0#af5f00255&|h+0#0000000&|i|\|||t|h|e|r|e| @49
|"+0#0000e05&| |T|h|i|s| |s|e|t|s| |t|h|e| |'|t|i|t|l|e|s|t|r|i|n|g|'| |o|p|t|i|o|n| |t|o| |"+0#e000002&|h|i|"| +0#0000e05&|a|n|d| |'|i|c|o|n|s|t|r|i|n|g|'| |t|o| |"+0#e000002&|t|h|e|r|e|"|:+0#0000e05&| +0#0000000&@1
-@57|5|4|,|1| @9|5|9|%|
+@57|5|4|,|1| @9|5|1|%|
diff --git a/runtime/syntax/testdir/dumps/vim_ex_set_04.dump b/runtime/syntax/testdir/dumps/vim_ex_set_04.dump
index f67789f..e2b6b9d 100644
--- a/runtime/syntax/testdir/dumps/vim_ex_set_04.dump
+++ b/runtime/syntax/testdir/dumps/vim_ex_set_04.dump
@@ -17,4 +17,4 @@
|s+0#af5f00255&|e|t| +0#0000000&|p+0#e000e06&|a|t|h|=+0#af5f00255&|a+0#0000000&|b|c|,+0#e000e06&|d+0#0000000&|e|f|,+0#e000e06&|g+0#0000000&|h|i| @54
@6|"+0#0000e05&|\| |d|e|f| |i|s| |t|h|e| |'|d|e|f|i|n|e|'| |o|p|t|i|o|n| +0#0000000&@39
@6|\+0#e000e06&| +0#0000000&|d+0#e000e06&|e|f|=+0#af5f00255&|a+0#0000000&|b|c|,+0#e000e06&|d+0#0000000&|e|f|,+0#e000e06&|g+0#0000000&|h|i| @51
-@57|7|2|,|1| @9|8|0|%|
+@57|7|2|,|1| @9|7|0|%|
diff --git a/runtime/syntax/testdir/dumps/vim_ex_set_05.dump b/runtime/syntax/testdir/dumps/vim_ex_set_05.dump
index 4a88424..fcc8be4 100644
--- a/runtime/syntax/testdir/dumps/vim_ex_set_05.dump
+++ b/runtime/syntax/testdir/dumps/vim_ex_set_05.dump
@@ -15,6 +15,6 @@
|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#4040ff13&| @73
-|~| @73
-| +0#0000000&@56|9|0|,|0|-|1| @7|B|o|t|
+@75
+|"+0#0000e05&| |U|n|r|e|p|o|r|t|e|d| |i|s@1|u|e| |(|d|o|u|b|l|e| |b|a|c|k|s|l|a|s|h|)| +0#0000000&@37
+@57|9|0|,|0|-|1| @7|8|9|%|
diff --git a/runtime/syntax/testdir/dumps/vim_ex_set_06.dump b/runtime/syntax/testdir/dumps/vim_ex_set_06.dump
new file mode 100644
index 0000000..8807faf
--- /dev/null
+++ b/runtime/syntax/testdir/dumps/vim_ex_set_06.dump
@@ -0,0 +1,20 @@
+|"+0#0000e05#ffffff0| |U|n|r|e|p|o|r|t|e|d| |i|s@1|u|e| |(|d|o|u|b|l|e| |b|a|c|k|s|l|a|s|h|)| +0#0000000&@37
+@75
+|s+0#af5f00255&|e|t|l|o|c|a|l| +0#0000000&|c+0#e000e06&|o|m|=+0#af5f00255&|s+0#0000000&|1|:+0#e000e06&|/+0#0000000&|*|,+0#e000e06&|m+0#0000000&|b|:+0#e000e06&|*+0#0000000&|,+0#e000e06&|e+0#0000000&|x|:+0#e000e06&|*+0#0000000&|/|,+0#e000e06&|b+0#0000000&|:+0#e000e06&|-+0#0000000&@1|,+0#e000e06&|b+0#0000000&|e|:+0#e000e06&|\+0#0000000&@1| @34
+|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@64
+|s+0#af5f00255&|e|t|l|o|c|a|l| +0#0000000&|i+0#e000e06&|n|c|l|u|d|e|=+0#af5f00255&|^+0#0000000&|\@1|s|*|\@1|%|(|s|o|\@1|%|[|u|r|c|e|]|\@2|||r|u|\@1|%|[|n|t|i|m|e|]|\@1|)|[|!|\| |]|\| |*|\@1|z|s|[|^|\@1|||]|*
+>e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@64
+|s+0#af5f00255&|e|t| +0#0000000&|q+0#e000e06&|u|o|t|e@1|s|c|a|p|e|=+0#af5f00255&|\+0#0000000&@1| @56
+|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@64
+|s+0#af5f00255&|e|t| +0#0000000&|q+0#e000e06&|u|o|t|e@1|s|c|a|p|e|=+0#af5f00255&|\+0#0000000&| @57
+|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@64
+@75
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|1|0|8|,|1| @8|B|o|t|
diff --git a/runtime/syntax/testdir/input/vim_ex_map.vim b/runtime/syntax/testdir/input/vim_ex_map.vim
index 3ddc9e9..5d469b2 100644
--- a/runtime/syntax/testdir/input/vim_ex_map.vim
+++ b/runtime/syntax/testdir/input/vim_ex_map.vim
@@ -5,6 +5,20 @@
map
map lhs rhs
+map <buffer><expr><nowait><script><silent><special><unique> lhs rhs
+map <buffer> <expr> <nowait> <script> <silent> <special> <unique> lhs rhs
+
+" :map special arguments are case sensitive, <BUFFER> is the LHS
+map <BUFFER> rhs
+
+map <Leader>lhs rhs
+map <LocalLeader>lhs rhs
+
+map lhs <Leader>rhs
+map lhs <LocalLeader>rhs
+
+map lhs <Plug>rhs
+
mapclear <buffer>
mapclear! <buffer>
nmapclear <buffer>
@@ -32,10 +46,10 @@
" multiline RHS
-map <leader>baz
- \ :echo (<bar>
+map <Leader>baz
+ \ :echo (<Bar>
\
- \'bar')<cr>
+ \'bar')<CR>
"\ comment
map lhs
@@ -89,14 +103,14 @@
" Issue #12672
-nnoremap <leader>foo :echo call(
+nnoremap <Leader>foo :echo call(
"\ comment
\ {x->x},
- \ ['foo'])<cr>
+ \ ['foo'])<CR>
-nnoremap <leader>bar :echo (
+nnoremap <Leader>bar :echo (
\
- \ 'bar')<cr>
+ \ 'bar')<CR>
" Example:
diff --git a/runtime/syntax/testdir/input/vim_ex_set.vim b/runtime/syntax/testdir/input/vim_ex_set.vim
index 5bdf216..0b1d010 100644
--- a/runtime/syntax/testdir/input/vim_ex_set.vim
+++ b/runtime/syntax/testdir/input/vim_ex_set.vim
@@ -99,3 +99,15 @@
CompilerSet errorformat=\ %#[%.%#]\ %#%f:%l:%v:%*\\d:%*\\d:\ %t%[%^:]%#:%m,
\%A\ %#[%.%#]\ %f:%l:\ %m,%-Z\ %#[%.%#]\ %p^,%C\ %#[%.%#]\ %#%m
+
+" Unreported issue (double backslash)
+
+setlocal com=s1:/*,mb:*,ex:*/,b:--,be:\\
+echo "Foo"
+setlocal include=^\\s*\\%(so\\%[urce]\\\|ru\\%[ntime]\\)[!\ ]\ *\\zs[^\\|]*
+echo "Foo"
+set quoteescape=\\
+echo "Foo"
+set quoteescape=\
+echo "Foo"
+
diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
index e83c9b2..ac295e0 100644
--- a/runtime/syntax/vim.vim
+++ b/runtime/syntax/vim.vim
@@ -756,9 +756,9 @@
syn match vimCmplxRepeat '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\>\)'
" Set command and associated set-options (vimOptions) with comment {{{2
-syn match vimSet "\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skipwhite nextgroup=vimSetBang,vimSetRegion
-syn region vimSetRegion contained start="\S" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*["#]\\ + matchgroup=vimCmdSep end="|" end="$" matchgroup=vimNotation end="<[cC][rR]>" keepend contains=@vimComment,@vimContinue,vimErrSetting,vimOption,vimSetAll,vimSetTermcap
-syn region vimSetEqual contained matchgroup=vimOper start="[=:]\|[-+^]=" skip=+\\\\\|\\|\|\\\s\|\n\s*\\\|\n\s*["#]\\ \|^\s*\\\|^\s*["#]\\ + matchgroup=vimCmdSep end="|" end="\ze\s" end="$" contains=@vimContinue,vimCtrlChar,vimEnvvar,vimNotation,vimSetSep
+syn match vimSet "\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skipwhite nextgroup=vimSetBang,vimSetArgs
+syn region vimSetArgs contained start="\S" skip=+\\|\|\n\s*\\\|\n\s*["#]\\ + matchgroup=vimCmdSep end="|" end="$" matchgroup=vimNotation end="<[cC][rR]>" keepend contains=@vimComment,@vimContinue,vimErrSetting,vimOption,vimSetAll,vimSetTermcap
+syn region vimSetEqual contained matchgroup=vimOper start="[=:]\|[-+^]=" skip=+\\|\|\\\s\|\n\s*\\\|\n\s*["#]\\ \|^\s*\\\|^\s*["#]\\ + matchgroup=vimCmdSep end="|" end="\ze\s" end="$" contains=@vimContinue,vimCtrlChar,vimEnvvar,vimNotation,vimSetSep
syn match vimSetBang contained "\a\@1<=!" skipwhite nextgroup=vimSetAll,vimSetTermcap
syn keyword vimSetAll contained all nextgroup=vimSetMod
syn keyword vimSetTermcap contained termcap
@@ -880,15 +880,17 @@
syn keyword vimUnmap cu[nmap] iu[nmap] lu[nmap] nun[map] ou[nmap] sunm[ap] tunma[p] vu[nmap] xu[nmap] skipwhite nextgroup=vimMapMod,vimMapLhs
syn keyword vimUnmap unm[ap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
-syn match vimMapLhs contained "\%(.\|\S\)\+" contains=vimCtrlChar,vimNotation skipwhite nextgroup=vimMapRhs
-syn match vimMapLhs contained "\%(.\|\S\)\+\ze\s*$" contains=vimCtrlChar,vimNotation skipwhite skipnl nextgroup=vimMapRhsContinue
+syn match vimMapLhs contained "\%(.\|\S\)\+" contains=vimCtrlChar,vimNotation,vimMapLeader skipwhite nextgroup=vimMapRhs
+syn match vimMapLhs contained "\%(.\|\S\)\+\ze\s*$" contains=vimCtrlChar,vimNotation,vimMapLeader skipwhite skipnl nextgroup=vimMapRhsContinue
syn match vimMapBang contained "\a\@1<=!" skipwhite nextgroup=vimMapMod,vimMapLhs
-syn match vimMapMod contained "\%#=1\c<\(buffer\|expr\|\(local\)\=leader\|nowait\|plug\|script\|sid\|unique\|silent\)\+>" contains=vimMapModKey,vimMapModErr skipwhite nextgroup=vimMapMod,vimMapLhs
-syn region vimMapRhs contained start="\S" skip=+\\|\|\@1<=|\|\n\s*\\\|\n\s*"\\ + end="|" end="$" contains=@vimContinue,vimCtrlChar,vimNotation skipnl nextgroup=vimMapRhsContinue
+syn match vimMapMod contained "\%#=1<\%(buffer\|expr\|nowait\|script\|silent\|special\|unique\)\+>" contains=vimMapModKey,vimMapModErr skipwhite nextgroup=vimMapMod,vimMapLhs
+syn region vimMapRhs contained start="\S" skip=+\\|\|\@1<=|\|\n\s*\\\|\n\s*"\\ + end="|" end="$" contains=@vimContinue,vimCtrlChar,vimNotation,vimMapLeader skipnl nextgroup=vimMapRhsContinue
" assume a continuation comment introduces the RHS
-syn region vimMapRhsContinue contained start=+^\s*\%(\\\|"\\ \)+ skip=+\\|\|\@1<=|\|\n\s*\\\|\n\s*"\\ + end="|" end="$" contains=@vimContinue,vimCtrlChar,vimNotation
+syn region vimMapRhsContinue contained start=+^\s*\%(\\\|"\\ \)+ skip=+\\|\|\@1<=|\|\n\s*\\\|\n\s*"\\ + end="|" end="$" contains=@vimContinue,vimCtrlChar,vimNotation,vimMapLeader
+syn match vimMapLeader contained "\%#=1\c<\%(local\)\=leader>" contains=vimMapLeaderKey
+syn keyword vimMapModKey contained buffer expr nowait script silent special unique
syn case ignore
-syn keyword vimMapModKey contained buffer expr leader localleader nowait plug script sid silent unique
+syn keyword vimMapLeaderKey contained leader localleader
syn case match
" Menus: {{{2
@@ -954,7 +956,7 @@
" Vim user commands
" Compiler plugins
-syn match vimCompilerSet "\<CompilerSet\>" skipwhite nextgroup=vimSetRegion
+syn match vimCompilerSet "\<CompilerSet\>" skipwhite nextgroup=vimSetArgs
" runtime/makemenu.vim
syn match vimSynMenu "\<SynMenu\>" skipwhite nextgroup=vimSynMenuPath
@@ -1533,6 +1535,8 @@
hi def link vimLetRegister Special
hi def link vimLineComment vimComment
hi def link vimMapBang vimBang
+ hi def link vimMapLeader vimBracket
+ hi def link vimMapLeaderKey vimNotation
hi def link vimMapModKey vimFuncSID
hi def link vimMapMod vimBracket
hi def link vimMap vimCommand