runtime(vim): Improve keymap file highlighting (#13550)

- Match :loadkeymap to EOF as a region and contain only allowed items.
- Add highlighting for <Char- notation.
- add basic syntax highlighting tests

Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/runtime/syntax/testdir/dumps/vim_00.dump b/runtime/syntax/testdir/dumps/vim_00.dump
new file mode 100644
index 0000000..edb6a6f
--- /dev/null
+++ b/runtime/syntax/testdir/dumps/vim_00.dump
@@ -0,0 +1,20 @@
+>"+0#0000e05#ffffff0| |V|i|m| |K|e|y|m|a|p| |f|i|l|e| |f|o|r| |s|y|n|t|a|x| |t|e|s|t|i|n|g| @38
+@75
+@75
+@46| +0#0000000&@28
+@75
+@75
+|"+0#0000e05&| +0#0000000&|M+0#e000e06&|a|i|n|t|a|i|n|e|r|:| +0#0000e05&@2|D|o|u|g| |K|e|a|r|n|s| |<|d|o|u|g|k|e|a|r|n|s|@|g|m|a|i|l|.|c|o|m|>| @24
+@60| +0#0000000&@14
+|"+0#0000e05&| +0#0000000&|L+0#e000e06&|a|s|t| |C|h|a|n|g|e|d|:| +0#0000e05&|2|0|2|3| |N|o|v| |2|1| @47
+@75
+@75
+@46| +0#0000000&@28
+@75
+@75
+@75
+@75
+|s+0#af5f00255&|c|r|i|p|t|e|n|c|o|d|i|n|g| +0#0000000&|u|t|f|-+0#af5f00255&|8+0#e000002&| +0#0000000&@54
+@75
+|@+0#4040ff13&@2| @71
+|"+0#0000000&|i|n|p|u|t|/|v|i|m|.|v|i|m|"| |2|6|L|,| |3|9@1|2|B| @30|1|,|1| @10|T|o|p| 
diff --git a/runtime/syntax/testdir/dumps/vim_01.dump b/runtime/syntax/testdir/dumps/vim_01.dump
new file mode 100644
index 0000000..9a7a833
--- /dev/null
+++ b/runtime/syntax/testdir/dumps/vim_01.dump
@@ -0,0 +1,20 @@
+| +0&#ffffff0@74
+@75
+|a| |A| @3|B+0#0000e05&|a|s|i|c| |m|a|p@1|i|n|g| @38| +0#0000000&@15
+|'|a| |á| @2|M+0#0000e05&|o|r|e| |t|h|a|n| |o|n|e| |c|h|a|r| |i|n| |f|i|r|s|t| |c|o|l|u|m|n| @10| +0#0000000&@22
+@75
+>"+0#0000e05&| |S|p|e|c|i|a|l| |n|o|t|a|t|i|o|n| @56
+@60| +0#0000000&@14
+|<+0#e000e06&|c|h|a|r|-|6|2|>| +0#0000000&@5|B| @14|S+0#0000e05&|p|e|c|i|a|l| |n|o|t|a|t|i|o|n| |a|l@1|o|w|e|d| |i|n| |L|H|S| |-| |d|e|c|i|m|a|l| @2
+@75
+@75
+@46| +0#0000000&@28
+|c| @13|<+0#e000e06&|c|h|a|r|-|0|1|0|3|>| +0#0000000&@4|S+0#0000e05&|p|e|c|i|a|l| |n|o|t|a|t|i|o|n| |a|l@1|o|w|e|d| |i|n| |R|H|S| |-| |o|c|t|a|l| @4
+@60| +0#0000000&@14
+|<+0#e000e06&|c|h|a|r|-|0|x|0@1|6|4|>| +0#0000000&@1|<+0#e000e06&|c|h|a|r|-|0|x|0@1|4@1|>| +0#0000000&@2|S+0#0000e05&|p|e|c|i|a|l| |n|o|t|a|t|i|o|n| |a|l@1|o|w|e|d| |i|n| |L|H|S| |a|n|d| |R|H|S| |-| |h|e
+|x|a|d|e|c|i|m|a|l| @50| +0#0000000&@14
+@75
+|"+0#0000e05&| |V|i|m|-|s|c|r|i|p|t| |c|o|m@1|e|n|t| |c|h|a|r|a|c|t|e|r|s| @30| +0#0000000&@12
+|#| |<+0#e000e06&|c|h|a|r|-|0|x|0@1|a|3|>| +0#0000000&@15|L+0#0000e05&|i|n|e| |s|h|o|u|l|d| |n|o|t| |m|a|t|c|h| |a|s| |a| |V|i|m|9|-|s|c|r|i|p|t| |c|o|m@1|e
+|n|t| +0#0000000&@72
+@57|1|9|,|1| @9|9|3|%| 
diff --git a/runtime/syntax/testdir/dumps/vim_99.dump b/runtime/syntax/testdir/dumps/vim_99.dump
new file mode 100644
index 0000000..ad6b5a5
--- /dev/null
+++ b/runtime/syntax/testdir/dumps/vim_99.dump
@@ -0,0 +1,20 @@
+|a+0&#ffffff0| |A| @3|B+0#0000e05&|a|s|i|c| |m|a|p@1|i|n|g| @38| +0#0000000&@15
+|'|a| |á| @2|M+0#0000e05&|o|r|e| |t|h|a|n| |o|n|e| |c|h|a|r| |i|n| |f|i|r|s|t| |c|o|l|u|m|n| @10| +0#0000000&@22
+@75
+|"+0#0000e05&| |S|p|e|c|i|a|l| |n|o|t|a|t|i|o|n| @56
+@60| +0#0000000&@14
+|<+0#e000e06&|c|h|a|r|-|6|2|>| +0#0000000&@5|B| @14|S+0#0000e05&|p|e|c|i|a|l| |n|o|t|a|t|i|o|n| |a|l@1|o|w|e|d| |i|n| |L|H|S| |-| |d|e|c|i|m|a|l| @2
+@75
+@75
+@46| +0#0000000&@28
+|c| @13|<+0#e000e06&|c|h|a|r|-|0|1|0|3|>| +0#0000000&@4|S+0#0000e05&|p|e|c|i|a|l| |n|o|t|a|t|i|o|n| |a|l@1|o|w|e|d| |i|n| |R|H|S| |-| |o|c|t|a|l| @4
+@60| +0#0000000&@14
+|<+0#e000e06&|c|h|a|r|-|0|x|0@1|6|4|>| +0#0000000&@1|<+0#e000e06&|c|h|a|r|-|0|x|0@1|4@1|>| +0#0000000&@2|S+0#0000e05&|p|e|c|i|a|l| |n|o|t|a|t|i|o|n| |a|l@1|o|w|e|d| |i|n| |L|H|S| |a|n|d| |R|H|S| |-| |h|e
+|x|a|d|e|c|i|m|a|l| @50| +0#0000000&@14
+@75
+|"+0#0000e05&| |V|i|m|-|s|c|r|i|p|t| |c|o|m@1|e|n|t| |c|h|a|r|a|c|t|e|r|s| @30| +0#0000000&@12
+|#| |<+0#e000e06&|c|h|a|r|-|0|x|0@1|a|3|>| +0#0000000&@15|L+0#0000e05&|i|n|e| |s|h|o|u|l|d| |n|o|t| |m|a|t|c|h| |a|s| |a| |V|i|m|9|-|s|c|r|i|p|t| |c|o|m@1|e
+|n|t| +0#0000000&@72
+>\|"| |“| @18|L+0#0000e05&|i|n|e| |s|h|o|u|l|d| |n|o|t| |m|a|t|c|h| |a|s| |a| |l|e|g|a|c|y|-|s|c|r|i|p|t| |c|o|m@1|e|n|t| | +0#0000000&@2
+|~+0#4040ff13&| @73
+| +0#0000000&@56|2|6|,|1| @9|B|o|t| 
diff --git a/runtime/syntax/testdir/input/vim.vim b/runtime/syntax/testdir/input/vim.vim
new file mode 100644
index 0000000..983c822
--- /dev/null
+++ b/runtime/syntax/testdir/input/vim.vim
@@ -0,0 +1,26 @@
+" Vim Keymap file for syntax testing                                                                                                                                                                                                                                           
+                                                                                                                                       
+" Maintainer:   Doug Kearns <dougkearns@gmail.com>                                                                                     
+" Last Changed: 2023 Nov 21                                                                                                                                                                                                                                                    
+                                                                                                                                                                                                                                                                               
+scriptencoding utf-8                                                                                                                                                                                                                                                           
+                                                                                                                                       
+let b:keymap_name = "syntax-test"                                                                                                      
+                                                                                                                                                                                                                                                                               
+loadkeymap                                                                                                                                                                                                                                                                     
+                                                                                                                                                                                                                                                                               
+" Line comment                                                                                                                         
+                                                                                                                                       
+  " Another line comment                
+                                                                                                                                       
+a A    Basic mapping                                       
+'a á   More than one char in first column           
+                                          
+" Special notation                                                                                                                     
+<char-62>      B               Special notation allowed in LHS - decimal                                                                                                                                                                                                       
+c              <char-0103>     Special notation allowed in RHS - octal                                                                 
+<char-0x0064>  <char-0x0044>   Special notation allowed in LHS and RHS - hexadecimal                                                   
+                                         
+" Vim-script comment characters                               
+# <char-0x00a3>                Line should not match as a Vim9-script comment
+\" “                   Line should not match as a legacy-script comment