summaryrefslogtreecommitdiff
path: root/uvim/runtime/syntax/mnv.mnv
blob: 2ec7731814b630071e589cfca4b7789aa5e4cb04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
" MNV syntax file
" Language:	   MNV script
" Maintainer:	   Hirohito Higashi <h.east.727 ATMARK gmail.com>
"	   Doug Kearns <dougkearns@gmail.com>
" Last Change:	   2026 Mar 13
" Former Maintainer: Charles E. Campbell

" DO NOT CHANGE DIRECTLY.
" THIS FILE PARTLY GENERATED BY gen_syntax_mnv.mnv.
" (Search string "GEN_SYN_MNV:" in this file)

" Quit when a syntax file was already loaded {{{1
if exists("b:current_syntax")
  finish
endif
let s:keepcpo= &cpo
set cpo&mnv

" Feature testing {{{1

" NOTE: mnvsyn_force_mnv9 for internal use only
let s:mnv9script = get(b:, "mnvsyn_force_mnv9", v:false) || "\n" .. getline(1, 32)->join("\n") =~# '\n\s*mnv9\%[script]\>'

function s:has(feature)
  return has(a:feature) || index(get(g:, "mnvsyn_mnv_features", []), a:feature) != -1
endfunction

" Automatically generated keyword lists: {{{1

" mnvTodo: contains common special-notices for comments {{{2
" Use the mnvCommentGroup cluster to add your own.
syn keyword mnvTodo contained	COMBAK	FIXME	TODO	XXX
syn cluster mnvCommentGroup	contains=mnvTodo,@Spell

" regular mnv commands {{{2
" GEN_SYN_MNV: mnvCommand normal, START_STR='syn keyword mnvCommand contained', END_STR='nextgroup=mnvBang'
syn keyword mnvCommand contained al[l] ar[gs] arga[dd] argd[elete] argded[upe] arge[dit] argg[lobal] argl[ocal] argu[ment] as[cii] b[uffer] bN[ext] ba[ll] bad[d] balt bd[elete] bf[irst] bl[ast] bm[odified] bn[ext] bp[revious] br[ewind] brea[k] buffers bun[load] bw[ipeout] cN[ext] cNf[ile] cabo[ve] cad[dbuffer] cadde[xpr] caddf[ile] caf[ter] cb[uffer] cbe[fore] cbel[ow] cbo[ttom] cc ccl[ose] ce[nter] cex[pr] cf[ile] cfir[st] cg[etfile] cgetb[uffer] cgete[xpr] changes che[ckpath] checkt[ime] chi[story] cl[ist] clip[reset] cla[st] clo[se] cle[arjumps] cn[ext] cnew[er] cnf[ile] col[der] colo[rscheme] comc[lear] comp[iler] con[tinue] cope[n] cp[revious] cpf[ile] cq[uit] cr[ewind] cs[cope] cst[ag] cw[indow] delm[arks] defc[ompile] di[splay] dif[fupdate] diffg[et] diffo[ff] nextgroup=mnvBang
syn keyword mnvCommand contained diffp[atch] diffpu[t] diffs[plit] difft[his] dig[raphs] disa[ssemble] dj[ump] dli[st] dr[op] ds[earch] dsp[lit] e[dit] ea[rlier] em[enu] endfo[r] endt[ry] endw[hile] ene[w] ex exi[t] exu[sage] f[ile] files fin[d] fina[lly] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] foldo[pen] g[lobal] go[to] gu[i] gv[im] helpc[lose] helpf[ind] helpt[ags] ha[rdcopy] ij[ump] il[ist] int[ro] ip[ut] is[earch] isp[lit] ju[mps] l[ist] lN[ext] lNf[ile] la[st] lab[ove] lad[dexpr] laddb[uffer] laddf[ile] laf[ter] lat[er] lb[uffer] lbe[fore] lbel[ow] lbo[ttom] lcl[ose] lcs[cope] le[ft] lex[pr] lf[ile] lfir[st] lg[etfile] lgetb[uffer] lgete[xpr] lhi[story] ll lla[st] lli[st] lmak[e] lne[xt] lnew[er] lnf[ile] lo[adview] lockv[ar] lol[der] lop[en] lp[revious] nextgroup=mnvBang
syn keyword mnvCommand contained lpf[ile] lr[ewind] lt[ag] lw[indow] ls m[ove] marks mes[sages] mk[exrc] mks[ession] mksp[ell] mkv[imrc] mkvie[w] mod[e] n[ext] nb[key] nbc[lose] nbs[tart] noh[lsearch] nu[mber] o[pen] ol[dfiles] on[ly] opt[ions] ow[nsyntax] p[rint] pa[ckadd] packl[oadall] pb[uffer] pc[lose] ped[it] po[p] pp[op] pre[serve] prev[ious] ps[earch] pt[ag] ptN[ext] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] q[uit] quita[ll] qa[ll] r[ead] rec[over] red[o] redr[aw] redraws[tatus] redrawt[abline] redrawtabp[anel] reg[isters] res[ize] ret[ab] rew[ind] ri[ght] ru[ntime] rund[o] rv[iminfo] sN[ext] sa[rgument] sal[l] sav[eas] sb[uffer] sbN[ext] sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbp[revious] sbr[ewind] scr[iptnames] nextgroup=mnvBang
syn keyword mnvCommand contained scripte[ncoding] scriptv[ersion] scs[cope] setf[iletype] sf[ind] sfir[st] sh[ell] sim[alt] sig[n] sla[st] sn[ext] so[urce] spe[llgood] spelld[ump] spelli[nfo] spellr[epall] spellra[re] spellu[ndo] spellw[rong] spr[evious] sre[wind] st[op] sta[g] star[tinsert] startg[replace] startr[eplace] stopi[nsert] stj[ump] sts[elect] sun[hide] sus[pend] sv[iew] sync[bind] smi[le] t tN[ext] ta[g] tags tabc[lose] tabe[dit] tabf[ind] tabfir[st] tabm[ove] tabl[ast] tabn[ext] tabnew tabo[nly] tabp[revious] tabN[ext] tabr[ewind] tabs te[aroff] tf[irst] tj[ump] tl[ast] tn[ext] tp[revious] tr[ewind] try ts[elect] u[ndo] undoj[oin] undol[ist] unh[ide] up[date] v[global] ve[rsion] vi[sual] vie[w] viu[sage] vne[w] vs[plit] w[rite] wN[ext] wa[ll] wi[nsize] nextgroup=mnvBang
syn keyword mnvCommand contained winp[os] wl[restore] wn[ext] wp[revious] wq wqa[ll] wu[ndo] wv[iminfo] x[it] xa[ll] xr[estore] y[ank] z dl dell delel deletl deletel dp dep delp delep deletp deletep a i nextgroup=mnvBang

" Lower priority :syn-match to allow for :command/function() distinction
" :chdir is handled specially elsewhere
syn match mnvCommand "\<co\%[py]\>"     nextgroup=mnvBang
syn match mnvCommand "\<d\%[elete]\>"   nextgroup=mnvBang
syn match mnvCommand "\<j\%[oin]\>"     nextgroup=mnvBang
syn match mnvCommand "\<sp\%[lit]\>"    nextgroup=mnvBang
syn match mnvCommand "\<sw\%[apname]\>" nextgroup=mnvBang

" GEN_SYN_MNV: mnvCommand modifier, START_STR='syn keyword mnvCommandModifier', END_STR='skipwhite nextgroup=mnvCommandModifierBang,@mnvCmdList'
syn keyword mnvCommandModifier abo[veleft] bel[owright] bo[tright] hid[e] hor[izontal] kee[pmarks] keepj[umps] keepp[atterns] keepa[lt] lefta[bove] leg[acy] loc[kmarks] noa[utocmd] nos[wapfile] rightb[elow] san[dbox] sil[ent] tab to[pleft] uns[ilent] verb[ose] vert[ical] mnv9[cmd] skipwhite nextgroup=mnvCommandModifierBang,@mnvCmdList
" :filter is handled specially elsewhere
syn match	mnvCommandModifierBang	contained	"\a\@1<=!"	skipwhite nextgroup=@mnvCmdList

" Lower priority :syn-match to allow for :command/function() distinction
syn match mnvCommand "\<bro\%[wse]\>"  skipwhite nextgroup=mnvCommandModifierBang,@mnvCmdList
syn match mnvCommand "\<conf\%[irm]\>" skipwhite nextgroup=mnvCommandModifierBang,@mnvCmdList

" Lower priority for _new_ to distinguish constructors from the command.
syn match   mnvCommand contained	"\<new\>(\@!"
syn match   mnvCommand contained	"\<z[-+^.=]\=\>"
syn keyword mnvStdPlugin contained	Arguments Asm Break Cfilter Clear Continue DiffOrig Evaluate Finish Gdb Lfilter Man Over Program Run S Source Step Stop Termdebug TermdebugCommand TOhtml Until Winbar XMLent XMLns

" mnvOptions are caught only when contained in a mnvSet {{{2
" GEN_SYN_MNV: mnvOption normal, START_STR='syn keyword mnvOption contained', END_STR='skipwhite nextgroup=mnvSetEqual,mnvSetMod'
syn keyword mnvOption contained al aleph ari allowrevins ambw ambiwidth arab arabic arshape arabicshape acd autochdir ac autocomplete acl autocompletedelay act autocompletetimeout ai autoindent ar autoread asd autoshelldir aw autowrite awa autowriteall bg background bs backspace bk backup bkc backupcopy bdir backupdir bex backupext bsk backupskip bdlay balloondelay beval ballooneval bevalterm balloonevalterm bexpr balloonexpr bo belloff bin binary bomb brk breakat bri breakindent briopt breakindentopt bsdir browsedir bh bufhidden bl buflisted bt buftype cmp casemap cdh cdhome cd cdpath cedit ccv charconvert chi chistory cin cindent cink cinkeys cino cinoptions cinsd cinscopedecls cinw cinwords cb clipboard cpm clipmethod ch cmdheight cwh cmdwinheight cc colorcolumn skipwhite nextgroup=mnvSetEqual,mnvSetMod
syn keyword mnvOption contained co columns com comments cms commentstring cp compatible cpt complete cfu completefunc cia completeitemalign cot completeopt cpp completepopup csl completeslash cto completetimeout cocu concealcursor cole conceallevel cf confirm ci copyindent cpo cpoptions cm cryptmethod cspc cscopepathcomp csprg cscopeprg csqf cscopequickfix csre cscoperelative cst cscopetag csto cscopetagorder csverb cscopeverbose crb cursorbind cuc cursorcolumn cul cursorline culopt cursorlineopt debug def define deco delcombine dict dictionary diff dia diffanchors dex diffexpr dip diffopt dg digraph dir directory dy display ead eadirection ed edcompatible emo emoji enc encoding eof endoffile eol endofline ea equalalways ep equalprg eb errorbells ef errorfile skipwhite nextgroup=mnvSetEqual,mnvSetMod
syn keyword mnvOption contained efm errorformat ek esckeys ei eventignore eiw eventignorewin et expandtab ex exrc fenc fileencoding fencs fileencodings ff fileformat ffs fileformats fic fileignorecase ft filetype fcs fillchars ffu findfunc fixeol fixendofline fcl foldclose fdc foldcolumn fen foldenable fde foldexpr fdi foldignore fdl foldlevel fdls foldlevelstart fmr foldmarker fdm foldmethod fml foldminlines fdn foldnestmax fdo foldopen fdt foldtext fex formatexpr flp formatlistpat fo formatoptions fp formatprg fs fsync gd gdefault gfm grepformat gp grepprg gcr guicursor gfn guifont gfs guifontset gfw guifontwide ghr guiheadroom gli guiligatures go guioptions guipty gtl guitablabel gtt guitabtooltip hf helpfile hh helpheight hlg helplang hid hidden hl highlight skipwhite nextgroup=mnvSetEqual,mnvSetMod
syn keyword mnvOption contained hi history hk hkmap hkp hkmapp hls hlsearch icon iconstring ic ignorecase imaf imactivatefunc imak imactivatekey imc imcmdline imd imdisable imi iminsert ims imsearch imsf imstatusfunc imst imstyle inc include inex includeexpr is incsearch inde indentexpr indk indentkeys inf infercase im insertmode isf isfname isi isident isk iskeyword isp isprint js joinspaces jop jumpoptions key kmp keymap km keymodel kpc keyprotocol kp keywordprg lmap langmap lm langmenu lnr langnoremap lrm langremap ls laststatus lz lazyredraw lhi lhistory lbr linebreak lines lsp linespace lisp lop lispoptions lw lispwords list lcs listchars lpl loadplugins luadll magic mef makeef menc makeencoding mp makeprg mps matchpairs mat matchtime mco maxcombine mfd maxfuncdepth skipwhite nextgroup=mnvSetEqual,mnvSetMod
syn keyword mnvOption contained mmd maxmapdepth mm maxmem mmp maxmempattern mmt maxmemtot msc maxsearchcount mis menuitems mopt messagesopt msm mkspellmem ml modeline mle modelineexpr mls modelines ma modifiable mod modified more mouse mousef mousefocus mh mousehide mousem mousemodel mousemev mousemoveevent mouses mouseshape mouset mousetime mzq mzquantum mzschemedll mzschemegcdll nf nrformats nu number nuw numberwidth ofu omnifunc odev opendevice opfunc operatorfunc ost osctimeoutlen pp packpath para paragraphs paste pt pastetoggle pex patchexpr pm patchmode pa path perldll pi preserveindent pvh previewheight pvp previewpopup pvw previewwindow pdev printdevice penc printencoding pexpr printexpr pfn printfont pheader printheader pmbcs printmbcharset pmbfn printmbfont skipwhite nextgroup=mnvSetEqual,mnvSetMod
syn keyword mnvOption contained popt printoptions prompt pb pumborder ph pumheight pmw pummaxwidth pw pumwidth pythondll pythonhome pythonthreedll pythonthreehome pyx pyxversion qftf quickfixtextfunc qe quoteescape ro readonly rdt redrawtime re regexpengine rnu relativenumber remap rop renderoptions report rs restorescreen ri revins rl rightleft rlc rightleftcmd rubydll ru ruler ruf rulerformat rtp runtimepath scr scroll scb scrollbind scf scrollfocus sj scrolljump so scrolloff sbo scrollopt sect sections secure sel selection slm selectmode ssop sessionoptions sh shell shcf shellcmdflag sp shellpipe shq shellquote srr shellredir ssl shellslash stmp shelltemp st shelltype sxe shellxescape sxq shellxquote sr shiftround sw shiftwidth shm shortmess sn shortname sbr showbreak skipwhite nextgroup=mnvSetEqual,mnvSetMod
syn keyword mnvOption contained sc showcmd sloc showcmdloc sft showfulltag sm showmatch smd showmode stal showtabline stpl showtabpanel ss sidescroll siso sidescrolloff scl signcolumn scs smartcase si smartindent sta smarttab sms smoothscroll sts softtabstop spell spc spellcapcheck spf spellfile spl spelllang spo spelloptions sps spellsuggest sb splitbelow spk splitkeep spr splitright sol startofline stl statusline stlo statuslineopt su suffixes sua suffixesadd swf swapfile sws swapsync swb switchbuf smc synmaxcol syn syntax tcl tabclose tal tabline tpm tabpagemax tpl tabpanel tplo tabpanelopt ts tabstop tbs tagbsearch tc tagcase tfu tagfunc tl taglength tr tagrelative tag tags tgst tagstack tcldll term tbidi termbidi tenc termencoding tgc termguicolors trz termresize skipwhite nextgroup=mnvSetEqual,mnvSetMod
syn keyword mnvOption contained tsy termsync twk termwinkey twsl termwinscroll tws termwinsize twt termwintype terse ta textauto tx textmode tw textwidth tsr thesaurus tsrfu thesaurusfunc top tildeop to timeout tm timeoutlen title titlelen titleold titlestring tb toolbar tbis toolbariconsize ttimeout ttm ttimeoutlen tbi ttybuiltin tf ttyfast ttym ttymouse tsl ttyscroll tty ttytype udir undodir udf undofile ul undolevels ur undoreload uc updatecount ut updatetime vsts varsofttabstop vts vartabstop vbs verbose vfile verbosefile vdir viewdir vop viewoptions vi mnvinfo vif mnvinfofile ve virtualedit vb visualbell warn wiv weirdinvert ww whichwrap wc wildchar wcm wildcharm wig wildignore wic wildignorecase wmnu wildmenu wim wildmode wop wildoptions wak winaltkeys wcr wincolor skipwhite nextgroup=mnvSetEqual,mnvSetMod
syn keyword mnvOption contained wi window wfb winfixbuf wfh winfixheight wfw winfixwidth wh winheight whl winhighlight wmh winminheight wmw winminwidth winptydll wiw winwidth wse wlseat wst wlsteal wtm wltimeoutlen wrap wm wrapmargin ws wrapscan write wa writeany wb writebackup wd writedelay xtermcodes skipwhite nextgroup=mnvSetEqual,mnvSetMod

" mnvOptions: These are the turn-off setting variants {{{2
" GEN_SYN_MNV: mnvOption turn-off, START_STR='syn keyword mnvOption contained', END_STR=''
syn keyword mnvOption contained noari noallowrevins noarab noarabic noarshape noarabicshape noacd noautochdir noac noautocomplete noai noautoindent noar noautoread noasd noautoshelldir noaw noautowrite noawa noautowriteall nobk nobackup nobeval noballooneval nobevalterm noballoonevalterm nobin nobinary nobomb nobri nobreakindent nobl nobuflisted nocdh nocdhome nocin nocindent nocp nocompatible nocf noconfirm noci nocopyindent nocsre nocscoperelative nocst nocscopetag nocsverb nocscopeverbose nocrb nocursorbind nocuc nocursorcolumn nocul nocursorline nodeco nodelcombine nodiff nodg nodigraph noed noedcompatible noemo noemoji noeof noendoffile noeol noendofline noea noequalalways noeb noerrorbells noek noesckeys noet noexpandtab noex noexrc nofic nofileignorecase
syn keyword mnvOption contained nofixeol nofixendofline nofen nofoldenable nofs nofsync nogd nogdefault noguipty nohid nohidden nohk nohkmap nohkp nohkmapp nohls nohlsearch noicon noic noignorecase noimc noimcmdline noimd noimdisable nois noincsearch noinf noinfercase noim noinsertmode nojs nojoinspaces nolnr nolangnoremap nolrm nolangremap nolz nolazyredraw nolbr nolinebreak nolisp nolist nolpl noloadplugins nomagic noml nomodeline nomle nomodelineexpr noma nomodifiable nomod nomodified nomore nomousef nomousefocus nomh nomousehide nomousemev nomousemoveevent nonu nonumber noodev noopendevice nopaste nopi nopreserveindent nopvw nopreviewwindow noprompt noro noreadonly nornu norelativenumber noremap nors norestorescreen nori norevins norl norightleft noru noruler
syn keyword mnvOption contained noscb noscrollbind noscf noscrollfocus nosecure nossl noshellslash nostmp noshelltemp nosr noshiftround nosn noshortname nosc noshowcmd nosft noshowfulltag nosm noshowmatch nosmd noshowmode noscs nosmartcase nosi nosmartindent nosta nosmarttab nosms nosmoothscroll nospell nosb nosplitbelow nospr nosplitright nosol nostartofline noswf noswapfile notbs notagbsearch notr notagrelative notgst notagstack notbidi notermbidi notgc notermguicolors notsy notermsync noterse nota notextauto notx notextmode notop notildeop noto notimeout notitle nottimeout notbi nottybuiltin notf nottyfast noudf noundofile novb novisualbell nowarn nowiv noweirdinvert nowic nowildignorecase nowmnu nowildmenu nowfb nowinfixbuf nowfh nowinfixheight nowfw nowinfixwidth
syn keyword mnvOption contained nowst nowlsteal nowrap nows nowrapscan nowrite nowa nowriteany nowb nowritebackup noxtermcodes

" mnvOptions: These are the invertible variants {{{2
" GEN_SYN_MNV: mnvOption invertible, START_STR='syn keyword mnvOption contained', END_STR=''
syn keyword mnvOption contained invari invallowrevins invarab invarabic invarshape invarabicshape invacd invautochdir invac invautocomplete invai invautoindent invar invautoread invasd invautoshelldir invaw invautowrite invawa invautowriteall invbk invbackup invbeval invballooneval invbevalterm invballoonevalterm invbin invbinary invbomb invbri invbreakindent invbl invbuflisted invcdh invcdhome invcin invcindent invcp invcompatible invcf invconfirm invci invcopyindent invcsre invcscoperelative invcst invcscopetag invcsverb invcscopeverbose invcrb invcursorbind invcuc invcursorcolumn invcul invcursorline invdeco invdelcombine invdiff invdg invdigraph inved invedcompatible invemo invemoji inveof invendoffile inveol invendofline invea invequalalways inveb inverrorbells
syn keyword mnvOption contained invek invesckeys invet invexpandtab invex invexrc invfic invfileignorecase invfixeol invfixendofline invfen invfoldenable invfs invfsync invgd invgdefault invguipty invhid invhidden invhk invhkmap invhkp invhkmapp invhls invhlsearch invicon invic invignorecase inmnvc inmnvcmdline inmnvd inmnvdisable invis invincsearch invinf invinfercase inmnv invinsertmode invjs invjoinspaces invlnr invlangnoremap invlrm invlangremap invlz invlazyredraw invlbr invlinebreak invlisp invlist invlpl invloadplugins invmagic invml invmodeline invmle invmodelineexpr invma invmodifiable invmod invmodified invmore invmousef invmousefocus invmh invmousehide invmousemev invmousemoveevent invnu invnumber invodev invopendevice invpaste invpi invpreserveindent
syn keyword mnvOption contained invpvw invpreviewwindow invprompt invro invreadonly invrnu invrelativenumber invremap invrs invrestorescreen invri invrevins invrl invrightleft invru invruler invscb invscrollbind invscf invscrollfocus invsecure invssl invshellslash invstmp invshelltemp invsr invshiftround invsn invshortname invsc invshowcmd invsft invshowfulltag invsm invshowmatch invsmd invshowmode invscs invsmartcase invsi invsmartindent invsta invsmarttab invsms invsmoothscroll invspell invsb invsplitbelow invspr invsplitright invsol invstartofline invswf invswapfile invtbs invtagbsearch invtr invtagrelative invtgst invtagstack invtbidi invtermbidi invtgc invtermguicolors invtsy invtermsync invterse invta invtextauto invtx invtextmode invtop invtildeop invto invtimeout
syn keyword mnvOption contained invtitle invttimeout invtbi invttybuiltin invtf invttyfast invudf invundofile invvb invvisualbell invwarn invwiv invweirdinvert invwic invwildignorecase invwmnu invwildmenu invwfb invwinfixbuf invwfh invwinfixheight invwfw invwinfixwidth invwst invwlsteal invwrap invws invwrapscan invwrite invwa invwriteany invwb invwritebackup invxtermcodes
" termcap codes (which can also be set) {{{2
" GEN_SYN_MNV: mnvOption term output code, START_STR='syn keyword mnvOption contained', END_STR='skipwhite nextgroup=mnvSetEqual,mnvSetMod'
syn keyword mnvOption contained t_AB t_AF t_AU t_AL t_al t_bc t_BE t_BD t_cd t_ce t_Ce t_CF t_cl t_cm t_Co t_CS t_Cs t_cs t_CV t_da t_db t_DL t_dl t_ds t_Ds t_EC t_EI t_fs t_fd t_fe t_GP t_IE t_IS t_ke t_ks t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_RF t_RB t_RC t_RI t_Ri t_RK t_RS t_RT t_RV t_Sb t_SC t_se t_Sf t_SH t_SI t_Si t_so t_SR t_sr t_ST t_Te t_te t_TE t_ti t_TI t_Ts t_ts t_u7 t_ue t_us t_Us t_ut t_vb t_ve t_vi t_VS t_vs t_WP t_WS t_XM t_xn t_xs t_ZH t_ZR t_8f t_8b t_8u t_xo t_BS t_ES skipwhite nextgroup=mnvSetEqual,mnvSetMod
" term key codes
syn keyword mnvOption contained	t_F1 t_F2 t_F3 t_F4 t_F5 t_F6 t_F7 t_F8 t_F9 t_k1 t_K1 t_k2 t_k3 t_K3 t_k4 t_K4 t_k5 t_K5 t_k6 t_K6 t_k7 t_K7 t_k8 t_K8 t_k9 t_K9 t_KA t_kb t_kB t_KB t_KC t_kd t_kD t_KD t_KE t_KF t_KG t_kh t_KH t_kI t_KI t_KJ t_KK t_kl t_KL t_kN t_kP t_kr t_ku
syn match   mnvOption contained	"t_%1"
syn match   mnvOption contained	"t_#2"
syn match   mnvOption contained	"t_#4"
syn match   mnvOption contained	"t_@7"
syn match   mnvOption contained	"t_*7"
syn match   mnvOption contained	"t_&8"
syn match   mnvOption contained	"t_%i"
syn match   mnvOption contained	"t_k;"

" mnvOptions: These are the variable names {{{2
" GEN_SYN_MNV: mnvOption normal variable,           START_STR='syn keyword mnvOptionVarName contained', END_STR=''
syn keyword mnvOptionVarName contained al aleph ari allowrevins ambw ambiwidth arab arabic arshape arabicshape acd autochdir ac autocomplete acl autocompletedelay act autocompletetimeout ai autoindent ar autoread asd autoshelldir aw autowrite awa autowriteall bg background bs backspace bk backup bkc backupcopy bdir backupdir bex backupext bsk backupskip bdlay balloondelay beval ballooneval bevalterm balloonevalterm bexpr balloonexpr bo belloff bin binary bomb brk breakat bri breakindent briopt breakindentopt bsdir browsedir bh bufhidden bl buflisted bt buftype cmp casemap cdh cdhome cd cdpath cedit ccv charconvert chi chistory cin cindent cink cinkeys cino cinoptions cinsd cinscopedecls cinw cinwords cb clipboard cpm clipmethod ch cmdheight cwh cmdwinheight cc colorcolumn
syn keyword mnvOptionVarName contained co columns com comments cms commentstring cp compatible cpt complete cfu completefunc cia completeitemalign cot completeopt cpp completepopup csl completeslash cto completetimeout cocu concealcursor cole conceallevel cf confirm ci copyindent cpo cpoptions cm cryptmethod cspc cscopepathcomp csprg cscopeprg csqf cscopequickfix csre cscoperelative cst cscopetag csto cscopetagorder csverb cscopeverbose crb cursorbind cuc cursorcolumn cul cursorline culopt cursorlineopt debug def define deco delcombine dict dictionary diff dia diffanchors dex diffexpr dip diffopt dg digraph dir directory dy display ead eadirection ed edcompatible emo emoji enc encoding eof endoffile eol endofline ea equalalways ep equalprg eb errorbells ef errorfile
syn keyword mnvOptionVarName contained efm errorformat ek esckeys ei eventignore eiw eventignorewin et expandtab ex exrc fenc fileencoding fencs fileencodings ff fileformat ffs fileformats fic fileignorecase ft filetype fcs fillchars ffu findfunc fixeol fixendofline fcl foldclose fdc foldcolumn fen foldenable fde foldexpr fdi foldignore fdl foldlevel fdls foldlevelstart fmr foldmarker fdm foldmethod fml foldminlines fdn foldnestmax fdo foldopen fdt foldtext fex formatexpr flp formatlistpat fo formatoptions fp formatprg fs fsync gd gdefault gfm grepformat gp grepprg gcr guicursor gfn guifont gfs guifontset gfw guifontwide ghr guiheadroom gli guiligatures go guioptions guipty gtl guitablabel gtt guitabtooltip hf helpfile hh helpheight hlg helplang hid hidden hl highlight
syn keyword mnvOptionVarName contained hi history hk hkmap hkp hkmapp hls hlsearch icon iconstring ic ignorecase imaf imactivatefunc imak imactivatekey imc imcmdline imd imdisable imi iminsert ims imsearch imsf imstatusfunc imst imstyle inc include inex includeexpr is incsearch inde indentexpr indk indentkeys inf infercase im insertmode isf isfname isi isident isk iskeyword isp isprint js joinspaces jop jumpoptions key kmp keymap km keymodel kpc keyprotocol kp keywordprg lmap langmap lm langmenu lnr langnoremap lrm langremap ls laststatus lz lazyredraw lhi lhistory lbr linebreak lines lsp linespace lisp lop lispoptions lw lispwords list lcs listchars lpl loadplugins luadll magic mef makeef menc makeencoding mp makeprg mps matchpairs mat matchtime mco maxcombine
syn keyword mnvOptionVarName contained mfd maxfuncdepth mmd maxmapdepth mm maxmem mmp maxmempattern mmt maxmemtot msc maxsearchcount mis menuitems mopt messagesopt msm mkspellmem ml modeline mle modelineexpr mls modelines ma modifiable mod modified more mouse mousef mousefocus mh mousehide mousem mousemodel mousemev mousemoveevent mouses mouseshape mouset mousetime mzq mzquantum mzschemedll mzschemegcdll nf nrformats nu number nuw numberwidth ofu omnifunc odev opendevice opfunc operatorfunc ost osctimeoutlen pp packpath para paragraphs paste pt pastetoggle pex patchexpr pm patchmode pa path perldll pi preserveindent pvh previewheight pvp previewpopup pvw previewwindow pdev printdevice penc printencoding pexpr printexpr pfn printfont pheader printheader pmbcs printmbcharset
syn keyword mnvOptionVarName contained pmbfn printmbfont popt printoptions prompt pb pumborder ph pumheight pmw pummaxwidth pw pumwidth pythondll pythonhome pythonthreedll pythonthreehome pyx pyxversion qftf quickfixtextfunc qe quoteescape ro readonly rdt redrawtime re regexpengine rnu relativenumber remap rop renderoptions report rs restorescreen ri revins rl rightleft rlc rightleftcmd rubydll ru ruler ruf rulerformat rtp runtimepath scr scroll scb scrollbind scf scrollfocus sj scrolljump so scrolloff sbo scrollopt sect sections secure sel selection slm selectmode ssop sessionoptions sh shell shcf shellcmdflag sp shellpipe shq shellquote srr shellredir ssl shellslash stmp shelltemp st shelltype sxe shellxescape sxq shellxquote sr shiftround sw shiftwidth shm shortmess
syn keyword mnvOptionVarName contained sn shortname sbr showbreak sc showcmd sloc showcmdloc sft showfulltag sm showmatch smd showmode stal showtabline stpl showtabpanel ss sidescroll siso sidescrolloff scl signcolumn scs smartcase si smartindent sta smarttab sms smoothscroll sts softtabstop spell spc spellcapcheck spf spellfile spl spelllang spo spelloptions sps spellsuggest sb splitbelow spk splitkeep spr splitright sol startofline stl statusline stlo statuslineopt su suffixes sua suffixesadd swf swapfile sws swapsync swb switchbuf smc synmaxcol syn syntax tcl tabclose tal tabline tpm tabpagemax tpl tabpanel tplo tabpanelopt ts tabstop tbs tagbsearch tc tagcase tfu tagfunc tl taglength tr tagrelative tag tags tgst tagstack tcldll term tbidi termbidi tenc termencoding
syn keyword mnvOptionVarName contained tgc termguicolors trz termresize tsy termsync twk termwinkey twsl termwinscroll tws termwinsize twt termwintype terse ta textauto tx textmode tw textwidth tsr thesaurus tsrfu thesaurusfunc top tildeop to timeout tm timeoutlen title titlelen titleold titlestring tb toolbar tbis toolbariconsize ttimeout ttm ttimeoutlen tbi ttybuiltin tf ttyfast ttym ttymouse tsl ttyscroll tty ttytype udir undodir udf undofile ul undolevels ur undoreload uc updatecount ut updatetime vsts varsofttabstop vts vartabstop vbs verbose vfile verbosefile vdir viewdir vop viewoptions vi mnvinfo vif mnvinfofile ve virtualedit vb visualbell warn wiv weirdinvert ww whichwrap wc wildchar wcm wildcharm wig wildignore wic wildignorecase wmnu wildmenu wim wildmode
syn keyword mnvOptionVarName contained wop wildoptions wak winaltkeys wcr wincolor wi window wfb winfixbuf wfh winfixheight wfw winfixwidth wh winheight whl winhighlight wmh winminheight wmw winminwidth winptydll wiw winwidth wse wlseat wst wlsteal wtm wltimeoutlen wrap wm wrapmargin ws wrapscan write wa writeany wb writebackup wd writedelay xtermcodes
" GEN_SYN_MNV: mnvOption term output code variable, START_STR='syn keyword mnvOptionVarName contained', END_STR=''
syn keyword mnvOptionVarName contained t_AB t_AF t_AU t_AL t_al t_bc t_BE t_BD t_cd t_ce t_Ce t_CF t_cl t_cm t_Co t_CS t_Cs t_cs t_CV t_da t_db t_DL t_dl t_ds t_Ds t_EC t_EI t_fs t_fd t_fe t_GP t_IE t_IS t_ke t_ks t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_RF t_RB t_RC t_RI t_Ri t_RK t_RS t_RT t_RV t_Sb t_SC t_se t_Sf t_SH t_SI t_Si t_so t_SR t_sr t_ST t_Te t_te t_TE t_ti t_TI t_Ts t_ts t_u7 t_ue t_us t_Us t_ut t_vb t_ve t_vi t_VS t_vs t_WP t_WS t_XM t_xn t_xs t_ZH t_ZR t_8f t_8b t_8u t_xo t_BS t_ES
syn keyword mnvOptionVarName contained	t_F1 t_F2 t_F3 t_F4 t_F5 t_F6 t_F7 t_F8 t_F9 t_k1 t_K1 t_k2 t_k3 t_K3 t_k4 t_K4 t_k5 t_K5 t_k6 t_K6 t_k7 t_K7 t_k8 t_K8 t_k9 t_K9 t_KA t_kb t_kB t_KB t_KC t_kd t_kD t_KD t_KE t_KF t_KG t_kh t_KH t_kI t_KI t_KJ t_KK t_kl t_KL t_kN t_kP t_kr t_ku
syn match   mnvOptionVarName contained	"t_%1"
syn match   mnvOptionVarName contained	"t_#2"
syn match   mnvOptionVarName contained	"t_#4"
syn match   mnvOptionVarName contained	"t_@7"
syn match   mnvOptionVarName contained	"t_*7"
syn match   mnvOptionVarName contained	"t_&8"
syn match   mnvOptionVarName contained	"t_%i"
syn match   mnvOptionVarName contained	"t_k;"

" unsupported settings: some were supported by vi but don't do anything in mnv {{{2
" GEN_SYN_MNV: Missing mnvOption, START_STR='syn keyword mnvErrSetting contained', END_STR=''
syn keyword mnvErrSetting contained akm altkeymap anti antialias ap autoprint bf beautify biosk bioskey consk conskey fk fkmap fl flash gr graphic ht hardtabs macatsui mesg novice open opt optimize oft osfiletype redraw slow slowopen sourceany w1200 w300 w9600
syn keyword mnvErrSetting contained noakm noaltkeymap noanti noantialias noap noautoprint nobf nobeautify nobiosk nobioskey noconsk noconskey nofk nofkmap nofl noflash nogr nographic nomacatsui nomesg nonovice noopen noopt nooptimize noredraw noslow noslowopen nosourceany
syn keyword mnvErrSetting contained invakm invaltkeymap invanti invantialias invap invautoprint invbf invbeautify invbiosk invbioskey invconsk invconskey invfk invfkmap invfl invflash invgr invgraphic invmacatsui invmesg invnovice invopen invopt invoptimize invredraw invslow invslowopen invsourceany

" AutoCmd Events {{{2
syn case ignore
" GEN_SYN_MNV: mnvAutoEvent, START_STR='syn keyword mnvAutoEvent contained', END_STR='skipwhite nextgroup=mnvAutoEventSep,@mnvAutocmdPattern'
syn keyword mnvAutoEvent contained BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre CmdlineChanged CmdlineEnter CmdlineLeave CmdlineLeavePre CmdUndefined CmdwinEnter CmdwinLeave ColorScheme ColorSchemePre CompleteChanged CompleteDone CompleteDonePre CursorHold CursorHoldI CursorMoved CursorMovedC CursorMovedI DiffUpdated DirChanged DirChangedPre EncodingChanged ExitPre FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre skipwhite nextgroup=mnvAutoEventSep,@mnvAutocmdPattern
syn keyword mnvAutoEvent contained FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave InsertLeavePre KeyInputPre MenuPopup ModeChanged OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SafeState SafeStateAgain SessionLoadPost SessionLoadPre SessionWritePost ShellCmdPost ShellFilterPost SigUSR1 SourceCmd SourcePost SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabClosed TabClosedPre TabEnter TabLeave TabNew TermChanged TerminalOpen TerminalWinOpen TermResponse TermResponseAll TextChanged TextChangedI TextChangedP TextChangedT TextYankPost MNVEnter MNVLeave MNVLeavePre MNVResized MNVResume MNVSuspend WinClosed WinEnter WinLeave WinNew WinNewPre skipwhite nextgroup=mnvAutoEventSep,@mnvAutocmdPattern
syn keyword mnvAutoEvent contained WinResized WinScrolled skipwhite nextgroup=mnvAutoEventSep,@mnvAutocmdPattern

syn keyword	mnvAutoEvent	contained	User	skipwhite nextgroup=mnvUserAutoEvent
syn match	mnvUserAutoEvent	contained	"\<\h\w*\>"	skipwhite nextgroup=mnvUserAutoEventSep,mnvAutocmdMod,mnvAutocmdBlock

" Highlight commonly used Groupnames {{{2
" GEN_SYN_MNV: mnvGroup, START_STR='syn keyword mnvGroup contained', END_STR=''
syn keyword mnvGroup contained Added Bold BoldItalic Boolean Changed Character Comment Conditional Constant Debug Define Delimiter Error Exception Float Function Identifier Ignore Include Italic Keyword Label Macro Number Operator PreCondit PreProc Removed Repeat Special SpecialChar SpecialComment Statement StorageClass String Structure Tag Todo Type Typedef Underlined

" Default highlighting groups {{{2
" GEN_SYN_MNV: mnvHLGroup, START_STR='syn keyword mnvHLGroup contained', END_STR=''
syn keyword mnvHLGroup contained ErrorMsg IncSearch ModeMsg NonText StatusLine StatusLineNC EndOfBuffer VertSplit VisualNOS DiffText DiffTextAdd PmenuSbar TabLineSel TabLineFill TabPanel TabPanelSel TabPanelFill Cursor lCursor TitleBar TitleBarNC QuickFixLine CursorLineSign CursorLineFold CurSearch PmenuKind PmenuKindSel PmenuMatch PmenuMatchSel PmenuExtra PmenuExtraSel PmenuBorder PopupSelected MessageWindow PopupNotification PreInsert Normal Directory LineNr CursorLineNr MoreMsg Question Search SpellBad SpellCap SpellRare SpellLocal PmenuThumb PmenuShadow Pmenu PmenuSel SpecialKey Title WarningMsg WildMenu Folded FoldColumn SignColumn Visual DiffAdd DiffChange DiffDelete TabLine CursorColumn CursorLine ColorColumn MatchParen StatusLineTerm StatusLineTermNC ToolbarLine
syn keyword mnvHLGroup contained ToolbarButton TitleBar TitleBarNC Menu Tooltip Scrollbar CursorIM ComplMatchIns LineNrAbove LineNrBelow MsgArea Terminal User1 User2 User3 User4 User5 User6 User7 User8 User9
syn match mnvHLGroup contained "\<Conceal\>"
syn case match

" Function Names {{{2
" GEN_SYN_MNV: mnvFuncName, START_STR='syn keyword mnvFuncName contained', END_STR=''
syn keyword mnvFuncName contained abs acos add and append appendbufline argc argidx arglistid argv asin assert_beeps assert_equal assert_equalfile assert_exception assert_fails assert_false assert_inrange assert_match assert_nobeep assert_notequal assert_notmatch assert_report assert_true atan atan2 autocmd_add autocmd_delete autocmd_get balloon_gettext balloon_show balloon_split base64_decode base64_encode bindtextdomain blob2list blob2str browse browsedir bufadd bufexists buflisted bufload bufloaded bufname bufnr bufwinid bufwinnr byte2line byteidx byteidxcomp call ceil ch_canread ch_close ch_close_in ch_evalexpr ch_evalraw ch_getbufnr ch_getjob ch_info ch_listen ch_log ch_logfile ch_open ch_read ch_readblob ch_readraw ch_sendexpr ch_sendraw ch_setoptions ch_status
syn keyword mnvFuncName contained changenr char2nr charclass charcol charidx chdir cindent clearmatches cmdcomplete_info col complete complete_add complete_check complete_info confirm copy cos cosh count cscope_connection cursor debugbreak deepcopy delete deletebufline did_filetype diff diff_filler diff_hlID digraph_get digraph_getlist digraph_set digraph_setlist echoraw empty environ err_teapot escape eval eventhandler executable execute exepath exists exists_compiled exp expand expandcmd extend extendnew feedkeys filecopy filereadable filewritable filter finddir findfile flatten flattennew float2nr floor fmod fnameescape fnamemodify foldclosed foldclosedend foldlevel foldtext foldtextresult foreach foreground fullcommand funcref function garbagecollect get getbufinfo
syn keyword mnvFuncName contained getbufline getbufoneline getbufvar getcellpixels getcellwidths getchangelist getchar getcharmod getcharpos getcharsearch getcharstr getcmdcomplpat getcmdcompltype getcmdline getcmdpos getcmdprompt getcmdscreenpos getcmdtype getcmdwintype getcompletion getcompletiontype getcurpos getcursorcharpos getcwd getenv getfontname getfperm getfsize getftime getftype getimstatus getjumplist getline getloclist getmarklist getmatches getmousepos getmouseshape getpid getpos getqflist getreg getreginfo getregion getregionpos getregtype getscriptinfo getstacktrace gettabinfo gettabvar gettabwinvar gettagstack gettext getwininfo getwinpos getwinposx getwinposy getwinvar glob glob2regpat globpath has has_key haslocaldir hasmapto histadd histdel
syn keyword mnvFuncName contained histget histnr hlID hlexists hlget hlset hostname iconv id indent index indexof input inputdialog inputlist inputrestore inputsave inputsecret insert instanceof interrupt invert isabsolutepath isdirectory isinf islocked isnan items job_getchannel job_info job_setoptions job_start job_status job_stop join js_decode js_encode json_decode json_encode keys keytrans len libcall libcallnr line line2byte lispindent list2blob list2str list2tuple listener_add listener_flush listener_remove localtime log log10 luaeval map maparg mapcheck maplist mapnew mapset match matchadd matchaddpos matcharg matchbufline matchdelete matchend matchfuzzy matchfuzzypos matchlist matchstr matchstrlist matchstrpos max menu_info min mkdir mode mzeval nextnonblank
syn keyword mnvFuncName contained ngettext nr2char or pathshorten perleval popup_atcursor popup_beval popup_clear popup_close popup_create popup_dialog popup_filter_menu popup_filter_yesno popup_findecho popup_findinfo popup_findpreview popup_getoptions popup_getpos popup_hide popup_list popup_locate popup_menu popup_move popup_notification popup_setbuf popup_setoptions popup_settext popup_show pow preinserted prevnonblank printf prompt_getprompt prompt_setcallback prompt_setinterrupt prompt_setprompt prop_add prop_add_list prop_clear prop_find prop_list prop_remove prop_type_add prop_type_change prop_type_delete prop_type_get prop_type_list pum_getpos pumvisible py3eval pyeval pyxeval rand range readblob readdir readdirex readfile redraw_listener_add redraw_listener_remove
syn keyword mnvFuncName contained reduce reg_executing reg_recording reltime reltimefloat reltimestr remote_expr remote_foreground remote_peek remote_read remote_send remote_startserver remove rename repeat resolve reverse round rubyeval screenattr screenchar screenchars screencol screenpos screenrow screenstring search searchcount searchdecl searchpair searchpairpos searchpos server2client serverlist setbufline setbufvar setcellwidths setcharpos setcharsearch setcmdline setcmdpos setcursorcharpos setenv setfperm setline setloclist setmatches setpos setqflist setreg settabvar settabwinvar settagstack setwinvar sha256 shellescape shiftwidth sign_define sign_getdefined sign_getplaced sign_jump sign_place sign_placelist sign_undefine sign_unplace sign_unplacelist
syn keyword mnvFuncName contained simplify sin sinh slice sort sound_clear sound_playevent sound_playfile sound_stop soundfold spellbadword spellsuggest split sqrt srand state str2blob str2float str2list str2nr strcharlen strcharpart strchars strdisplaywidth strftime strgetchar stridx string strlen strpart strptime strridx strtrans strutf16len strwidth submatch substitute swapfilelist swapinfo swapname synID synIDattr synIDtrans synconcealed synstack system systemlist tabpagebuflist tabpagenr tabpagewinnr tagfiles taglist tan tanh tempname term_dumpdiff term_dumpload term_dumpwrite term_getaltscreen term_getansicolors term_getattr term_getcursor term_getjob term_getline term_getscrolled term_getsize term_getstatus term_gettitle term_gettty term_list term_scrape
syn keyword mnvFuncName contained term_sendkeys term_setansicolors term_setapi term_setkill term_setrestore term_setsize term_start term_wait terminalprops test_alloc_fail test_autochdir test_feedinput test_garbagecollect_now test_garbagecollect_soon test_getvalue test_gui_event test_ignore_error test_mswin_event test_null_blob test_null_channel test_null_dict test_null_function test_null_job test_null_list test_null_partial test_null_string test_null_tuple test_option_not_set test_override test_refcount test_setmouse test_settime test_srand_seed test_unknown test_void timer_info timer_pause timer_start timer_stop timer_stopall tolower toupper tr trim trunc tuple2list type typename undofile undotree uniq uri_decode uri_encode utf16idx values virtcol virtcol2col
syn keyword mnvFuncName contained visualmode wildmenumode wildtrigger win_execute win_findbuf win_getid win_gettype win_gotoid win_id2tabwin win_id2win win_move_separator win_move_statusline win_screenpos win_splitmove winbufnr wincol windowsversion winheight winlayout winline winnr winrestcmd winrestview winsaveview winwidth wordcount writefile xor

" Predefined variable names {{{2
" GEN_SYN_MNV: mnvVarName, START_STR='syn keyword mnvMNVVarName contained', END_STR=''
syn keyword mnvMNVVarName contained count count1 prevcount errmsg warningmsg statusmsg shell_error this_session version lnum termresponse fname lang lc_time ctype charconvert_from charconvert_to fname_in fname_out fname_new fname_diff cmdarg foldstart foldend folddashes foldlevel progname servername dying exception throwpoint register cmdbang insertmode val key profiling fcs_reason fcs_choice beval_bufnr beval_winnr beval_winid beval_lnum beval_col beval_text scrollstart swapname swapchoice swapcommand char mouse_win mouse_winid mouse_lnum mouse_col operator searchforward hlsearch oldfiles windowid progpath completed_item option_new option_old option_oldlocal option_oldglobal option_command option_type errors false true none null numbermax numbermin numbersize
syn keyword mnvMNVVarName contained mnv_did_enter testing t_number t_string t_func t_list t_dict t_float t_bool t_none t_job t_channel t_blob t_class t_object termrfgresp termrbgresp termu7resp termstyleresp termblinkresp event versionlong echospace argv collate exiting colornames sizeofint sizeoflong sizeofpointer maxcol python3_version t_typealias t_enum t_enumvalue stacktrace t_tuple wayland_display clipmethod termda1 termosc mnv_did_init clipproviders

"--- syntax here and above generated by runtime/syntax/generator/gen_syntax_mnv.mnv ---

" Special MNV Highlighting (not automatic) {{{1

" Neomnv keyword list additions {{{2

if s:has("nmnv")
  syn keyword mnvOptionVarName contained channel inccommand mousescroll pumblend redrawdebug scrollback shada shadafile statuscolumn termpastefilter termsync winbar winblend winhighlight
  syn keyword mnvFuncName      contained api_info buffer_exists buffer_name buffer_number chanclose chansend ctxget ctxpop ctxpush ctxset ctxsize dictwatcheradd dictwatcherdel file_readable highlight_exists highlightID jobclose jobpid jobresize jobsend jobstart jobstop jobwait last_buffer_nr menu_get msgpackdump msgpackparse reg_recorded rpcnotify rpcrequest rpcstart rpcstop serverstart serverstop sockconnect stdioopen stdpath termopen test_write_list_log wait
  syn match   mnvFuncName      contained "\<nmnv_\w\+\>"
  syn keyword mnvMNVVarName    contained lua msgpack_types relnum stderr termrequest virtnum
endif

" Set up commands for this syntax highlighting file {{{2

com! -nargs=* MNV9 execute <q-args> s:mnv9script ? "" : "contained"
com! -nargs=* MNVL execute <q-args> s:mnv9script ? "contained" : ""

if exists("g:mnvsyn_folding") && g:mnvsyn_folding =~# '[acefhiHlmpPrt]'
 if g:mnvsyn_folding =~# 'a'
  com! -nargs=* MNVFolda <args> fold
 else
  com! -nargs=* MNVFolda <args>
 endif
 if g:mnvsyn_folding =~# 'c'
  com! -nargs=* MNVFoldc <args> fold
 else
  com! -nargs=* MNVFoldc <args>
 endif
 if g:mnvsyn_folding =~# 'e'
  com! -nargs=* MNVFolde <args> fold
 else
  com! -nargs=* MNVFolde <args>
 endif
 if g:mnvsyn_folding =~# 'f'
  com! -nargs=* MNVFoldf <args> fold
 else
  com! -nargs=* MNVFoldf <args>
 endif
 if g:mnvsyn_folding =~# 'h'
  com! -nargs=* MNVFoldh <args> fold
 else
  com! -nargs=* MNVFoldh <args>
 endif
 if g:mnvsyn_folding =~# 'H'
  com! -nargs=* MNVFoldH <args> fold
 else
  com! -nargs=* MNVFoldH <args>
 endif
 if g:mnvsyn_folding =~# 'i'
  com! -nargs=* MNVFoldi <args> fold
 else
  com! -nargs=* MNVFoldi <args>
 endif
 if g:mnvsyn_folding =~# 'l'
  com! -nargs=* MNVFoldl <args> fold
 else
  com! -nargs=* MNVFoldl <args>
 endif
 if g:mnvsyn_folding =~# 'm'
  com! -nargs=* MNVFoldm <args> fold
 else
  com! -nargs=* MNVFoldm <args>
 endif
 if g:mnvsyn_folding =~# 'p'
  com! -nargs=* MNVFoldp <args> fold
 else
  com! -nargs=* MNVFoldp <args>
 endif
 if g:mnvsyn_folding =~# 'P'
  com! -nargs=* MNVFoldP <args> fold
 else
  com! -nargs=* MNVFoldP <args>
 endif
 if g:mnvsyn_folding =~# 'r'
  com! -nargs=* MNVFoldr <args> fold
 else
  com! -nargs=* MNVFoldr <args>
 endif
 if g:mnvsyn_folding =~# 't'
  com! -nargs=* MNVFoldt <args> fold
 else
  com! -nargs=* MNVFoldt <args>
 endif
else
 com! -nargs=*	MNVFolda	<args>
 com! -nargs=*	MNVFoldc	<args>
 com! -nargs=*	MNVFolde	<args>
 com! -nargs=*	MNVFoldf	<args>
 com! -nargs=*	MNVFoldi	<args>
 com! -nargs=*	MNVFoldh	<args>
 com! -nargs=*	MNVFoldH	<args>
 com! -nargs=*	MNVFoldl	<args>
 com! -nargs=*	MNVFoldm	<args>
 com! -nargs=*	MNVFoldp	<args>
 com! -nargs=*	MNVFoldP	<args>
 com! -nargs=*	MNVFoldr	<args>
 com! -nargs=*	MNVFoldt	<args>
endif

" Deprecated variable options {{{2
if exists("g:mnv_minlines")
 let g:mnvsyn_minlines= g:mnv_minlines
endif
if exists("g:mnv_maxlines")
 let g:mnvsyn_maxlines= g:mnv_maxlines
endif
if exists("g:mnvsyntax_noerror")
 let g:mnvsyn_noerror= g:mnvsyntax_noerror
endif

" Nulls {{{2
" =====
MNV9 syn keyword  mnv9Null	null null_blob null_channel null_class null_dict null_function null_job null_list null_object null_partial null_string null_tuple

" Booleans {{{2
" ========
MNV9 syn keyword mnv9Boolean	true false

" Numbers {{{2
" =======
syn case ignore
syn match	mnvNumber	"\<\d\+\%('\d\+\)*"		skipwhite nextgroup=@mnvComment,mnvSubscript,mnvGlobal,mnvSubst1
syn match	mnvNumber	"\<\d\+\%('\d\+\)*\.\d\+\%(e[+-]\=\d\+\)\="	skipwhite nextgroup=@mnvComment
syn match	mnvNumber	"\<0b[01]\+\%('[01]\+\)*"		skipwhite nextgroup=@mnvComment,mnvSubscript
syn match	mnvNumber	"\<0o\=\o\+\%('\o\+\)*"		skipwhite nextgroup=@mnvComment,mnvSubscript
syn match	mnvNumber	"\<0x\x\+\%('\x\+\)*"		skipwhite nextgroup=@mnvComment,mnvSubscript
syn match	mnvNumber	'\<0z\>'			skipwhite nextgroup=@mnvComment
syn match	mnvNumber	'\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*'	skipwhite nextgroup=@mnvComment,mnvSubscript
syn case match

" All mnvCommands are contained by mnvIsCommand. {{{2
syn cluster mnvCmdList	contains=mnvAbb,mnvAddress,mnvAt,mnvAutocmd,mnvAugroup,mnvBehave,mnvBreakadd,mnvBreakdel,mnvBreaklist,mnvCall,mnvCatch,mnvCd,mnvCommandModifier,mnvConst,mnvDoautocmd,mnvDebug,mnvDebuggreedy,mnvDef,mnvDefFold,mnvDefer,mnvDelcommand,mnvDelFunction,mnvDoCommand,@mnvEcho,mnvElse,mnvEnddef,mnvEndfunction,mnvEndif,mnvEval,mnvExecute,mnvIsCommand,mnvExtCmd,mnvExFilter,mnvExMark,mnvFiletype,mnvFor,mnvFunction,mnvFunctionFold,mnvGrep,mnvGrepAdd,mnvGlobal,mnvHelp,mnvHelpgrep,mnvHighlight,mnvHistory,mnvImport,mnvLanguage,mnvLet,mnvLoadkeymap,mnvLockvar,mnvMake,mnvMap,mnvMark,mnvMatch,mnvNotFunc,mnvNormal,mnvProfdel,mnvProfile,mnvPrompt,mnvRedir,mnvSet,mnvSleep,mnvSort,mnvSyntax,mnvSyntime,mnvSynColor,mnvSynLink,mnvTerminal,mnvThrow,mnvUniq,mnvUnlet,mnvUnlockvar,mnvUnmap,mnvUserCmd,mnvMNVgrep,mnvMNVgrepadd,mnvWincmd,mnvMenu,mnvMenutranslate,@mnv9CmdList,@mnvExUserCmdList,mnvLua,mnvMzScheme,mnvPerl,mnvPython,mnvPython3,mnvPythonX,mnvRuby,mnvTcl
syn cluster mnv9CmdList	contains=mnv9Abstract,mnv9Class,mnv9Const,mnv9Enum,mnv9Export,mnv9Final,mnv9For,mnv9Interface,mnv9Type,mnv9Var
syn match mnvCmdSep	"\\\@1<!|"	skipwhite nextgroup=@mnvCmdList,mnvSubst1,@mnvFunc
syn match mnvCmdSep	":\+"	skipwhite nextgroup=@mnvCmdList,mnvSubst1
syn match mnvCount	contained	"\d\+"
syn match mnvIsCommand	"\<\h\w*\>"	nextgroup=mnvBang contains=mnvCommand
syn match mnvBang	      contained	"!"
syn match mnvWhitespace contained	"\s\+"

syn region mnvSubscript contained	matchgroup=mnvSubscriptBracket start="\[" end="]" nextgroup=mnvSubscript contains=@mnvExprList

syn match mnvVar	      contained	"\<\h[a-zA-Z0-9#_]*\>"	nextgroup=mnvSubscript contains=mnv9Super,mnv9This
syn match mnvVar		"\<[bwglstav]:\h[a-zA-Z0-9#_]*\>"	nextgroup=mnvSubscript contains=mnvVarScope
syn match mnvVar		"\<a:\%(000\|1\=[0-9]\|20\)\>"	nextgroup=mnvSubscript contains=mnvVarScope
syn match mnvFBVar      contained	"\<[bwglsta]:\h[a-zA-Z0-9#_]*\>"	nextgroup=mnvSubscript contains=mnvVarScope

" match the scope prefix independently of the retrofitted scope dictionary
syn match mnvVarScope   contained	"\<[bwglstav]:"
syn match mnvMNVVar     contained	"\<[bwglstav]:\%(\h\|\d\)\@!"	nextgroup=mnvSubscript

syn match mnvVarNameError contained "\<\h\w*\>"
syn match mnvMNVVar	"\<v:"		nextgroup=mnvSubscript,mnvMNVVarName,mnvVarNameError
syn match mnvOptionVar	"&\%([lg]:\)\="		nextgroup=mnvSubscript,mnvOptionVarName,mnvVarNameError
syn cluster mnvSpecialVar	contains=mnvEnvvar,mnvLetRegister,mnvOptionVar,mnvMNVVar

MNV9 syn match	mnvVar	contained	 "\<\h\w*\ze<"		nextgroup=mnv9TypeArgs

MNV9 syn match	mnv9LhsVariable	"\s\=\h[a-zA-Z0-9#_]*\ze\s\+[-+/*%]\==\%(\s\|$\)"
MNV9 syn match	mnv9LhsVariable	"\s\=\h[a-zA-Z0-9#_]*\ze\s\+\.\.=\%(\s\|$\)"
MNV9 syn match	mnv9LhsVariable	"\s\=\%([bwgt]:\)\=\h[a-zA-Z0-9#_]*\ze\s\+=<<\s"	skipwhite nextgroup=mnvLetHeredoc	contains=mnvVarScope
MNV9 syn match	mnv9LhsVariable	"\s\=\h[a-zA-Z0-9#_]*\ze\["		          nextgroup=mnvSubscript
MNV9 syn match	mnv9LhsVariable	"\s\=\h[a-zA-Z0-9#_]*\ze\."		          nextgroup=mnvOper	contains=mnv9Super,mnv9This
MNV9 syn match	mnv9LhsVariable	"\s\=\h[a-zA-Z0-9#_]*\ze\s*->"				contains=mnv9Super,mnv9This

MNV9 syn match mnv9LhsVariableList	"\[\_[^]]\+]\ze\s\+[-+/*%]\=="			contains=mnvVar,@mnvSpecialVar
MNV9 syn match mnv9LhsVariableList	"\[\_[^]]\+]\ze\s\+=<<"	skipwhite nextgroup=mnvLetHeredoc	contains=mnvVar,@mnvSpecialVar
MNV9 syn match mnv9LhsVariableList	"\[\_[^]]\+]\ze\s\+\.\.="			contains=mnvVar,@mnvSpecialVar

MNV9 syn match mnv9LhsRegister	"@["0-9\-a-zA-Z#=*+_/]\ze\s\+\%(\.\.\)\=="

syn cluster mnvExprList	contains=@mnvSpecialVar,@mnvFunc,mnvNumber,mnvOper,mnvOperParen,mnvLambda,mnvString,mnvVar,@mnv9ExprList
syn cluster mnv9ExprList	contains=mnv9Boolean,mnv9LambdaParams,mnv9Null

" Insertions And Appends: insert append {{{2
"   (buftype != nofile test avoids having append, change, insert show up in the command window)
" =======================
if &buftype != 'nofile'
 syn region mnvInsert	matchgroup=mnvCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=a\%[ppend]$"		matchgroup=mnvCommand end="^\.$" extend
 syn region mnvInsert	matchgroup=mnvCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=c\%[hange]$"		matchgroup=mnvCommand end="^\.$" extend
 syn region mnvInsert	matchgroup=mnvCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=i\%[nsert]$"		matchgroup=mnvCommand end="^\.$" extend
endif

" Behave! {{{2
" =======
if !exists("g:mnvsyn_noerror") && !exists("g:mnvsyn_nobehaveerror")
 syn match   mnvBehaveError contained	"[^ ]\+"
endif
syn match   mnvBehave	"\<be\%[have]\>"	nextgroup=mnvBehaveBang,mnvBehaveModel,mnvBehaveError skipwhite
syn match   mnvBehaveBang	contained	"\a\@1<=!" nextgroup=mnvBehaveModel skipwhite
syn keyword mnvBehaveModel	contained	mswin	xterm

" Break* commands {{{2
" ===============
syn keyword	mnvBreakaddFunc	contained	func	skipwhite nextgroup=mnvBreakpointFunctionLine,mnvBreakpointFunction
syn keyword	mnvBreakaddFile	contained	file	skipwhite nextgroup=mnvBreakpointFileLine,mnvBreakpointFilename
syn keyword	mnvBreakaddHere	contained	here	skipwhite nextgroup=mnvComment,mnv9Comment,mnvSep
syn keyword	mnvBreakaddExpr	contained	expr	skipwhite nextgroup=@mnvExprList

syn match	mnvBreakpointGlob		contained	"*"	skipwhite nextgroup=mnvComment,mnv9Comment,mnvSep
syn match	mnvBreakpointNumber	contained	"\<\d\+\>"	skipwhite nextgroup=mnvComment,mnv9Comment,mnvSep

syn cluster mnvBreakpointArg contains=mnvBreakaddFunc,mnvBreakaddFile,mnvBreakaddHere,mnvBreakaddExpr

syn match	mnvBreakpointFunction	contained	"\<\%(\*\|\w\)\+\>"	skipwhite nextgroup=mnvComment,mnv9Comment,mnvSep
syn match	mnvBreakpointFilename	contained	"\<\%(\*\|\f\)\+\>"	skipwhite nextgroup=mnvComment,mnv9Comment,mnvSep
syn match	mnvBreakpointFunctionLine	contained	"\<\d\+\>"		skipwhite nextgroup=mnvBreakpointFunction
syn match	mnvBreakpointFileLine	contained	"\<\d\+\>"		skipwhite nextgroup=mnvBreakpointFilename

syn keyword	mnvBreakadd	breaka[dd]	skipwhite nextgroup=@mnvBreakpointArg
syn keyword	mnvBreakdel	breakd[el]	skipwhite nextgroup=@mnvBreakpointArg,mnvBreakpointNumber,mnvBreakpointGlob
syn keyword	mnvBreaklist	breakl[ist]	skipwhite nextgroup=mnvComment,mnv9Comment,mnvSep

" Call {{{2
" ====
syn match mnvCall	"\<call\=\>"	skipwhite nextgroup=mnvVar,@mnvFunc

" Cd: {{{2
" ==
" GEN_SYN_MNV: mnvCommand cd, START_STR='syn keyword mnvCd', END_STR='skipwhite nextgroup=mnvCdBang,mnvCdArg,mnvComment,mnv9Comment,mnvCmdSep'
syn keyword mnvCd cd lc[d] lch[dir] tc[d] tch[dir] skipwhite nextgroup=mnvCdBang,mnvCdArg,mnvComment,mnv9Comment,mnvCmdSep
syn match	mnvCd	"\<chd\%[ir]\>"	skipwhite nextgroup=mnvCdBang,mnvCdArg,mnvComment,mnv9Comment,mnvCmdSep
syn region	mnvCdArg	contained
      \ start=+["#|]\@!\S+
      \ end="\ze\s*$"
      \ end=+\ze\s*\\\@1<!["#|]+
      \ skipwhite nextgroup=mnvComment,mnv9Comment,mnvCmdSep
      \ contains=mnvSpecfile,@mnvWildCard
      \ oneline

syn match	mnvCdBang	contained	"\a\@1<=!"	skipwhite nextgroup=mnvCdArg,mnvComment,mnv9Comment,mnvCmdSep

" Debug {{{2
" =====
syn keyword	mnvDebug	deb[ug]	skipwhite nextgroup=@mnvCmdList

" Debuggreedy {{{2
" ===========
" TODO: special-cased until generalised range/count support is implemented
syn match	mnvDebuggreedy	"\<0\=debugg\%[reedy]\>" contains=mnvCount

" Defer {{{2
" =====
syn match	mnvDefer	"\<defer\=\>"	skipwhite nextgroup=@mnvFunc,mnv9LambdaParams

" *Do commands {{{2
" ============
syn match	mnvDoCommandBang	contained	"\a\@1<=!"	skipwhite nextgroup=@mnvCmdList

syn keyword	mnvDoCommand	argdo bufd[o]		skipwhite nextgroup=mnvDoCommandBang,@mnvCmdList
syn keyword	mnvDoCommand	tabd[o] wind[o]		skipwhite nextgroup=@mnvCmdList
syn keyword	mnvDoCommand	cdo cfd[o]		skipwhite nextgroup=mnvDoCommandBang,@mnvCmdList
syn keyword	mnvDoCommand	ld[o] lfd[o]		skipwhite nextgroup=mnvDoCommandBang,@mnvCmdList
syn keyword	mnvDoCommand	foldd[oopen] folddoc[losed]	skipwhite nextgroup=@mnvCmdList

" Exception Handling {{{2
syn keyword	mnvThrow	th[row]	skipwhite nextgroup=@mnvExprList
syn keyword	mnvCatch	cat[ch]	skipwhite nextgroup=mnvCatchPattern
syn region	mnvCatchPattern	contained	matchgroup=Delimiter start="\z([!#$%&'()*+,-./:;<=>?@[\]^_`{}~]\)" skip="\\\\\|\\\z1" end="\z1" contains=@mnvSubstList oneline

" Export {{{2
" ======
if s:mnv9script
  syn keyword	mnv9Export	export	skipwhite nextgroup=mnv9Abstract,mnv9ClassBody,mnv9Const,mnv9Def,mnv9EnumBody,mnv9Final,mnv9InterfaceBody,mnv9Type,mnv9Var
endif

" Filetypes {{{2
" =========
syn match   mnvFiletype	"\<filet\%[ype]\(\s\+\I\i*\)*"	skipwhite contains=mnvFTCmd,mnvFTOption,mnvFTError
if !exists("g:mnvsyn_noerror") && !exists("g:mnvsyn_mnvFTError")
 syn match   mnvFTError  contained	"\I\i*"
endif
syn keyword mnvFTCmd    contained	filet[ype]
syn keyword mnvFTOption contained	detect indent off on plugin

" History {{{2
" =======
" TODO: handle MNV9 "history" variable assignment (like :wincmd, but a common variable name)
syn keyword	mnvHistory	his[tory]	skipwhite nextgroup=mnvHistoryName,mnvHistoryRange,mnvCmdSep,mnvComment,mnv9Comment
syn keyword	mnvHistoryName	contained	c[md] s[earch] e[xpr] i[nput] d[ebug] a[ll]	skipwhite nextgroup=mnvHistoryRange,mnvCmdSep,mnvComment,mnv9Comment
syn match	mnvHistoryName	contained	"[:/?=@>]"			skipwhite nextgroup=mnvHistoryRange,mnvCmdSep,mnvComment,mnv9Comment
syn match	mnvHistoryRange	contained	"-\=\<\d\+\>\%(\s*,\)\="		skipwhite nextgroup=mnvCmdSep,mnvComment,mnv9Comment
syn match	mnvHistoryRange	contained	",\s*-\=\d\+\>"			skipwhite nextgroup=mnvCmdSep,mnvComment,mnv9Comment
syn match	mnvHistoryRange	contained	"-\=\<\d\+\s*,\s*-\=\d\+\>"		skipwhite nextgroup=mnvCmdSep,mnvComment,mnv9Comment

" Import {{{2
" ======
syn keyword	mnvImportAutoload	contained	autoload	skipwhite nextgroup=mnvImportFilename
if s:mnv9script
  syn region	mnvImportFilename contained
        \ start="\S"
        \ skip=+\%#=1
          "\ continuation operators at SOL
          \\n\%(\s*#.*\n\)*\s*\%([[:punct:]]\+\&[^#"'(]\)
            \\|
          "\ continuation operators at EOL
          \\%(\%([[:punct:]]\+\&[^#"')]\)\s*\%(#.*\)\=\)\@<=$
            \\|
          \\n\%(\s*#.*\n\)*\s*as\s
            \\|
          \\%(^\s*#.*\)\@<=$
            \\|
          \\n\s*\%(\\\|#\\ \)
        \+
        \ matchgroup=mnvCommand
        \ end="\s\+\zsas\ze\s\+\h"
        \ matchgroup=NONE
        \ end="$"
        \ skipwhite nextgroup=mnvImportName
        \ contains=@mnv9Continue,@mnvExprList,mnv9Comment
        \ transparent
else
  syn region	mnvImportFilename contained
        \ start="\S"
        \ skip=+\n\s*\%(\\\|"\\ \)+
        \ matchgroup=mnvCommand
        \ end="\s\+\zsas\ze\s\+\h"
        \ matchgroup=NONE
        \ end="$"
        \ skipwhite nextgroup=mnvImportName
        \ contains=@mnvContinue,@mnvExprList
        \ transparent
endif
syn match	mnvImportName	contained	"\%(\<as\s\+\)\@<=\h\w*\>"	skipwhite nextgroup=@mnvComment
syn match	mnvImport		"\<imp\%[ort]\>"		skipwhite nextgroup=mnvImportAutoload,mnvImportFilename

" Language {{{2
" ========
syn keyword 	mnvLanguage		lan[guage]	skipwhite nextgroup=@mnvLanguageName,mnvLanguageCategory,mnvSep,mnvComment,mnv9Comment
syn keyword	mnvLanguageCategory	contained	col[late] cty[pe] mes[sages] tim[e]	skipwhite nextgroup=@mnvLanguageName

" [language[_territory][.codeset][@modifier]] and the reserved "C" and "POSIX"
syn match	mnvLanguageName		contained	"[[:alnum:]][[:alnum:]._@-]*[[:alnum:]]"	nextgroup=mnvSep,mnvComment,mnv9Comment
syn keyword	mnvLanguageNameReserved	contained	C POSIX			nextgroup=mnvSep,mnvComment,mnv9Comment
syn cluster	mnvLanguageName	contains=mnvLanguageName,mnvLanguageNameReserved

" Augroup : mnvAugroupError removed because long augroups caused sync'ing problems. {{{2
" ======= : Trade-off: Increasing synclines with slower editing vs augroup END error checking.
syn cluster mnvAugroupList	contains=@mnvCmdList,mnvFilter,@mnvFunc,mnvLineComment,mnvSpecFile,mnvOper,mnvNumber,mnvOperParen,@mnvComment,mnvString,mnvSubst,mnvRegister,mnvCmplxRepeat,mnvNotation,mnvCtrlChar,mnvContinue

" define
MNVFolda syn region mnvAugroup
      \ start="\<aug\%[roup]\>\ze\s\+\%([eE][nN][dD]\%($\|[[:space:]|"#]\)\)\@!\S"
      \ matchgroup=mnvAugroupKey
      \ end="\<aug\%[roup]\ze\s\+[eE][nN][dD]\s*\%($\|[|"#]\)"
      \ skipwhite nextgroup=mnvAugroupEnd
      \ contains=mnvAutocmd,@mnvAugroupList,mnvAugroupkey
if !exists("g:mnvsyn_noerror") && !exists("g:mnvsyn_noaugrouperror")
  syn match	mnvAugroupError	"\<aug\%[roup]\s\+[eE][nN][dD]\ze\s*\%($\|[|"#]\)"
endif

" TODO: MNV9 comment
syn match	mnvAugroupName	contained	"\%(\\["|[:space:]]\|[^"|[:space:]]\)\+"
      \                                                                 skipwhite nextgroup=mnvCmdSep,mnvComment
syn match	mnvAugroupEnd	contained	"\c\<END\>"	skipwhite nextgroup=mnvCmdSep,mnvComment
syn match	mnvAugroupBang	contained	"\a\@1<=!"	skipwhite nextgroup=mnvAugroupName
syn keyword	mnvAugroupKey	contained	aug[roup] 	skipwhite nextgroup=mnvAugroupBang,mnvAugroupName,mnvAugroupEnd

" remove
syn match	mnvAugroup	"\<aug\%[roup]!"		skipwhite nextgroup=mnvAugroupName contains=mnvAugroupKey,mnvAugroupBang

" list
MNVL syn match	mnvAugroup	"\<aug\%[roup]\>\ze\s*\%(["|]\|$\)"	skipwhite nextgroup=mnvCmdSep,mnvComment  contains=mnvAugroupKey
MNV9 syn match 	mnvAugroup	"\<aug\%[roup]\>\ze\s*\%([#|]\|$\)"	skipwhite nextgroup=mnvCmdSep,mnv9Comment contains=mnvAugroupKey

" Operators: {{{2
" =========
syn cluster	mnvOperGroup	contains=@mnvContinue,@mnvExprList,mnv9Comment,mnv9LineComment,mnvContinueString
syn match	mnvOper	"\a\@<!!"			skipwhite skipnl nextgroup=@mnvOperContinue,@mnvExprList,mnvSpecFile
syn match	mnvOper	"||\|&&\|[-+*/%.]"		skipwhite skipnl nextgroup=@mnvOperContinue,@mnvExprList,mnvSpecFile
syn match	mnvOper	"?"			skipwhite skipnl nextgroup=@mnvOperContinue,@mnvExprList,mnvContinueString
" distinguish ternary : from ex-colon
syn match	mnvOper	"\s\@1<=:\ze\s\|\s\@1<=:$"		skipwhite skipnl nextgroup=@mnvOperContinue,@mnvExprList,mnvContinueString
syn match	mnvOper	"??"			skipwhite skipnl nextgroup=@mnvOperContinue,@mnvExprList,mnvContinueString
syn match	mnvOper	"="			skipwhite skipnl nextgroup=@mnvOperContinue,@mnvExprList,mnvContinueString,mnvSpecFile
syn match	mnvOper	"\%#=1\%(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\)[?#]\="	skipwhite skipnl nextgroup=@mnvOperContinue,@mnvExprList,mnvContinueString,mnvSpecFile
syn match	mnvOper	"\<is\%(not\)\=\>"		skipwhite skipnl nextgroup=@mnvOperContinue,@mnvExprList,mnvContinueString,mnvSpecFile
syn match	mnvOper	"\<is\%(not\)\=[?#]"		skipwhite skipnl nextgroup=@mnvOperContinue,@mnvExprList,mnvContinueString,mnvSpecFile
syn region	mnvOperParen 		matchgroup=mnvParenSep start="("    end=")" contains=@mnvOperGroup nextgroup=mnvSubscript
syn region	mnvOperParen		matchgroup=mnvSep	     start="#\={" end="}" contains=@mnvOperGroup nextgroup=mnvSubscript,mnvVar
syn region	mnvOperParen	contained	matchgroup=mnvSep	     start="\["	end="]" contains=@mnvOperGroup nextgroup=mnvSubscript,mnvVar
if !exists("g:mnvsyn_noerror") && !exists("g:mnvsyn_noopererror")
 syn match	mnvOperError	")"
endif

syn match	mnvOperContinue		contained	"^\s*\\"        skipwhite skipnl nextgroup=@mnvOperContinue,@mnvExprList contains=mnvWhitespace
syn match         mnvOperContinueComment	contained	'^\s*["#]\\ .*' skipwhite skipnl nextgroup=@mnvOperContinue,@mnvExprList contains=mnvWhitespace
syn cluster	mnvOperContinue		contains=mnvOperContinue,mnvOperContinueComment

" Lambda Expressions: {{{2
" ==================
syn match	mnvLambdaOperator	contained	"->" skipwhite nextgroup=@mnvExprList
syn region	mnvLambda	contained
      \ matchgroup=mnvLambdaBrace
      \ start=+{\ze[[:space:][:alnum:]_.,]*\%(\n\s*\%(\\[[:space:][:alnum:]_.,]*\|"\\ .*\)\)*->+
      \ skip=+\n\s*\%(\\\|"\\ \)+
      \ end="}" end="$"
      \ contains=@mnvContinue,@mnvExprList,mnvLambdaParams
syn match	mnvLambdaParams	contained	"\%({\n\=\)\@1<=\_.\{-}\%(->\)\@=" nextgroup=mnvLambdaOperator contains=@mnvContinue,mnvFunctionParam

syn match	mnv9LambdaOperator   contained	"=>" skipwhite skipempty nextgroup=@mnvExprList,mnv9LambdaBlock,mnv9LambdaOperatorComment
syn match	mnv9LambdaParen      contained	"[()]"
syn match	mnv9LambdaParams	   contained
      \ "(\%(\<func(\|[^(]\)*\%(\n\s*\\\%(\<func(\|[^(]\)*\|\n\s*#\\ .*\)*\ze\s\+=>"
      \ skipwhite nextgroup=mnv9LambdaOperator
      \ contains=@mnv9Continue,mnvDefParam,mnv9LambdaParen,mnv9LambdaReturnType
syn region	mnv9LambdaReturnType contained	start=")\@<=:\s" end="\ze\s*#" end="\ze\s*=>" contains=@mnv9Continue,@mnvType transparent
syn region	mnv9LambdaBlock	   contained	matchgroup=mnvSep start="{" end="^\s*\zs}" contains=@mnvDefBodyList

syn match	mnv9LambdaOperatorComment contained "#.*" skipwhite skipempty nextgroup=@mnvExprList,mnv9LambdaBlock,mnv9LambdaOperatorComment

" Functions: Tag is provided for those who wish to highlight tagged functions {{{2
" =========
syn cluster	mnvFunctionBodyCommon	contains=@mnvCmdList,mnvCmplxRepeat,mnvContinue,mnvCtrlChar,mnvDef,mnvFBVar,mnvFunction,mnvNotFunc,mnvNumber,mnvOper,mnvOperParen,mnvRegister,mnvSpecFile,mnvString,mnvSubst,mnvFunctionFold,mnvDefFold,mnvCmdSep
syn cluster	mnvFunctionBodyList	contains=@mnvFunctionBodyCommon,mnvComment,mnvLineComment,mnvInsert,mnvConst,mnvLet,mnvSearch
syn cluster	mnvDefBodyList		contains=@mnvFunctionBodyCommon,mnv9Comment,mnv9LineComment,mnv9Block,mnv9Const,mnv9Final,mnv9Var,mnv9Null,mnv9Boolean,mnv9For,mnv9LhsVariable,mnv9LhsVariableList,mnv9LhsRegister,mnv9Search,@mnvSpecialVar,@mnv9Func

syn region	mnvFunctionPattern	contained
      \ matchgroup=mnvOper
      \ start="/"
      \ end="$"
      \ contains=@mnvSubstList

syn match	mnvFunctionBang	contained	"\a\@1<=!"	skipwhite nextgroup=mnvFunctionName
syn match	mnvDefBang	contained	"\a\@1<=!"	skipwhite nextgroup=mnvDefName
syn match	mnvFunctionSID	contained	"\c<sid>"
syn match	mnvFunctionScope	contained	"\<[bwglstav]:"
syn match	mnvFunctionName	contained
      \ "\%(<[sS][iI][dD]>\|[bwglstav]:\)\=\%([[:alnum:]_#.]\+\|{.\{-1,}}\)\+"
      \ skipwhite nextgroup=mnvFunctionParams,mnvCmdSep,mnvComment,mnv9Comment
      \ contains=mnvFunctionError,mnvFunctionScope,mnvFunctionSID,Tag
syn match	mnvDefName	contained
      \ "\%(<[sS][iI][dD]>\|[bwglstav]:\)\=\%([[:alnum:]_#.]\+\|{.\{-1,}}\)\+"
      \ nextgroup=mnvDefTypeParams,mnvDefParams,mnvCmdSep,mnvComment,mnv9Comment
      \ contains=mnvFunctionError,mnvFunctionScope,mnvFunctionSID,Tag

syn match	mnvFunction	"\<fu\%[nction]\>"	skipwhite nextgroup=mnvFunctionBang,mnvFunctionName,mnvFunctionPattern,mnvCmdSep,mnvComment
syn match	mnvDef	"\<def\>"		skipwhite nextgroup=mnvDefBang,mnvDefName,mnvFunctionPattern,mnvCmdSep,mnvComment

syn region	mnvFunctionComment	contained
      \ start=+".*+
      \ skip=+\n\s*\%(\\\|"\\ \)+
      \ end="$"
      \ skipwhite skipempty nextgroup=mnvFunctionBody,mnvEndfunction
syn region	mnvDefComment	contained
      \ start="#.*"
      \ skip=+\n\s*\%(\\\|#\\ \)+
      \ end="$"
      \ skipwhite skipempty nextgroup=mnvDefBody,mnvEnddef

syn region	mnvFunctionParams	contained
      \ matchgroup=Delimiter
      \ start="("
      \ skip=+\n\s*\%(\\\|"\\ \)+
      \ end=")"
      \ skipwhite skipempty nextgroup=mnvFunctionBody,mnvFunctionComment,mnvEndfunction,mnvFunctionMod,mnv9CommentError
      \ contains=mnvFunctionParam,mnvOperParen,@mnvContinue
syn region	mnvDefParams	contained
      \ matchgroup=Delimiter
      \ start="("
      \ end=")"
      \ skipwhite skipempty nextgroup=mnvDefBody,mnvDefComment,mnvEnddef,mnvReturnType,mnvCommentError
      \ contains=mnvDefParam,mnv9Comment,mnvFunctionParamEquals,mnvOperParen
syn region	mnvDefTypeParams	contained
      \ matchgroup=Delimiter
      \ start="<"
      \ end=">"
      \ nextgroup=mnvDefParams
      \ contains=mnv9DefTypeParam
syn match	mnvFunctionParam	contained	"\<\h\w*\>\|\.\.\."	skipwhite nextgroup=mnvFunctionParamEquals
syn match	mnvDefParam	contained	"\<\h\w*\>"		skipwhite nextgroup=mnvParamType,mnvFunctionParamEquals
syn match	mnv9DefTypeParam	contained	"\<\u\w*\>"

syn match	mnvFunctionParamEquals contained	"="			skipwhite	  nextgroup=@mnvExprList
syn match	mnvFunctionMod	     contained	"\<\%(abort\|closure\|dict\|range\)\>"	skipwhite skipempty nextgroup=mnvFunctionBody,mnvFunctionComment,mnvEndfunction,mnvFunctionMod,mnv9CommentError

syn region	mnvFunctionBody	contained
      \ start="^."
      \ matchgroup=mnvCommand
      \ end="\<endfu\%[nction]\>"
      \ skipwhite nextgroup=mnvCmdSep,mnvComment,mnv9CommentError
      \ contains=@mnvFunctionBodyList
syn region	mnvDefBody	contained
      \ start="^."
      \ matchgroup=mnvCommand
      \ end="\<enddef\>"
      \ skipwhite nextgroup=mnvCmdSep,mnv9Comment,mnvCommentError
      \ contains=@mnvDefBodyList

syn match	mnvEndfunction	"\<endf\%[unction]\>"	skipwhite nextgroup=mnvCmdSep,mnvComment,mnv9CommentError
syn match	mnvEnddef	"\<enddef\>"		skipwhite nextgroup=mnvCmdSep,mnv9Comment,mnvCommentError

if exists("g:mnvsyn_folding") && g:mnvsyn_folding =~# 'f'
  syn region	mnvFunctionFold
        \ start="\<fu\%[nction]!"
        "\ assume no dict literal in curly-brace name expressions
        \ start="\<fu\%[nction]\>\s*\%([[:alnum:]_:<>.#]\+\|{.\{-1,}}\)\+\s*("
        \ end="^\s*:\=\s*endf\%[unction]\>"
        \ contains=mnvFunction
        \ extend fold keepend transparent
  syn region	mnvDefFold
        \ start="\<def!"
        "\ assume no dict literal in curly-brace name expressions
        \ start="\<def\>\s*\%([[:alnum:]_:<>.#]\+\|{.\{-1,}}\)\+[<(]"
        \ end="^\s*:\=\s*enddef\>"
        \ contains=mnvDef
        \ extend fold keepend transparent
endif

syn match	mnvDelfunctionBang	contained	"\a\@1<=!"		skipwhite nextgroup=mnvFunctionName
syn match	mnvDelfunction			"\<delf\%[unction]\>"	skipwhite nextgroup=mnvDelfunctionBang,mnvFunctionName

" Types: {{{2
" =====

syn region	mnvReturnType	contained
      \ start=":\%(\s\|\n\)\@="
      \ skip=+\n\s*\%(\\\|#\\ \)\|^\s*#\\ +
      \ end="$"
      \ matchgroup=mnv9Comment
      "\ allow for legacy script tail comment error
      \ end="\ze[#"]"
      \ skipwhite skipempty nextgroup=mnvDefBody,mnvDefComment,mnvEnddef,mnvCommentError
      \ contains=@mnv9Continue,@mnvType
      \ transparent
syn match	mnvParamType	contained	":\s"	skipwhite skipnl nextgroup=@mnvType contains=mnvTypeSep

syn match	mnvTypeSep	contained	":\%(\s\|\n\)\@=" skipwhite nextgroup=@mnvType
syn keyword	mnvType	contained	blob bool channel float job number string void
syn keyword	mnvTypeAny	contained	any
syn match	mnvTypeObject	contained	"\<object<\@="	nextgroup=mnvTypeObjectArgs
syn region	mnvTypeObjectArgs	contained
      \ matchgroup=mnvTypeObjectBracket
      \ start="<"
      \ end=">"
      \ contains=mnvTypeAny,mnvTypeObject,mnvUserType
      \ oneline
      \ transparent
syn match	mnvType	contained	"\<\%(func\)\>"
syn region	mnvCompoundType	contained	matchgroup=mnvType start="\<func("	          end=")" nextgroup=mnvTypeSep contains=@mnv9Continue,@mnvType transparent
syn region	mnvCompoundType	contained	matchgroup=mnvType start="\<tuple<"           end=">"                      contains=@mnv9Continue,@mnvType transparent
syn region	mnvCompoundType	contained	matchgroup=mnvType start="\<\%(list\|dict\)<" end=">"		   contains=@mnvType oneline       transparent
syn match	mnvUserType	contained	"\<\%(\h\w*\.\)*\u\w*\>"

syn cluster mnvType contains=mnvType,mnvTypeAny,mnvTypeObject,mnvCompoundType,mnvUserType

" Classes, Enums And Interfaces: {{{2
" =============================

if s:mnv9script

  " Methods {{{3
  syn match	mnv9MethodDef		contained	"\<def\>"	skipwhite nextgroup=mnv9MethodDefName,mnv9ConstructorDefName
  syn match	mnv9MethodDefName		contained	"\<\h\w*\>"	nextgroup=mnv9MethodDefParams,mnv9MethodDefTypeParams contains=@mnv9MethodName
  syn region	mnv9MethodDefParams	contained
        \ matchgroup=Delimiter start="(" end=")"
        \ skipwhite skipnl nextgroup=mnv9MethodDefBody,mnv9MethodDefComment,mnvEnddef,mnv9MethodDefReturnType,mnvCommentError
        \ contains=mnvDefParam,mnv9Comment,mnvFunctionParamEquals
  syn region	mnv9MethodDefTypeParams	contained
        \ matchgroup=Delimiter
        \ start="<"
        \ end=">"
        \ nextgroup=mnv9MethodDefParams
        \ contains=mnv9DefTypeParam

  syn match	mnv9ConstructorDefName	contained	"\<_\=new\w*\>"
        \ nextgroup=mnv9ConstructorDefParams,mnv9ConstuctorDefTypeParams
        \ contains=@mnv9MethodName
  syn match	mnv9ConstructorDefParam	contained	"\<\%(this\.\)\=\h\w*\>"
        \ skipwhite nextgroup=mnvParamType,mnvFunctionParamEquals
        \ contains=mnv9This,mnvOper
  syn region	mnv9ConstructorDefParams	contained
        \ matchgroup=Delimiter start="(" end=")"
        \ skipwhite skipnl nextgroup=mnv9MethodDefBody,mnv9MethodDefComment,mnvEnddef,mnvCommentError
        \ contains=mnv9ConstructorDefParam,mnv9Comment,mnvFunctionParamEquals
  syn region	mnv9ConstuctorDefTypeParams	contained
        \ matchgroup=Delimiter
        \ start="<"
        \ end=">"
        \ nextgroup=mnv9ConstructorDefParams
        \ contains=mnv9DefTypeParam

  syn region	mnv9MethodDefReturnType	contained
        \ start=":\%(\s\|\n\)\@="
        \ skip=+\n\s*\%(\\\|#\\ \)\|^\s*#\\ +
        \ end="$"
        \ matchgroup=mnv9Comment
        \ end="\ze#"
        \ skipwhite skipnl nextgroup=mnv9MethodDefBody,mnv9MethodDefComment,mnvEnddef,mnvCommentError
        \ contains=@mnv9Continue,mnvType,mnvTypeSep
        \ transparent

  syn region	mnv9MethodDefComment	contained
        \ start="#.*"
        \ skip=+\n\s*\%(\\\|#\\ \)+
        \ end="$"
        \ skipwhite skipempty nextgroup=mnv9MethodDefBody,mnvEnddef

  syn region	mnv9MethodDefBody		contained
        \ start="^.\=" matchgroup=mnvCommand end="\<enddef\>"
        \ skipwhite nextgroup=mnvCmdSep,mnv9Comment,mnvCommentError
        \ contains=@mnv9MethodDefBodyList

  syn cluster	mnv9MethodDefBodyList contains=@mnvDefBodyList,mnv9This,mnv9Super

  if !exists("g:mnvsyn_noerror") && !exists("g:mnvsyn_nomnvfunctionerror")
    syn match	mnv9MethodNameError contained	"\<[a-z0-9]\i\>"
  endif
  syn match	mnv9MethodName	contained	"\<_\=new\w*\>"
  syn keyword	mnv9MethodName	contained	empty len string

  syn cluster	mnv9MethodName	contains=mnv9MethodName,mnv9MethodNameError

  if exists("g:mnvsyn_folding") && g:mnvsyn_folding =~# 'f'
    syn region	mnv9MethodDefFold	contained
          \ start="\%(^\s*\%(:\=static\s\+\)\=\)\@16<=:\=def\s\+\h\w*[<(]"
          \ end="^\s*:\=enddef\>"
          \ contains=mnv9MethodDef
          \ fold keepend extend transparent
  endif

  syn cluster mnv9MethodDef contains=mnv9MethodDef,mnv9MethodDefFold

  " Classes {{{3
  syn cluster	mnv9ClassBodyList		contains=mnv9Abstract,mnv9Class,mnv9Comment,mnv9LineComment,@mnv9Continue,@mnvExprList,mnv9Extends,mnv9Implements,@mnv9MethodDef,mnv9Public,mnv9Static,mnv9Const,mnv9Final,mnv9This,mnv9Super,mnv9Var

  syn match	mnv9Class		contained	"\<class\>"	skipwhite        nextgroup=mnv9ClassName
  syn match	mnv9ClassName		contained	"\<\u\w*\>"	skipwhite skipnl nextgroup=mnv9Extends,mnv9Implements
  syn match	mnv9SuperClass		contained	"\<\u\w*\>"	skipwhite skipnl nextgroup=mnv9Implements
  syn match	mnv9ImplementedInterface	contained	"\<\u\w*\>"	skipwhite skipnl nextgroup=mnv9InterfaceListComma,mnv9Extends
  syn match	mnv9InterfaceListComma	contained	","	skipwhite skipnl nextgroup=mnv9ImplementedInterface
  syn keyword	mnv9Abstract			abstract	skipwhite skipnl nextgroup=mnv9ClassBody,mnv9AbstractDef
  syn keyword	mnv9Extends		contained	extends	skipwhite skipnl nextgroup=mnv9SuperClass
  syn keyword	mnv9Implements		contained	implements	skipwhite skipnl nextgroup=mnv9ImplementedInterface
  syn keyword	mnv9Public		contained	public
  syn keyword	mnv9Static		contained	static
  " FIXME: don't match as dictionary keys, remove when operators are not
  "        shared between MNV9 and legacy script
  syn match	mnv9This		contained	"\.\@1<!\<this\>:\@!"
  " super must be followed by '.'
  syn match	mnv9Super		contained	"\.\@1<!\<super\.\@="

  MNVFoldc syn region	mnv9ClassBody	start="\<class\>" matchgroup=mnvCommand end="\<endclass\>" contains=@mnv9ClassBodyList transparent

  " Enums {{{3
  syn cluster	mnv9EnumBodyList		contains=mnv9Comment,mnv9LineComment,@mnv9Continue,mnv9Enum,@mnvExprList,@mnv9MethodDef,mnv9Public,mnv9Static,mnv9Const,mnv9Final,mnv9This,mnv9Var

  syn match	mnv9Enum		contained	"\<enum\>"	skipwhite           nextgroup=mnv9EnumName

  syn match	mnv9EnumName		contained	"\<\u\w*\>"	skipwhite skipempty nextgroup=mnv9EnumNameTrailing,mnv9EnumNameEmpty,mnv9EnumNameComment,@mnv9EnumNameContinue,mnv9EnumImplements
  syn match	mnv9EnumNameTrailing	contained	"\S.*"
  syn region	mnv9EnumNameComment	contained
        \ start="#" skip="\n\s*\%(\\\|#\\ \)" end="$"
        \ skipwhite skipempty nextgroup=mnv9EnumNameComment,mnv9EnumValue
        \ contains=@mnvCommentGroup,mnvCommentString
  " mnv9EnumName's "skipempty" should only apply to comments and enum values and not implements clauses
  syn match	mnv9EnumNameEmpty		contained	"^"	skipwhite skipempty nextgroup=mnv9EnumNameComment,mnv9EnumValue
  " allow line continuation between enum name and "implements"
  syn match	mnv9EnumNameContinue	contained
        \ "^\s*\\"
        \ skipwhite skipnl nextgroup=mnv9EnumNameTrailing,mnv9EnumNameEmpty,mnv9EnumNameComment,@mnv9EnumNameContinue,mnv9EnumImplements
        \ contains=mnvWhitespace
  syn match	mnv9EnumNameContinueComment	contained
        \ "^\s*#\\ .*"
        \ skipwhite skipnl nextgroup=mnv9EnumNameEmpty,mnv9EnumNameComment,@mnv9EnumNameContinue
        \ contains=mnvWhitespace
  syn cluster	mnv9EnumNameContinue	contains=mnv9EnumNameContinue,mnv9EnumNameContinueComment

  " enforce enum value list location
  syn match	mnv9EnumValue		contained	"\<\a\w*\>"		  nextgroup=mnv9EnumValueTypeArgs,mnv9EnumValueArgList,mnv9EnumValueListComma,mnv9Comment
  syn match	mnv9EnumValueListComma	contained	","	skipwhite skipempty nextgroup=mnv9EnumValue,mnv9EnumValueListCommaComment
  syn region	mnv9EnumValueListCommaComment	contained
        \ start="#" skip="\n\s*\%(\\\|#\\ \)" end="$"
        \ skipwhite skipempty nextgroup=mnv9EnumValueListCommaComment,mnv9EnumValue
        \ contains=@mnvCommentGroup,mnvCommentString
  syn region	mnv9EnumValueTypeArgs	contained
        \ matchgroup=Delimiter
        \ start="<\ze\a"
        \ end=">"
        \ nextgroup=mnv9EnumValueArgList
        \ contains=@mnvType
        \ oneline
  syn region	mnv9EnumValueArgList	contained
        \ matchgroup=mnvParenSep start="(" end=")"
        \ nextgroup=mnv9EnumValueListComma
        \ contains=@mnvExprList,mnvContinueString,mnv9Comment

  syn keyword	mnv9EnumImplements	contained	implements	skipwhite        nextgroup=mnv9EnumImplementedInterface
  syn match	mnv9EnumImplementedInterface	contained	"\<\u\w*\>"	skipwhite skipnl nextgroup=mnv9EnumInterfaceListComma,mnv9EnumImplementedInterfaceComment,mnv9EnumValue
  syn match	mnv9EnumInterfaceListComma	contained	","	skipwhite        nextgroup=mnv9EnumImplementedInterface
  syn region	mnv9EnumImplementedInterfaceComment	contained
        \ start="#" skip="\n\s*\%(\\\|#\\ \)" end="$"
        \ skipwhite skipempty nextgroup=mnv9EnumImplementedInterfaceComment,mnv9EnumValue
        \ contains=@mnvCommentGroup,mnvCommentString

  MNVFolde syn region	mnv9EnumBody	start="\<enum\>" matchgroup=mnvCommand end="\<endenum\>" contains=@mnv9EnumBodyList transparent

  " Interfaces {{{3
  " TODO: limit to decl only - no init values
  syn cluster	mnv9InterfaceBodyList	contains=mnv9Comment,mnv9LineComment,@mnv9Continue,mnv9Extends,mnv9Interface,mnv9AbstractDef,mnv9Var

  syn match	mnv9Interface		contained	"\<interface\>"	skipwhite nextgroup=mnv9InterfaceName
  syn match	mnv9InterfaceName		contained	"\<\u\w*\>"	skipwhite skipnl nextgroup=mnv9Extends

  syn keyword	mnv9AbstractDef		contained	def	skipwhite nextgroup=mnv9AbstractDefName
  syn match	mnv9AbstractDefName	contained	"\<\h\w*\>"	skipwhite nextgroup=mnv9AbstractDefParams,mnv9AbstractDefTypeParams contains=@mnv9MethodName
  syn region	mnv9AbstractDefParams	contained
        \ matchgroup=Delimiter start="(" end=")"
        \ skipwhite skipnl nextgroup=mnvDefComment,mnv9AbstractDefReturnType,mnvCommentError
        \ contains=mnvDefParam,mnv9Comment,mnvFunctionParamEquals
  syn region	mnv9AbstractDefReturnType	contained
        \ start=":\s" end="$" matchgroup=mnv9Comment end="\ze[#"]"
        \ skipwhite skipnl nextgroup=mnvDefComment,mnvCommentError
        \ contains=mnvTypeSep
        \ transparent
  syn region	mnv9AbstractDefTypeParams	contained
        \ matchgroup=Delimiter
        \ start="<"
        \ end=">"
        \ nextgroup=mnv9AbstractDefParams
        \ contains=mnv9DefTypeParam

  MNVFoldi syn region	mnv9InterfaceBody	start="\<interface\>" matchgroup=mnvCommand end="\<endinterface\>" contains=@mnv9InterfaceBodyList transparent

  " Type Aliases {{{3
  syn match	mnv9Type		"\<ty\%[pe]\>"	skipwhite nextgroup=mnv9TypeAlias,mnv9TypeAliasError
  syn match	mnv9TypeAlias	 contained	"\<\u\w*\>"	skipwhite nextgroup=mnv9TypeEquals
  syn match	mnv9TypeEquals	 contained	"="	skipwhite nextgroup=@mnvType
  if !exists("g:mnvsyn_noerror") && !exists("g:mnvsyn_notypealiaserror")
    syn match	mnv9TypeAliasError contained	"\<\l\w*\>"	skipwhite nextgroup=mnv9TypeEquals
  endif
endif

" Blocks: {{{2
" ======
MNV9 syn region	mnv9Block
      \ matchgroup=mnvSep
      \ start="{\ze\s*\%($\|[#|]\)"
      \ end="^\s*\zs}"
      \ skipwhite nextgroup=mnv9Comment,mnvCmdSep
      \ contains=@mnvDefBodyList

" Keymaps: {{{2
" =======

syn match  mnvKeymapStart	"^"	contained skipwhite nextgroup=mnvKeymapLhs,@mnvKeymapLineComment
syn match  mnvKeymapLhs	"\S\+"	contained skipwhite nextgroup=mnvKeymapRhs contains=mnvNotation
syn match  mnvKeymapRhs	"\S\+"	contained skipwhite nextgroup=mnvKeymapTailComment contains=mnvNotation
syn match  mnvKeymapTailComment	"\S.*"	contained

" TODO: remove when :" comment is matched in parts as "ex-colon comment" --djk
if s:mnv9script
  syn match  mnv9KeymapLineComment	"#.*"	contained contains=@mnvCommentGroup,mnvCommentString,mnv9CommentTitle
else
  syn match  mnvKeymapLineComment	+".*+	contained contains=@mnvCommentGroup,mnvCommentString,mnvCommentTitle
endif
syn cluster mnvKeymapLineComment contains=mnv9\=KeymapLineComment

syn region mnvLoadkeymap matchgroup=mnvCommand start="\<loadk\%[eymap]\>" end="\%$" contains=mnvKeymapStart

" Special Filenames, Modifiers, Extension Removal: {{{2
" ===============================================
syn match	mnvSpecFile	"<c\(word\|WORD\)>"	nextgroup=mnvSpecFileMod,mnvSubst1
syn match	mnvSpecFile	"<\([acs]file\|amatch\|abuf\)>"	nextgroup=mnvSpecFileMod,mnvSubst1
syn match	mnvSpecFile	"\s%[ \t:]"ms=s+1,me=e-1	nextgroup=mnvSpecFileMod,mnvSubst1
syn match	mnvSpecFile	"\s%$"ms=s+1		nextgroup=mnvSpecFileMod,mnvSubst1
syn match	mnvSpecFile	"\s%<"ms=s+1,me=e-1	nextgroup=mnvSpecFileMod,mnvSubst1
syn match	mnvSpecFile	"#\d\+\|[#%]<\>"		nextgroup=mnvSpecFileMod,mnvSubst1
syn match	mnvSpecFileMod	"\(:[phtre]\)\+"	contained

syn match	mnvSpecFile	contained		"%[ \t:]"me=e-1	nextgroup=mnvSpecFileMod
syn match	mnvSpecFile	contained	excludenl	"%$"	nextgroup=mnvSpecFileMod
syn match	mnvSpecFile	contained		"%<"me=e-1	nextgroup=mnvSpecFileMod

" User-Specified Commands: {{{2
" =======================
syn cluster	mnvUserCmdList	contains=@mnvCmdList,mnvCmplxRepeat,@mnvComment,mnvCtrlChar,mnvEscapeBrace,@mnvFunc,mnvNotation,mnvNumber,mnvOper,mnvRegister,mnvSpecFile,mnvString,mnvSubst,mnvSubstRep,mnvSubstRange

syn match	mnvUserCmd	"\<com\%[mand]\>!\="		skipwhite        nextgroup=mnvUserCmdAttrs,mnvUserCmdName contains=mnvBang
syn match	mnvUserCmd	+\<com\%[mand]\>!\=\ze\s*\n\s*\%(\\\|["#]\\ \)+	skipwhite skipnl nextgroup=mnvUserCmdAttrs,mnvUserCmdName contains=mnvBang

syn region	mnvUserCmdAttrs	    contained
      \ start="-\l"
      \ start=+^\s*\%(\\\|["#]\\ \)+
      \ end="\ze\s\u"
      \ skipwhite nextgroup=mnvUserCmdName
      \ contains=@mnvContinue,mnvUserCmdAttr,mnvUserCmdAttrError
      \ transparent
syn match	mnvUserCmdAttrError contained	"-\a\+\ze\%(\s\|=\)"
syn match	mnvUserCmdAttr	  contained	"-addr="		contains=mnvUserCmdAttrKey nextgroup=mnvUserCmdAttrAddr
syn match	mnvUserCmdAttr	  contained	"-bang\>"		contains=mnvUserCmdAttrKey
syn match	mnvUserCmdAttr	  contained	"-bar\>"		contains=mnvUserCmdAttrKey
syn match	mnvUserCmdAttr	  contained	"-buffer\>"		contains=mnvUserCmdAttrKey
syn match	mnvUserCmdAttr	  contained	"-complete="		contains=mnvUserCmdAttrKey nextgroup=mnvUserCmdAttrComplete,mnvUserCmdError
syn match	mnvUserCmdAttr	  contained	"-count\>"		contains=mnvUserCmdAttrKey
syn match	mnvUserCmdAttr	  contained	"-count="		contains=mnvUserCmdAttrKey nextgroup=mnvNumber
syn match	mnvUserCmdAttr	  contained	"-keepscript\>"		contains=mnvUserCmdAttrKey
syn match	mnvUserCmdAttr	  contained	"-nargs="		contains=mnvUserCmdAttrKey nextgroup=mnvUserCmdAttrNargs
syn match	mnvUserCmdAttr	  contained	"-range\>"		contains=mnvUserCmdAttrKey
syn match	mnvUserCmdAttr	  contained	"-range="		contains=mnvUserCmdAttrKey nextgroup=mnvNumber,mnvUserCmdAttrRange
syn match	mnvUserCmdAttr	  contained	"-register\>"		contains=mnvUserCmdAttrKey

syn match	mnvUserCmdAttrNargs	contained	"[01*?+]"
syn match	mnvUserCmdAttrRange	contained	"%"

if !exists("g:mnvsyn_noerror") && !exists("g:mnvsyn_nousercmderror")
 syn match	mnvUserCmdError	contained	"\S\+\>"
endif

syn case ignore
syn keyword	mnvUserCmdAttrKey   contained	a[ddr] ban[g] bar bu[ffer] com[plete] cou[nt] k[eepscript] n[args] ra[nge] re[gister]

" GEN_SYN_MNV: mnvUserCmdAttrComplete, START_STR='syn keyword mnvUserCmdAttrComplete contained', END_STR=''
syn keyword mnvUserCmdAttrComplete contained arglist augroup behave breakpoint buffer color command compiler cscope diff_buffer dir dir_in_path environment event expression file file_in_path filetype filetypecmd function help highlight history keymap locale mapclear mapping menu messages option packadd retab runtime scriptnames shellcmd shellcmdline sign syntax syntime tag tag_listfiles user var
syn keyword mnvUserCmdAttrComplete contained arglist augroup behave breakpoint buffer color command compiler cscope diff_buffer dir dir_in_path environment event expression file file_in_path filetype function help highlight history keymap locale mapclear mapping menu messages option packadd runtime scriptnames shellcmd shellcmdline sign syntax syntime tag tag_listfiles user var
syn keyword	mnvUserCmdAttrComplete	contained	custom customlist nextgroup=mnvUserCmdAttrCompleteFunc,mnvUserCmdError
syn match	mnvUserCmdAttrCompleteFunc	contained	",\%([bwglstav]:\|<[sS][iI][dD]>\)\=\h\w*\%([.#]\h\w*\)*"hs=s+1 nextgroup=mnvUserCmdError contains=mnvVarScope,mnvFunctionSID

" GEN_SYN_MNV: mnvUserCmdAttrAddr, START_STR='syn keyword mnvUserCmdAttrAddr contained', END_STR=''
syn keyword mnvUserCmdAttrAddr contained arguments arg buffers buf lines line loaded_buffers load other quickfix qf tabs tab windows win
syn keyword mnvUserCmdAttrAddr contained arguments arg buffers buf lines line loaded_buffers load other quickfix qf tabs tab windows win
syn match	mnvUserCmdAttrAddr     contained	"?"
syn case match

syn match	mnvUserCmdName	    contained	"\<\u[[:alnum:]]*\>"		skipwhite        nextgroup=mnvUserCmdBlock,mnvUserCmdReplacement
syn match	mnvUserCmdName	    contained	+\<\u[[:alnum:]]*\>\ze\s*\n\s*\%(\\\|["#]\\ \)+	skipwhite skipnl nextgroup=mnvUserCmdBlock,mnvUserCmdReplacement
syn region	mnvUserCmdReplacement contained
      \ start="\S"
      \ start=+^\s*\%(\\\|["#]\\ \)+
      \ skip=+\n\s*\%(\\\|["#]\\ \)+
      \ end="$"
      \ contains=@mnvContinue,@mnvUserCmdList,mnvComFilter
      \ keepend
syn region	mnvUserCmdBlock	    contained
      \ matchgroup=mnvSep
      \ start="{"
      \ end="^\s*\zs}"
      \ contains=@mnvDefBodyList,@mnvUserCmdList

syn match	mnvDelcommand		"\<delc\%[ommand]\>"	skipwhite nextgroup=mnvDelcommandAttr,mnvDelcommandName
syn match	mnvDelcommandAttr	contained	"-buffer\>"		skipwhite nextgroup=mnvDelcommandName
syn match	mnvDelcommandName	contained	"\<\u[[:alnum:]]*\>"

" Lower Priority Comments: after some mnv commands... {{{2
" =======================
if get(g:, "mnvsyn_comment_strings", 1)
  syn region	mnvCommentString	contained oneline start='\S\s\+"'ms=e end='"' extend
endif

if s:mnv9script
  syn cluster mnvComment contains=mnv9Comment
else
  syn cluster mnvComment contains=mnvComment
endif

MNVL syn region	mnvComment
      \ excludenl
      \ start=+"+
      \ skip=+\n\s*\%(\\\|"\\ \)+
      \ end="$"
      \ contains=@mnvCommentGroup,mnvCommentString
      \ extend
MNV9 syn region	mnv9Comment
      \ excludenl
      \ start="\%#=1\s\@1<=#\%({\@!\|{{\)"
      \ skip="\n\s*\%(\\\|#\\ \)"
      \ end="$"
      \ contains=@mnvCommentGroup,mnvCommentString
      \ extend

syn match	mnv9CommentError	contained	"#.*"
syn match	mnvCommentError	contained	+".*+

" Environment Variables: {{{2
" =====================
syn match	mnvEnvvar	"\$\I\i*"
syn match	mnvEnvvar	"\${\I\i*}"

" Strings {{{2
" =======

" In-String Specials:
" Try to catch strings, if nothing else matches (therefore it must precede the others!)
"  mnvEscapeBrace handles ["]  []"] (ie. "s don't terminate string inside [])
" syn region	mnvEscapeBrace	oneline   contained transparent start="[^\\]\(\\\\\)*\[\zs\^\=\]\=" skip="\\\\\|\\\]" end="]"me=e-1
syn match	mnvPatSepErr	contained	"\\)"
syn match	mnvPatSep	contained	"\\|"
syn region	mnvPatSepZone	oneline   contained   matchgroup=mnvPatSepZ start="\\%\=\ze(" skip="\\\\" end="\\)\|[^\\]['"]"	contains=@mnvStringGroup
syn region	mnvPatRegion	contained transparent matchgroup=mnvPatSepR start="\\[z%]\=(" end="\\)"	contains=@mnvSubstList oneline
syn match	mnvNotPatSep	contained	"\\\\"
syn cluster	mnvStringGroup	contains=mnvEscape,mnvEscapeBrace,mnvPatSep,mnvNotPatSep,mnvPatSepErr,mnvPatSepZone,@Spell
syn region	mnvString	oneline keepend	matchgroup=mnvString start=+[^a-zA-Z\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=mnvStringEnd end=+"+ nextgroup=mnvSubscript contains=@mnvStringGroup extend
syn region	mnvString	oneline	matchgroup=mnvString start=+[^a-zA-Z\\@]'+lc=1 end=+'+		       nextgroup=mnvSubscript contains=mnvQuoteEscape  extend
"syn region	mnvString	oneline	start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/"	contains=@mnvStringGroup  " see tst45.mnv

syn match	mnvEscape	contained	"\\."
" syn match	mnvEscape	contained	+\\[befnrt\"]+
syn match	mnvEscape	contained	"\\\o\{1,3}\|\\[xX]\x\{1,2}\|\\u\x\{1,4}\|\\U\x\{1,8}"
syn match	mnvEscape	contained	"\\<" contains=mnvNotation
syn match	mnvEscape	contained	"\\<\*[^>]*>\=>"
syn match	mnvQuoteEscape	contained	"''"

syn region	mnvString	oneline matchgroup=mnvString start=+$'+ end=+'+ nextgroup=mnvSubscript contains=@mnvStringInterpolation,mnvQuoteEscape  extend
syn region	mnvString	oneline matchgroup=mnvString start=+$"+ end=+"+ nextgroup=mnvSubscript contains=@mnvStringInterpolation,@mnvStringGroup extend
syn region	mnvStringInterpolationExpr  oneline contained matchgroup=mnvSep start=+{+ end=+}+ contains=@mnvExprList
syn match	mnvStringInterpolationBrace contained "{{"
syn match	mnvStringInterpolationBrace contained "}}"
syn cluster	mnvStringInterpolation contains=mnvStringInterpolationExpr,mnvStringInterpolationBrace

syn region	mnvContinueString	contained	matchgroup=mnvContinueString start=+"+  skip=+\n\s*\%(\\\|["#]\\ \)+ end=+"+ end="$" skipwhite nextgroup=mnvSubscript,mnvComment contains=@mnvContinue,@mnvStringGroup
syn region	mnvContinueString	contained	matchgroup=mnvContinueString start=+'+  skip=+\n\s*\%(\\\|["#]\\ \)+ end=+'+ end="$" skipwhite nextgroup=mnvSubscript,mnvComment contains=@mnvContinue,mnvQuoteEscape
syn region	mnvContinueString	contained	matchgroup=mnvContinueString start=+$"+ skip=+\n\s*\%(\\\|["#]\\ \)+ end=+"+ end="$" skipwhite nextgroup=mnvSubscript,mnvComment contains=@mnvContinue,@mnvStringInterpolation,@mnvStringGroup
syn region	mnvContinueString	contained	matchgroup=mnvContinueString start=+$'+ skip=+\n\s*\%(\\\|["#]\\ \)+ end=+'+ end="$" skipwhite nextgroup=mnvSubscript,mnvComment contains=@mnvContinue,@mnvStringInterpolation,mnvQuoteEscape

" Substitutions: {{{2
" =============
syn cluster	mnvSubstList	contains=mnvPatSep,mnvPatRegion,mnvPatSepErr,mnvSubstTwoBS,mnvSubstRange,mnvNotation
syn cluster	mnvSubstRepList	contains=mnvSubstSubstr,mnvSubstTwoBS,mnvNotation
syn cluster	mnvSubstList	add=mnvCollection
syn match	mnvSubst		"^\s*\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)\>"		skipwhite nextgroup=mnvSubstPat,mnvSubstFlags,mnvSubstCount
syn match	mnvSubst		"^\s*\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)[_#]\@="	skipwhite nextgroup=mnvSubstPat
syn match	mnvSubst		"^\s*\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)\%(\d\+\)\@="	skipwhite nextgroup=mnvSubstCount
syn match	mnvSubst1	contained	"\%(s\%[ubstitute]\|sm\%[agic]\>\|sno\%[magic]\)\>"		skipwhite nextgroup=mnvSubstPat,mnvSubstFlags,mnvSubstCount
syn match	mnvSubst1	contained	"\%(s\%[ubstitute]\|sm\%[agic]\>\|sno\%[magic]\)[_#]\@="	skipwhite nextgroup=mnvSubstPat
syn match	mnvSubst1	contained	"\%(s\%[ubstitute]\|sm\%[agic]\>\|sno\%[magic]\)\%(\d\+\)\@="	skipwhite nextgroup=mnvSubstCount
syn match	mnvSubstFlagErr	contained	"[^< \t\r|]\+" contains=mnvSubstFlags
" & and # after :s are always pattern delimiters not flags
syn match	mnvSubstFlags	contained	"[&cegiIlnpr#]\+"	skipwhite nextgroup=mnvSubstCount
syn match	mnvSubstCount	contained	"\d\+\>"
" TODO: MNV9 illegal separators for abbreviated :s form are [-.:], :su\%[...] required
"     : # is allowed but "not recommended" (see :h pattern-delimiter)
syn region	mnvSubstPat	contained	matchgroup=mnvSubstDelim start="\z([!#$%&'()*+,-./:;<=>?@[\]^_`{}~]\)"rs=s+1 skip="\\\\\|\\\z1" end="\z1"re=e-1,me=e-1	contains=@mnvSubstList	nextgroup=mnvSubstRep4	oneline
syn region	mnvSubstRep4	contained	matchgroup=mnvSubstDelim start="\z(.\)" skip="\\\\\|\\\z1" end="\z1" matchgroup=mnvNotation end="<[cC][rR]>"	contains=@mnvSubstRepList	nextgroup=mnvSubstFlagErr	oneline
syn region	mnvCollection	contained 	transparent	start="\\\@<!\[" skip="\\\[" end="\]"	contains=mnvCollClass
syn match	mnvCollClassErr	contained	"\[:.\{-\}:\]"
syn match	mnvCollClass	contained 	transparent	"\%#=1\[:\(alnum\|alpha\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|xdigit\|retu\%[rn]\|tab\|escape\|backspace\):\]"
syn match	mnvSubstSubstr	contained	"\\z\=\d"
syn match	mnvSubstTwoBS	contained	"\\\\"

" TODO: flags, unlike count, must follow immediately
"     : distinguish from with MNV9 &var
" syn match	mnvSubst		"^\s*\zs&&\="	skipwhite nextgroup=mnvSubstFlags,mnvSubstCount
" syn match	mnvSubst		"^\s*\zs\~&\="	skipwhite nextgroup=mnvSubstFlags,mnvSubstCount
" syn match	mnvSubst1	contained	"&&\="	skipwhite nextgroup=mnvSubstFlags,mnvSubstCount
" syn match	mnvSubst1	contained	"\~&\="	skipwhite nextgroup=mnvSubstFlags,mnvSubstCount

" two and three letter variants (matched as :s + flags, count may follow immediately)
syn match	mnvSubst		"^\s*\zssc[egiIlnp]\=\a\@!"	skipwhite nextgroup=mnvSubstCount	contains=mnvSubstFlags
syn match	mnvSubst		"^\s*\zssg[ceiIlnpr]\=\a\@!"	skipwhite nextgroup=mnvSubstCount	contains=mnvSubstFlags
syn match	mnvSubst		"^\s*\zssi[ceInpr]\=\a\@!"	skipwhite nextgroup=mnvSubstCount	contains=mnvSubstFlags
syn match	mnvSubst		"^\s*\zssI[ceginplr]\=\a\@!"	skipwhite nextgroup=mnvSubstCount	contains=mnvSubstFlags
syn match	mnvSubst		"^\s*\zssr[cgiInplr]\=\a\@!"	skipwhite nextgroup=mnvSubstCount	contains=mnvSubstFlags

syn match	mnvSubst1	contained	"\<sc[egiIlnp]\=\a\@!"	skipwhite nextgroup=mnvSubstCount	contains=mnvSubstFlags
syn match	mnvSubst1	contained	"\<sg[ceiIlnpr]\=\a\@!"	skipwhite nextgroup=mnvSubstCount	contains=mnvSubstFlags
syn match	mnvSubst1	contained	"\<si[ceInpr]\=\a\@!"	skipwhite nextgroup=mnvSubstCount	contains=mnvSubstFlags
syn match	mnvSubst1	contained	"\<sI[ceginplr]\=\a\@!"	skipwhite nextgroup=mnvSubstCount	contains=mnvSubstFlags
syn match	mnvSubst1	contained	"\<sr[cgiInplr]\=\a\@!"	skipwhite nextgroup=mnvSubstCount	contains=mnvSubstFlags

" Vi compatibility
syn match	mnvSubstDelim	contained	"\\"
syn match	mnvSubstPat	contained	"\\\ze[/?&]" contains=mnvSubstDelim nextgroup=mnvSubstRep4

" Mark: {{{2
" ====
MNVL syn match	mnvExMark	"\<k\%([a-zA-Z0-9]\>\|[[\]<>'`]\)\@="         nextgroup=@mnvMarkArg
MNVL syn match	mnvExMark	"\<k\>"	      	skipwhite nextgroup=@mnvMarkArg
syn match	mnvExMark	"\<mark\>"	      	skipwhite nextgroup=@mnvMarkArg

syn match	mnvMarkArg	contained	"[a-zA-Z]\>\|[[\]<>'`]"	skipwhite nextgroup=mnvCmdSep,mnvComment
syn match	mnvMarkArgError	contained	"["^.(){}0-9]"
syn cluster	mnvMarkArg	contains=mnvMarkArg,mnvMarkArgError

" Marks, Registers, Addresses, Filters: {{{2
syn match	mnvMark	"'[a-zA-Z0-9]\ze\s*$"
syn match	mnvMark	"'[[\]{}()<>'`"^.]\ze\s*$"
syn match	mnvMark	"'[a-zA-Z0-9]\ze[-+,!]"	nextgroup=mnvFilter,mnvMarkNumber,mnvSubst1
syn match	mnvMark	"'[[\]{}()<>'`"^.]\ze[-+,!]"	nextgroup=mnvFilter,mnvMarkNumber,mnvSubst1
syn match	mnvMark	",\zs'[[\]{}()<>'`"^.]"	nextgroup=mnvFilter,mnvMarkNumber,mnvSubst1
syn match	mnvMark	"[!,:]\zs'[a-zA-Z0-9]"	nextgroup=mnvFilter,mnvMarkNumber,mnvSubst1
syn match	mnvMarkNumber	"[-+]\d\+"		contained contains=mnvOper nextgroup=mnvSubst1
syn match	mnvPlainMark contained	"'[a-zA-Z0-9]"
syn match	mnvRange	"[`'][a-zA-Z0-9],[`'][a-zA-Z0-9]"	contains=mnvMark	skipwhite nextgroup=mnvFilter

syn match	mnvRegister	'[^,;[{: \t]\zs"[a-zA-Z0-9.%#:_\-/]\ze[^a-zA-Z_":0-9]'
syn match	mnvRegister	'@"'
syn match	mnvLetRegister	contained	'@["@0-9\-a-zA-Z:.%#=*+~_/]'

syn match	mnvAddress	",\zs[.$]"	skipwhite nextgroup=mnvSubst1
syn match	mnvAddress	"%\ze\a"	skipwhite nextgroup=mnvString,mnvSubst1

syn match	mnvFilter 		"^!!\=[^"]\{-}\(|\|\ze\"\|$\)"	contains=mnvOper,mnvSpecFile
syn match	mnvFilter    contained	"!!\=[^"]\{-}\(|\|\ze\"\|$\)"	contains=mnvOper,mnvSpecFile
syn match	mnvComFilter contained	"|!!\=[^"]\{-}\(|\|\ze\"\|$\)"      contains=mnvOper,mnvSpecFile

" Complex Repeats: (:h complex-repeat) {{{2
" ===============
syn match	mnvCmplxRepeat	'[^a-zA-Z_/\\()]q[0-9a-zA-Z"]\>'lc=1

" NOTE: :* as an alias for :@ is not supported, this is considered a :range,
" see :help cpo-star
syn match	mnvAtArg	contained	+@\@1<=[0-9a-z".=*+:@]+
syn match	mnvAt	+@[0-9a-z".=*+:@]\ze\s*\%($\|[|"#]\)+	skipwhite nextgroup=mnvCmdSep,mnvComment,mnv9Comment contains=mnvAtArg
" MNV9: avoid LHS assignment mismatching of :@["#]
syn match	mnvAt	+@\ze\s*\%($\||\|\s["#]\)+		skipwhite nextgroup=mnvCmdSep,mnvComment,mnv9Comment

" Set command and associated set-options (mnvOptions) with comment {{{2
syn match	mnvSet		"\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skipwhite nextgroup=mnvSetBang,mnvCmdSep,mnvComment,mnvSetArgs
syn region	mnvSetComment	contained	start=+"+ skip=+\n\s*\%(\\\||"\\ \)+ end="$" contains=@mnvCommentGroup,mnvCommentString extend
syn match	mnvSetCmdSep	contained	"|" skipwhite nextgroup=@mnvCmdList,mnvSubst1,@mnvFunc
syn match	mnvSetEscape	contained	"\\\%(\\[|"]\|.\)"
syn match	mnvSetBarEscape	contained	"\\|"
syn match	mnvSetQuoteEscape	contained	+\\"+
syn region	mnvSetArgs	contained
      \ start="\l\|<"
      \ skip=+\n\s*\%(\\\|["#]\\ \)\|^\s*"\\ +
      \ end=+\ze\\\@1<![|"]+
      "\ assume this isn't an escaped char with backslash on the previous line
      \ end=+^\s*\\\ze[|"]+
      \ end="\ze\s#"
      \ end="$"
      \ nextgroup=mnvSetCmdSep,mnvSetComment,mnv9Comment
      \ contains=@mnvContinue,mnvErrSetting,mnvOption,mnvSetAll,mnvSetTermcap
      \ keepend
" TODO: restrict this to valid values?
syn match	mnvOption	contained	"<[^>]\+>"	contains=mnvOption
syn region	mnvSetEqual	contained
      \ matchgroup=mnvOper
      \ start="[=:]\|[-+^]="
      \ skip=+\\\s\|^\s*\%(\\\|["#]\\ \)+
      \ end="\ze\s"
      \ contains=@mnvContinue,mnvCtrlChar,mnvEnvvar,mnvNotation,mnvSetSep,mnvSetEscape,mnvSetBarEscape,mnvSetQuoteEscape
syn match	mnvSetBang	contained	"\a\@1<=!" skipwhite nextgroup=mnvSetAll,mnvSetTermcap
syn keyword	mnvSetAll	contained	all nextgroup=mnvSetMod
syn keyword	mnvSetTermcap	contained	termcap
syn match	mnvSetSep	contained	"[,:]"
syn match	mnvSetMod	contained	"\a\@1<=\%(&mnv\=\|[!&?<]\)"

" Variable Declarations: {{{2
" =====================
MNVL syn keyword	mnvLet	let		skipwhite nextgroup=@mnvSpecialVar,mnvVar,mnvVarList,mnvLetVar
MNVL syn keyword	mnvConst	cons[t]		skipwhite nextgroup=@mnvSpecialVar,mnvVar,mnvVarList,mnvLetVar
syn region	mnvVarList	contained
      \ start="\[" end="]"
      \ skipwhite nextgroup=mnvLetHeredoc
      \ contains=@mnvContinue,@mnvSpecialVar,mnvVar
syn match	mnvLetVar	 contained	"\<\%([bwglstav]:\)\=\h[a-zA-Z0-9#_]*\>\ze\%(\[.*]\)\=\s*=<<"	skipwhite nextgroup=mnvLetVarSubscript,mnvLetHeredoc	contains=mnvVarScope,mnvSubscript
hi link mnvLetVar mnvVar
syn region	mnvLetVarSubscript contained
      \ matchgroup=mnvSubscriptBracket
      \ start="\S\@1<=\["
      \ end="]"
      \ skipwhite nextgroup=mnvLetVarSubscript,mnvLetHeredoc
      \ contains=@mnvExprList

syn keyword	mnvUnlet		unl[et]	skipwhite nextgroup=mnvUnletBang,mnvUnletVars
syn match	mnvUnletBang	contained	"\a\@1<=!"	skipwhite nextgroup=mnvUnletVars
syn region	mnvUnletVars	contained
      \ start="$\I\|\h" skip=+\n\s*\%(\\\|["#]\\ \)\|^\s*["#]\\ + end="$" end=+\ze\s*[|"#]+
      \ skipwhite nextgroup=mnvCmdSep,mnvComment,mnv9Comment
      \ contains=@mnvContinue,mnvEnvvar,mnvVar,mnvMNVVar

" TODO: type error after register or environment variables (strings)
MNVFoldh syn region mnvLetHeredoc	contained
      \ matchgroup=mnvLetHeredocStart
      \ start="\%(^\z(\s*\)\S.*\)\@<==<<\s*trim\%(\s\+\)\@>\z(\L\S*\)"
      \ matchgroup=mnvLetHeredocStop
      \ end="^\z1\=\z2$"
      \ extend
MNVFoldh syn region mnvLetHeredoc	contained
      \ matchgroup=mnvLetHeredocStart
      \ start="=<<\%(\s*\)\@>\z(\L\S*\)"
      \ matchgroup=mnvLetHeredocStop end="^\z1$"
      \ extend
MNVFoldh syn region mnvLetHeredoc	contained
      \ matchgroup=mnvLetHeredocStart
      \ start="\%(^\z(\s*\)\S.*\)\@<==<<\s*\%(trim\s\+eval\|eval\s\+trim\)\%(\s\+\)\@>\z(\L\S*\)"
      \ matchgroup=mnvLetHeredocStop
      \ end="^\z1\=\z2$"
      \ contains=@mnvStringInterpolation
      \ extend
MNVFoldh syn region mnvLetHeredoc	contained
      \ matchgroup=mnvLetHeredocStart
      \ start="=<<\s*eval\%(\s\+\)\@>\z(\L\S*\)"
      \ matchgroup=mnvLetHeredocStop
      \ end="^\z1$"
      \ contains=@mnvStringInterpolation
      \ extend

MNV9 syn keyword	mnv9Const	const	skipwhite nextgroup=mnv9Variable,mnv9VariableList
MNV9 syn keyword	mnv9Final	final	skipwhite nextgroup=mnv9Variable,mnv9VariableList
MNV9 syn keyword	mnv9Var	var	skipwhite nextgroup=mnv9Variable,mnv9VariableList

syn match	mnv9Variable	contained	"\<\h\w*\>"	skipwhite nextgroup=mnv9VariableTypeSep,mnvLetHeredoc,mnvOper
syn region	mnv9VariableList	contained	start="\[" end="]" contains=@mnvContinue,@mnvSpecialVar,mnv9Variable skipwhite nextgroup=mnvLetHeredoc

syn match	mnv9VariableTypeSep	contained	"\S\@1<=:\%(\s\|\n\)\@="		skipwhite nextgroup=@mnv9VariableType
syn keyword	mnv9VariableType		contained	blob bool channel float job number string void	skipwhite nextgroup=mnvLetHeredoc
syn keyword	mnv9VariableTypeAny	contained	any			skipwhite nextgroup=mnvLetHeredoc
syn match	mnv9VariableTypeObject	contained	"\<object<\@="			          nextgroup=mnv9VariableTypeObjectArgs
syn region	mnv9VariableTypeObjectArgs
      \ matchgroup=mnv9VariableTypeObjectBracket
      \ start="<"
      \ end=">"
      \ contains=mnvTypeAny,mnvTypeObject,mnvUserType
      \ oneline
      \ transparent
syn match	mnv9VariableType		contained	"\<\%(func\)\>"			skipwhite nextgroup=mnvLetHeredoc
syn region	mnv9VariableCompoundType	contained
      \ matchgroup=mnv9VariableType
      \ start="\<func("
      \ end=")"
      \ skipwhite nextgroup=mnv9VariableTypeSep,mnvLetHeredoc
      \ contains=@mnv9Continue,@mnv9VariableType
      \ transparent
syn region	mnv9VariableCompoundType	contained
      \ matchgroup=mnv9VariableType
      \ start="\<tuple<"
      \ end=">"
      \ skipwhite nextgroup=mnvLetHeredoc
      \ contains=@mnv9Continue,@mnv9VariableType
      \ transparent
syn region	mnv9VariableCompoundType	contained
      \ matchgroup=mnv9VariableType
      \ start="\<\%(list\|dict\)<"
      \ end=">"
      \ skipwhite nextgroup=mnvLetHeredoc
      \ contains=@mnv9VariableType
      \ oneline
      \ transparent
syn match	mnv9VariableUserType	contained	"\<\%(\h\w*\.\)*\u\w*\>"	skipwhite nextgroup=mnvLetHeredoc

syn cluster mnv9VariableType contains=mnv9VariableType,mnv9VariableTypeAny,mnv9VariableTypeObject,mnv9VariableCompoundType,mnv9VariableUserType

" Lockvar and Unlockvar: {{{2
" =====================
syn keyword	mnvLockvar	lockv[ar]	skipwhite nextgroup=mnvLockvarBang,mnvLockvarDepth,mnvLockvarVars
syn keyword	mnvUnlockvar	unlo[ckvar]	skipwhite nextgroup=mnvLockvarBang,mnvLockvarDepth,mnvLockvarVars
syn match	mnvLockvarBang	contained	"\a\@1<=!"	skipwhite nextgroup=mnvLockvarVars
syn match	mnvLockvarDepth	contained	"\<[0-3]\>"	skipwhite nextgroup=mnvLockvarVars
syn region	mnvLockvarVars	contained
      \ start="\h" skip=+\n\s*\%(\\\|"\\ \)\|^\s*"\\ + end="$" end="\ze[|"]"
      \ nextgroup=mnvCmdSep,mnvComment
      \ contains=@mnvContinue,mnvVar

hi def link mnvLockvar mnvCommand
hi def link mnvUnlockvar mnvCommand
hi def link mnvLockvarBang mnvBang
hi def link mnvLockvarDepth mnvNumber

" For: {{{2
" ===
" handles MNV9 and legacy for now
syn region	mnvFor
      \ matchgroup=mnvCommand
      \ start="\<for\>" end="\<in\>"
      \ skipwhite skipnl nextgroup=@mnvForInContinue,mnv9ForInComment,@mnvExprList
      \ contains=@mnvContinue,mnvVar,mnvVarList,mnv9Variable,mnv9VariableList
      \ transparent

syn match	mnv9ForInComment		contained	"#.*"	skipwhite skipempty nextgroup=mnvForInComment,@mnvExprList

syn match	mnvForInContinue		contained	"^\s*\zs\\"	 skipwhite skipnl nextgroup=@mnvForInContinue,@mnvExprList
syn match         mnvForInContinueComment	contained	'^\s*\zs["#]\\ .*' skipwhite skipnl nextgroup=@mnvForInContinue,@mnvExprList
syn cluster	mnvForInContinue		contains=mnvForInContinue,mnvForInContinueComment

" Abbreviations: {{{2
" =============
" GEN_SYN_MNV: mnvCommand abbrev, START_STR='syn keyword mnvAbb', END_STR='skipwhite nextgroup=mnvMapMod,mnvMapLhs'
syn keyword mnvAbb ab[breviate] ca[bbrev] cnorea[bbrev] cuna[bbrev] ia[bbrev] inorea[bbrev] iuna[bbrev] norea[bbrev] una[bbreviate] skipwhite nextgroup=mnvMapMod,mnvMapLhs
" GEN_SYN_MNV: mnvCommand abclear, START_STR='syn keyword mnvAbb', END_STR='skipwhite nextgroup=mnvMapMod'
syn keyword mnvAbb abc[lear] cabc[lear] iabc[lear] skipwhite nextgroup=mnvMapMod

" Filename Patterns: {{{2
" =================

syn match	mnvWildcardQuestion	contained	"?"
syn match	mnvWildcardStar		contained	"*"

syn match	mnvWildcardBraceComma	contained	","
syn region	mnvWildcardBrace		contained
      \ matchgroup=mnvWildcard
      \ start="{"
      \ end="}"
      \ contains=mnvWildcardEscape,mnvWildcardBrace,mnvWildcardBraceComma,mnvWildcardQuestion,mnvWildcardStar,mnvWildcardBracket
      \ oneline

syn match	mnvWildcardIntervalNumber	contained	"\d\+"
syn match	mnvWildcardInterval	contained	"\\\\\\{\d\+\%(,\d\+\)\=\\}" contains=mnvWildcardIntervalNumber


syn match	mnvWildcardBracket	contained	"\[\%(\^\=]\=\%(\\.\|\[\([:.=]\)[^:.=]\+\1]\|[^][:space:]]\)*\)\@>]"
      \ contains=mnvWildcardBracketStart,mnvWildcardEscape

syn match	mnvWildcardBracketCharacter	contained	"."	nextgroup=@mnvWildcardBracketCharacter,mnvWildcardBracketHyphen,mnvWildcardBracketEnd
syn match	mnvWildcardBracketRightBracket	contained	"]"	nextgroup=@mnvWildcardBracketCharacter,mnvWildcardBracketEnd
syn match	mnvWildcardBracketHyphen	contained	"-]\@!"	nextgroup=@mnvWildcardBracketCharacter
syn match	mnvWildcardBracketEscape	contained	"\\."	nextgroup=@mnvWildcardBracketCharacter,mnvWildcardBracketHyphen,mnvWildcardBracketEnd
syn match	mnvWildcardBracketCharacterClass	contained	"\[:[^:]\+:]"	nextgroup=@mnvWildcardBracketCharacter,mnvWildcardBracketEnd
syn match	mnvWildcardBracketEquivalenceClass	contained	"\[=[^=]\+=]"	nextgroup=@mnvWildcardBracketCharacter,mnvWildcardBracketEnd
syn match	mnvWildcardBracketCollatingSymbol	contained	"\[\.[^.]\+\.]"	nextgroup=@mnvWildcardBracketCharacter,mnvWildcardBracketEnd

syn match	mnvWildcardBracketStart	contained	"\["	nextgroup=mnvWildcardBracketCaret,mnvWildcardBracketRightBracket,@mnvWildcardBracketCharacter
syn match	mnvWildcardBracketCaret	contained	"\^"	nextgroup=@mnvWildcardBracketCharacter,mnvWildcardBracketRightBracket
syn match	mnvWildcardBracketEnd	contained	"]"

syn cluster	mnvWildcardBracketCharacter	contains=mnvWildcardBracketCharacter,mnvWildcardBracketEscape,mnvWildcardBracketCharacterClass,mnvWildcardBracketEquivalenceClass,mnvWildcardBracketCollatingSymbol

syn match	mnvWildcardEscape	contained	"\\."

syn cluster	mnvWildcard		contains=mnvWildcardQuestion,mnvWildcardStar,mnvWildcardBrace,mnvWildcardBracket,mnvWildcardInterval

" Autocmd and Doauto{cmd,all}: {{{2
" ===========================

" TODO: explicitly match the {cmd} arg rather than bailing out to TOP
syn region	mnvAutocmdBlock	contained	matchgroup=mnvSep start="{" end="^\s*\zs}" contains=@mnvDefBodyList

syn match	mnvAutocmdGroup	contained	"\%(\\["|[:space:]]\|[^"|[:space:]]\)\+" skipwhite nextgroup=mnvAutoEvent,mnvAutoEventGlob
syn match	mnvAutocmdBang	contained	"\a\@1<=!"		     skipwhite nextgroup=mnvAutocmdGroup,mnvAutoEvent,mnvAutoEventGlob

" TODO: cleaner handling of | in pattern position
"     : match pattern items in addition to wildcards
syn region	mnvAutocmdPattern	contained
      \ start="|\@!\S"
      \ skip="\\\\\|\\[,[:space:]]"
      \ end="\ze[,[:space:]]"
      \ end="$"
      \ skipwhite nextgroup=mnvAutocmdPatternSep,mnvAutocmdMod,mnvAutocmdBlock,@mnvFunc
      \ contains=mnvEnvvar,@mnvWildcard,mnvAutocmdPatternEscape
syn match	mnvAutocmdBufferPattern	contained	"<buffer\%(=\%(\d\+\|abuf\)\)\=>" skipwhite nextgroup=mnvAutocmdPatternSep,mnvAutocmdMod,mnvAutocmdBlock,@mnvFunc
" trailing pattern separator comma allowed
syn match	mnvAutocmdPatternSep	contained	","	                skipwhite nextgroup=@mnvAutocmdPattern,mnvAutocmdMod,mnvAutocmdBlock
syn match	mnvAutocmdPatternEscape	contained	"\\."
syn cluster	mnvAutocmdPattern		contains=mnvAutocmdPattern,mnvAutocmdBufferPattern

" TODO: MNV9 requires '++' prefix
syn match	mnvAutocmdMod	contained	"\%(++\)\=\<nested\>" skipwhite nextgroup=mnvAutocmdMod,mnvAutocmdBlock
syn match	mnvAutocmdMod	contained	"++once\>"	skipwhite nextgroup=mnvAutocmdMod,mnvAutocmdBlock

" higher priority than mnvAutocmdGroup, assume no group is so named
syn match	mnvAutoEventGlob	contained	"*"	skipwhite nextgroup=@mnvAutocmdPattern
syn match	mnvAutoEventSep	contained	"\a\@1<=,"	nextgroup=mnvAutoEvent
syn match	mnvUserAutoEventSep contained	"\a\@1<=,"	nextgroup=mnvUserAutoEvent

syn match	mnvAutocmd		"\<au\%[tocmd]\>"	skipwhite nextgroup=mnvAutocmdBang,mnvAutocmdGroup,mnvAutoEvent,mnvAutoEventGlob


syn match	mnvDoautocmdMod	contained	"<nomodeline>"		skipwhite nextgroup=mnvAutocmdGroup,mnvAutoEvent
syn match	mnvDoautocmd		"\<do\%[autocmd]\>"	skipwhite nextgroup=mnvDoautocmdMod,mnvAutocmdGroup,mnvAutoEvent
syn match	mnvDoautocmd		"\<doautoa\%[ll]\>"	skipwhite nextgroup=mnvDoautocmdMod,mnvAutocmdGroup,mnvAutoEvent

" Echo And Execute: -- prefer strings! {{{2
" ================
" NOTE: No trailing comments

syn region	mnvEcho
      \ matchgroup=mnvCommand
      \ start="\<ec\%[ho]\>"
      \ start="\<echoe\%[rr]\>"
      \ start="\<echom\%[sg]\>"
      \ start="\<echoc\%[onsole]\>"
      \ start="\<echon\>"
      \ start="\<echow\%[indow]\>"
      \ skip=+\\|\|||\|\n\s*\%(\\\|["#]\\ \)+
      \ end="\ze|"
      \ excludenl end="$"
      \ nextgroup=mnvCmdSep
      \ contains=@mnvContinue,@mnvExprList,mnv9Comment
      \ transparent

syn match	mnvEchohl	"\<echohl\=\>"	skipwhite nextgroup=mnvGroup,mnvHLGroup,mnvEchohlNone
syn case ignore
syn keyword	mnvEchohlNone	contained none
syn case match

syn cluster	mnvEcho	contains=mnvEcho,mnvEchohl

syn region	mnvExecute
      \ matchgroup=mnvCommand
      \ start="\<exe\%[cute]\>"
      \ skip=+\\|\|||\|\n\s*\%(\\\|["#]\\ \)+
      \ end="\ze|"
      \ excludenl end="$"
      \ nextgroup=mnvCmdSep
      \ contains=@mnvContinue,@mnvExprList,mnv9Comment
      \ transparent

syn region	mnvEval
      \ matchgroup=mnvCommand
      \ start="\<ev\%[al]\>"
      \ skip=+\\|\|||\|\n\s*\%(\\\|["#]\\ \)+
      \ end="\ze|"
      \ excludenl end="$"
      \ nextgroup=mnvCmdSep
      \ contains=@mnvContinue,@mnvExprList,mnv9Comment,mnvComment
      \ transparent

" Filter: {{{2
" ======
syn match	mnvExFilter		"\<filt\%[er]\>"	skipwhite nextgroup=mnvExFilterBang,mnvExFilterPattern
syn region	mnvExFilterPattern contained
      \ start="[[:ident:]]"
      \ end="\ze[[:space:]\n]"
      \ skipwhite nextgroup=@mnvCmdList
      \ contains=@mnvSubstList
      \ oneline
syn region	mnvExFilterPattern contained
      \ matchgroup=Delimiter
      \ start="\z([^[:space:][:ident:]|"]\)"
      \ skip="\\\\\|\\\z1"
      \ end="\z1"
      \ skipwhite nextgroup=@mnvCmdList
      \ contains=@mnvSubstList
      \ oneline
syn match	mnvExFilterBang	 contained	"\a\@1<=!"	skipwhite nextgroup=mnvExFilterPattern

" Grep and Make: {{{2
" =============
" | is the command separator, escaped with \| all other backslashes are passed through literally, no tail comments
syn match	mnvGrep		"\<l\=gr\%[ep]\>"		skipwhite nextgroup=mnvGrepBang,mnvGrepArgs,mnvCmdSep
syn match	mnvGrepadd		"\<l\=grepa\%[dd]\>"	skipwhite nextgroup=mnvGrepBang,mnvGrepArgs,mnvCmdSep
syn region	mnvGrepArgs	contained
      \ start="|\@!\S"
      \ skip=+\n\s*\%(\\\|[#"]\\ \)+
      \ matchgroup=mnvCmdSep
      \ end="|"
      \ end="$"
      "\ TODO: include mnvSpecFile
      \ contains=mnvGrepBarEscape
syn match	mnvGrepBarEscape	contained	"\\|"
syn match	mnvGrepBang	contained	"\a\@1<=!"		skipwhite nextgroup=mnvGrepArgs,mnvCmdSep

syn match	mnvMake		"\<l\=make\=\>"		skipwhite nextgroup=mnvMakeBang,mnvMakeArgs,mnvCmdSep
syn region	mnvMakeArgs	contained
      \ start="|\@!\S"
      \ skip=+\n\s*\%(\\\|[#"]\\ \)+
      \ matchgroup=mnvCmdSep
      \ end="|"
      \ end="$"
      "\ TODO: include mnvSpecFile
      \ contains=mnvMakeBarEscape
syn match	mnvMakeBarEscape	contained	"\\|"
syn match	mnvMakeBang	contained	"\a\@1<=!"		skipwhite nextgroup=mnvMakeArgs,mnvCmdSep

" Help*: {{{2
" =====
syn match	mnvHelp	"\<h\%[elp]\>"	skipwhite nextgroup=mnvHelpBang,mnvHelpArg,mnvHelpNextCommand
" TODO: match wildcards, ignoring exceptions?
syn region	mnvHelpArg	contained
      \ start="\S"
      \ matchgroup=Special
      \ end="\%(@\a\a\)\=\ze\s*\%($\|\%x0d\|\%x00\||[^|]\)"
      \ oneline
syn match	mnvHelpNextCommand	contained	"\ze|[^|]"	skipwhite nextgroup=mnvCmdSep
syn match	mnvHelpBang		contained	"\a\@1<=!"	skipwhite nextgroup=mnvHelpArg,mnvHelpNextCommand

syn match	mnvHelpgrep		"\<l\=helpg\%[rep]\>"	skipwhite nextgroup=mnvHelpgrepBang,mnvHelpgrepPattern
syn region	mnvHelpgrepPattern	contained
      \ start="\S"
      \ matchgroup=Special
      \ end="@\a\a\>"
      \ end="$"
      \ contains=@mnvSubstList
      \ oneline

" MNVgrep: {{{2
" =======
syn match	mnvMNVgrep		"\<l\=mnv\%[grep]\>"	skipwhite nextgroup=mnvMNVgrepBang,mnvMNVgrepPattern
syn match	mnvMNVgrepadd		"\<l\=mnvgrepa\%[dd]\>"	skipwhite nextgroup=mnvMNVgrepBang,mnvMNVgrepPattern
syn match	mnvMNVgrepBang	  contained	"\a\@1<=!"		skipwhite nextgroup=mnvMNVgrepPattern
syn region	mnvMNVgrepPattern   contained
      \ start="[[:ident:]]"
      \ end="\ze[[:space:]\n]"
      \ skipwhite nextgroup=mnvMNVgrepFile,mnvCmdSep
      \ contains=@mnvSubstList
      \ oneline
syn region	mnvMNVgrepPattern   contained
      \ matchgroup=Delimiter
      \ start="\z([^[:space:][:ident:]|"]\)"
      \ skip="\\\\\|\\\z1"
      \ end="\z1"
      \ skipwhite nextgroup=mnvMNVgrepFlags,mnvMNVgrepFile,mnvCmdSep
      \ contains=@mnvSubstList
      \ oneline
syn match	mnvMNVgrepEscape	  contained	"\\\%(\\|\|.\)"
syn match	mnvMNVgrepBarEscape contained	"\\|"
syn region	mnvMNVgrepFile	  contained
      \ start="|\@!\S"
      \ matchgroup=mnvCmdSep
      \ end="|"
      \ end="\ze\s"
      \ end="$"
      \ skipwhite nextgroup=mnvMNVgrepFile
      \ contains=mnvSpecFile,mnvMNVgrepEscape,mnvMNVgrepBarEscape
syn match	mnvMNVgrepFlags	  contained	"\<[gjf]\{,3\}\>" skipwhite nextgroup=mnvMNVgrepfile

" Maps: {{{2
" ====
" GEN_SYN_MNV: mnvCommand map, START_STR='syn keyword mnvMap', END_STR='skipwhite nextgroup=mnvMapMod,mnvMapLhs'
syn keyword mnvMap cm[ap] cno[remap] im[ap] ino[remap] lm[ap] ln[oremap] nm[ap] nn[oremap] om[ap] ono[remap] smap snor[emap] tma[p] tno[remap] vm[ap] vn[oremap] xm[ap] xn[oremap] skipwhite nextgroup=mnvMapMod,mnvMapLhs
syn match	mnvMap	"\<map\>"	skipwhite nextgroup=mnvMapBang,mnvMapMod,mnvMapLhs
syn keyword	mnvMap	no[remap]	skipwhite nextgroup=mnvMapBang,mnvMapMod,mnvMapLhs
" GEN_SYN_MNV: mnvCommand mapclear, START_STR='syn keyword mnvMap', END_STR='skipwhite nextgroup=mnvMapMod'
syn keyword mnvMap cmapc[lear] imapc[lear] lmapc[lear] nmapc[lear] omapc[lear] smapc[lear] tmapc[lear] vmapc[lear] xmapc[lear] skipwhite nextgroup=mnvMapMod
syn keyword	mnvMap	mapc[lear]	skipwhite nextgroup=mnvMapBang,mnvMapMod
" GEN_SYN_MNV: mnvCommand unmap, START_STR='syn keyword mnvUnmap', END_STR='skipwhite nextgroup=mnvMapMod,mnvMapLhs'
syn keyword mnvUnmap cu[nmap] iu[nmap] lu[nmap] nun[map] ou[nmap] sunm[ap] tunma[p] vu[nmap] xu[nmap] skipwhite nextgroup=mnvMapMod,mnvMapLhs
syn keyword	mnvUnmap	unm[ap]	skipwhite nextgroup=mnvMapBang,mnvMapMod,mnvMapLhs

syn match	mnvMapLhs	contained	"\%(.\|\S\)\+"		contains=mnvCtrlChar,mnvNotation,mnvMapLeader skipwhite        nextgroup=mnvMapRhs
syn match	mnvMapLhs	contained	"\%(.\|\S\)\+\ze\s*$"	contains=mnvCtrlChar,mnvNotation,mnvMapLeader skipwhite skipnl nextgroup=mnvMapRhsContinue
syn match	mnvMapBang	contained	"\a\@1<=!"		skipwhite nextgroup=mnvMapMod,mnvMapLhs
syn match	mnvMapMod	contained	"\%#=1<\%(buffer\|expr\|nowait\|script\|silent\|special\|unique\)\+>" contains=mnvMapModKey,mnvMapModErr skipwhite nextgroup=mnvMapMod,mnvMapLhs
syn region	mnvMapRhs	contained
      \ start="\S"
      \ skip=+\\|\|\@1<=|\|\n\s*\%(\\\|["#]\\ \)+
      \ end="\ze|"
      \ end="$"
      \ nextgroup=mnvCmdSep
      \ contains=@mnvContinue,mnvCtrlChar,mnvNotation,mnvMapLeader
syn region	mnvMapRhsContinue	contained
      \ start=+^\s*\%(\\\|["#]\\ \)+
      \ skip=+\\|\|\@1<=|\|\n\s*\%(\\\|["#]\\ \)+
      \ end="\ze|"
      \ end="$"
      \ nextgroup=mnvCmdSep
      \ contains=@mnvContinue,mnvCtrlChar,mnvNotation,mnvMapLeader
syn match	mnvMapLeader	contained	"\%#=1\c<\%(local\)\=leader>"	contains=mnvMapLeaderKey
syn keyword	mnvMapModKey	contained	buffer expr nowait script silent special unique
syn case ignore
syn keyword	mnvMapLeaderKey	contained	leader localleader
syn case match

" Menus: {{{2
" =====
" NOTE: tail comments disallowed
" GEN_SYN_MNV: mnvCommand menu, START_STR='syn keyword mnvMenu', END_STR='skipwhite nextgroup=mnvMenuBang,mnvMenuMod,mnvMenuName,mnvMenuPriority,mnvMenuStatus'
syn keyword mnvMenu am[enu] an[oremenu] aun[menu] cme[nu] cnoreme[nu] cunme[nu] ime[nu] inoreme[nu] iunme[nu] me[nu] nme[nu] nnoreme[nu] noreme[nu] nunme[nu] ome[nu] onoreme[nu] ounme[nu] sme[nu] snoreme[nu] sunme[nu] tlm[enu] tln[oremenu] tlu[nmenu] tm[enu] tu[nmenu] unme[nu] vme[nu] vnoreme[nu] vunme[nu] xme[nu] xnoreme[nu] xunme[nu] skipwhite nextgroup=mnvMenuBang,mnvMenuMod,mnvMenuName,mnvMenuPriority,mnvMenuStatus
syn keyword mnvMenu popu[p] skipwhite nextgroup=mnvMenuBang,mnvMenuName
syn region	mnvMenuRhs	 contained contains=@mnvContinue,mnvNotation start="|\@!\S"            skip=+\\\\\|\\|\|\n\s*\%(\\\|"\\ \)+ end="$" matchgroup=mnvSep end="|"
syn region	mnvMenuRhsContinue contained contains=@mnvContinue,mnvNotation start=+^\s*\%(\\\|"\\ \)+ skip=+\\\\\|\\|\|\n\s*\%(\\\|"\\ \)+ end="$" matchgroup=mnvSep end="|"
syn match	mnvMenuName	"\.\@!\%(\\\s\|\S\)\+"        contained contains=mnvMenuNotation,mnvNotation skipwhite        nextgroup=mnvCmdSep,mnvMenuRhs
syn match	mnvMenuName	"\.\@!\%(\\\s\|\S\)\+\ze\s*$" contained contains=mnvMenuNotation,mnvNotation skipwhite skipnl nextgroup=mnvCmdSep,mnvMenuRhsContinue
syn match	mnvMenuNotation	"&\a\|&&\|\\\s\|\\\." contained
syn match	mnvMenuPriority	"\<\d\+\%(\.\d\+\)*\>" contained skipwhite nextgroup=mnvMenuName
syn match	mnvMenuMod	"\c<\%(script\|silent\|special\)>" contained skipwhite nextgroup=mnvMenuName,mnvMenuPriority,mnvMenuMod contains=mnvMapModKey,mnvMapModErr
syn keyword	mnvMenuStatus	enable disable nextgroup=mnvMenuName skipwhite
syn match	mnvMenuBang	"\a\@1<=!" contained skipwhite nextgroup=mnvMenuName,mnvMenuMod

syn region	mnvMenutranslate
      \ matchgroup=mnvCommand start="\<menut\%[ranslate]\>"
      \ skip=+\\\\\|\\|\|\n\s*\%(\\\|"\\ \)+
      \ end="$" matchgroup=mnvCmdSep end="|" matchgroup=mnvMenuClear end="\<clear\ze\s*\%(["#|]\|$\)"
      \ contains=@mnvContinue,mnvMenutranslateName keepend transparent
" oneline is sufficient to match the current formatting in runtime/lang/*.mnv
syn match	mnvMenutranslateName "\%(\\\s\|\S\)\+" contained contains=mnvMenuNotation,mnvNotation
syn match	mnvMenutranslateComment +".*+ contained containedin=mnvMenutranslate

" If, While and Return: {{{2
" ====================
syn match	mnvNotFunc	"\%#=1\<\%(if\|el\%[seif]\|retu\%[rn]\|while\)\>"	skipwhite nextgroup=@mnvExprList,mnvNotation
syn match	mnvElse	"\<el\%[se]\>"			skipwhite nextgroup=mnvComment,mnv9Comment
syn match	mnvEndif	"\<en\%[dif]\>"			skipwhite nextgroup=mnvComment,mnv9Comment

" Angle-Bracket Notation: (tnx to Michael Geddes) {{{2
" ======================
syn case ignore
syn match	mnvNotation	contained	"\%#=1\%(\\\|<lt>\)\=<\%([scamd]-\)\{0,4}x\=\%(f\d\{1,2}\|[^ \t:]\|space\|bar\|bslash\|nl\|newline\|lf\|linefeed\|cr\|retu\%[rn]\|enter\|k\=del\%[ete]\|bs\|backspace\|tab\|esc\|csi\|right\|paste\%(start\|end\)\|left\|help\|undo\|k\=insert\|ins\|mouse\|[kz]\=home\|[kz]\=end\|kplus\|kminus\|kdivide\|kmultiply\|kenter\|kpoint\|space\|k\=\%(page\)\=\%(\|down\|up\|k\d\>\)\)>" contains=mnvBracket

syn match	mnvNotation	contained	"\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}\%(net\|dec\|jsb\|pterm\|urxvt\|sgr\)mouse>"		contains=mnvBracket
syn match	mnvNotation	contained	"\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}\%(left\|middle\|right\)\%(mouse\|drag\|release\)>"	contains=mnvBracket
syn match	mnvNotation	contained	"\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}left\%(mouse\|release\)nm>"			contains=mnvBracket
syn match	mnvNotation	contained	"\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}x[12]\%(mouse\|drag\|release\)>"		contains=mnvBracket
syn match	mnvNotation	contained	"\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}sgrmouserelease>"			contains=mnvBracket
syn match	mnvNotation	contained	"\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}mouse\%(up\|down\|move\)>"			contains=mnvBracket
syn match	mnvNotation	contained	"\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}scrollwheel\%(up\|down\|right\|left\)>"		contains=mnvBracket

syn match	mnvNotation	contained	"\%#=1\%(\\\|<lt>\)\=<\%(sid\|nop\|nul\|lt\|drop\)>"				contains=mnvBracket
syn match	mnvNotation	contained	"\%#=1\%(\\\|<lt>\)\=<\%(snr\|plug\|cursorhold\|ignore\|cmd\|scriptcmd\|focus\%(gained\|lost\)\)>"	contains=mnvBracket
" syn match	mnvNotation	contained	'\%(\\\|<lt>\)\=<C-R>[0-9a-z"%#:.\-=]'he=e-1				contains=mnvBracket
syn match	mnvNotation	contained	'\%#=1\%(\\\|<lt>\)\=<\%([fq]-\)\=\%(line[12]\|count\|bang\|reg\|args\|mods\|lt\)>'		contains=mnvBracket skipwhite nextgroup=mnvSubst1
syn match	mnvNotation	contained	"\%#=1\%(\\\|<lt>\)\=<\%([cas]file\|abuf\|amatch\|cexpr\|cword\|cWORD\|client\|stack\|script\|sf\=lnum\)>"	contains=mnvBracket
syn match	mnvNotation	contained	"\%#=1\%(\\\|<lt>\)\=<\%([scamd]-\)\{0,4}char-\%(\d\+\|0\o\+\|0x\x\+\)>"		contains=mnvBracket

syn match	mnvBracket contained	"[\\<>]"
syn case match

" User Command Highlighting: {{{2
syn match mnvUsrCmd	'^\s*\zs\u\%(\w*\)\@>\%([<.(#[]\|\s\+\%([-+*/%]\=\|\.\.\)=\)\@!'

" MNV user commands

" Compiler plugins
syn match	mnvCompilerSet	"\<CompilerSet\>"	skipwhite nextgroup=mnvSetArgs

" runtime/makemenu.mnv
syn match	mnvSynMenu		"\<SynMenu\>"	skipwhite nextgroup=mnvSynMenuPath
syn match	mnvSynMenuPath	contained	".*\ze:"	nextgroup=mnvSynMenuColon contains=mnvMenuNotation
syn match	mnvSynMenuColon	contained	":"	nextgroup=mnvSynMenuName
syn match	mnvSynMenuName	contained	"\w\+"

" runtime/syntax/syncolor.mnv
syn match	mnvSynColor		"\<SynColor\>"	skipwhite nextgroup=mnvSynColorGroup
syn match	mnvSynColorGroup	contained	"\<\h\w*\>"	skipwhite nextgroup=mnvHiKeyList	contains=mnvGroup
syn match	mnvSynLink		"\<SynLink\>"	skipwhite nextgroup=mnvSynLinkGroup
syn match	mnvSynLinkGroup	contained	"\<\h\w*\>"	skipwhite nextgroup=mnvGroup	contains=mnvGroup

syn cluster mnvExUserCmdList contains=mnvCompilerSet,mnvSynColor,mnvSynLink,mnvSynMenu

" Errors And Warnings: {{{2
" ====================
if !exists("g:mnvsyn_noerror") && !exists("g:mnvsyn_nomnvfunctionerror")
 syn match	mnvFunctionError	contained	"[[:space:]!]\@1<=\<[a-z0-9]\w\{-}\ze\s*("
 syn match	mnvFunctionError	contained	"\%(<[sS][iI][dD]>\|[sg]:\)\d\w\{-}\ze\s*("
 syn match	mnvElseIfErr	"\<else\s\+if\>"
 syn match	mnvBufnrWarn	/\<bufnr\s*(\s*["']\.['"]\s*)/
endif

" Match: {{{2
" =====
syn match	mnvMatch		"\<\%([1-3]\s*\)\=mat\%[ch]\>"	skipwhite nextgroup=mnvMatchGroup,mnvMatchNone contains=mnvCount
syn match	mnvMatchGroup	contained	"[[:alnum:]._-]\+"	skipwhite nextgroup=mnvMatchPattern
syn case ignore
syn keyword	mnvMatchNone	contained	none
syn case match
syn region	mnvMatchPattern	contained
      \ matchgroup=Delimiter
      \ start="\z([!#$%&'()*+,-./:;<=>?@[\]^_`{}~]\)"
      \ skip="\\\\\|\\\z1"
      \ end="\z1"
      \ contains=@mnvSubstList
      \ oneline

" Normal: {{{2
" ======
syn match	mnvNormal		"\<norm\%[al]\>!\=" skipwhite nextgroup=mnvNormalArg contains=mnvBang
syn region	mnvNormalArg	contained	start="\S" skip=+\n\s*\%(\\\|["#]\\ \)+ end="$" contains=@mnvContinue

" Profile: {{{2
" =======
syn match	mnvProfileBang	 contained	"\a\@1<=!"	skipwhite nextgroup=mnvProfileArg
syn keyword	mnvProfileArg	 contained	start	skipwhite nextgroup=mnvProfilePattern
syn keyword	mnvProfileArg	 contained	func	skipwhite nextgroup=mnvProfilePattern
syn keyword	mnvProfileArg	 contained	file	skipwhite nextgroup=mnvProfilePattern
syn keyword	mnvProfileArg	 contained	stop pause	skipwhite nextgroup=mnvCmdSep,@mnvComment
syn keyword	mnvProfileArg	 contained	continue dump	skipwhite nextgroup=mnvCmdSep,@mnvComment
" TODO: match file pattern
syn region	mnvProfilePattern contained
      \ start="\S"
      \ skip=+\\[|"#]+
      \ end="$" end=+\ze\s*[|"#]+
      \ skipwhite nextgroup=mnvCmdSep,mnvComment,mnv9Comment
syn match	mnvProfile	"\<prof\%[ile]\>"	skipwhite nextgroup=mnvProfileBang,mnvProfileArg

syn keyword	mnvProfdelArg	contained	func	skipwhite nextgroup=mnvProfilePattern
syn keyword	mnvProfdelArg	contained	file	skipwhite nextgroup=mnvProfilePattern
syn keyword	mnvProfdelArg	contained	here	skipwhite nextgroup=mnvCmdSep,@mnvComment
syn match	mnvProfdel	"\<profd\%[el]\>" skipwhite nextgroup=mnvProfdelArg

" Prompt{find,repl}: {{{2
" =================
syn region	mnvPromptArg	contained
      \ start="\S"
      \ skip=+\n\s*\%(\\\|["#]\\ \)+
      \ end="$"
      \ contains=@mnvContinue
syn keyword	mnvPrompt	promptf[ind] promptr[epl]	skipwhite nextgroup=mnvPromptArg

" Redir: {{{2
" =====
syn match	mnvRedir		"\<redir\=\>"	skipwhite nextgroup=mnvRedirBang,mnvRedirFileOperator,mnvRedirVariableOperator,mnvRedirRegister,mnvRedirEnd
syn match	mnvRedirBang	       contained	"\a\@1<=!"	skipwhite nextgroup=mnvRedirFileOperator

syn match	mnvRedirFileOperator     contained	">>\="	skipwhite nextgroup=mnvRedirFile
syn region	mnvRedirFile	       contained
      \ start="\S"
      \ matchgroup=Normal
      \ end="\s*$"
      \ end="\s*\ze[|"]"
      \ nextgroup=mnvCmdSep,mnvComment
      \ contains=mnvSpecFile
syn match	mnvRedirRegisterOperator contained	">>\="
syn match	mnvRedirRegister	       contained	"@[a-zA-Z*+"]"	nextgroup=mnvRedirRegisterOperator
syn match	mnvRedirVariableOperator contained	"=>>\="	skipwhite nextgroup=mnvVar
syn keyword	mnvRedirEnd	       contained	END

" Sleep: {{{2
" =====
syn keyword	mnvSleep		sl[eep]		skipwhite nextgroup=mnvSleepBang,mnvSleepArg
syn match	mnvSleepBang	contained	"\a\@1<=!"		skipwhite nextgroup=mnvSleepArg
syn match	mnvSleepArg	contained	"\<\%(\d\+\)\=m\=\>"

" Sort: {{{2
" ====
syn match	mnvSort		"\<sort\=\>"			skipwhite nextgroup=mnvSortBang,@mnvSortOptions,mnvSortPattern,mnvCmdSep
syn match	mnvSortBang	  contained	"\a\@1<=!"			skipwhite nextgroup=@mnvSortOptions,mnvSortPattern,mnvCmdSep
syn match	mnvSortOptionsError contained	"\a\+"
syn match	mnvSortOptions	  contained	"\<[ilur]*[nfxob]\=[ilur]*\>"		skipwhite nextgroup=mnvSortPattern,mnvCmdSep
syn region	mnvSortPattern	  contained
      \ matchgroup=Delimiter
      \ start="\z([^[:space:][:alpha:]|]\)"
      \ skip="\\\\\|\\\z1"
      \ end="\z1"
      \ skipwhite nextgroup=@mnvSortOptions,mnvCmdSep
      \ contains=@mnvSubstList
      \ oneline

syn cluster mnvSortOptions contains=mnvSortOptions,mnvSortOptionsError

" Terminal: {{{2
" ========
syn match	mnvTerminal	"\<ter\%[minal]\>"		skipwhite        nextgroup=mnvTerminalOptions,mnvTerminalCommand
syn match	mnvTerminal	+\<ter\%[minal]\>\ze\s*\n\s*\%(\\\|["#]\\ \)+	skipwhite skipnl nextgroup=mnvTerminalOptions,mnvTerminalCommand,@mnvTerminalContinue

syn match	mnvTerminalContinue	contained	"^\s*\\"       	skipwhite skipnl nextgroup=@mnvTerminalContinue,mnvTerminalOptions,mnvTerminalCommand contains=mnvWhitespace
syn match         mnvTerminalContinueComment	contained	'^\s*["#]\\ .*'	skipwhite skipnl nextgroup=@mnvTerminalContinue,mnvTerminalOptions,mnvTerminalCommand contains=mnvWhitespace
syn cluster	mnvTerminalContinue	contains=mnvTerminalContinue,mnvTerminalContinueComment

syn region	mnvTerminalCommand	contained
      \ start="\S"
      \ skip=+\n\s*\%(\\\|["#]\\ \)+
      \ end="$"
      \ contains=@mnvContinue

syn region	mnvTerminalOptions	contained
      \ start="++"
      \ skip=/\s\+++\|\%(\n\|^\)\s*\%(\\\|["#]\\ \)/
      \ end="\s"
      \ end="$"
      \ skipwhite nextgroup=mnvTerminalCommand
      \ contains=@mnvContinue,mnvTerminalOption
      \ transparent

syn match	mnvTerminalOption	contained	"++\%(\%(no\)\=close\|open\|curwin\|hidden\|norestore\|shell\)\>"
syn match	mnvTerminalOption	contained	"++kill="		nextgroup=mnvTerminalKillOptionArg
syn match	mnvTerminalOption	contained	"++\%(rows\|cols\)="	nextgroup=mnvTerminalSizeOptionArg
syn match	mnvTerminalOption	contained	"++eof="		nextgroup=mnvTerminalEofOptionArg
syn match	mnvTerminalOption	contained	"++type="		nextgroup=mnvTerminalTypeOptionArg
syn match	mnvTerminalOption	contained	"++api="		nextgroup=mnvTerminalApiOptionArg

syn match	mnvTerminalApiOptionArg	contained	"\<\S\+\>"
syn match	mnvTerminalEofOptionArg	contained	"\<\S\+\>"
syn match	mnvTerminalSizeOptionArg	contained	"\<\d\+\>"
syn keyword	mnvTerminalKillOptionArg	contained	term hup quit int kill
syn match	mnvTerminalKillOptionArg	contained	"\<\d\+\>"
syn keyword	mnvTerminalTypeOptionArg	contained	conpty winpty

" Uniq: {{{2
" ====
syn match	mnvUniq		"\<uniq\=\>"	skipwhite nextgroup=mnvUniqBang,@mnvUniqOptions,mnvUniqPattern,mnvCmdSep
syn match	mnvUniqBang	  contained	"\a\@1<=!"	skipwhite nextgroup=@mnvUniqOptions,mnvUniqPattern,mnvCmdSep
syn match	mnvUniqOptionsError contained	"\a\+"
syn match	mnvUniqOptions	  contained	"\<[ilur]*\>"	skipwhite nextgroup=mnvUniqPattern,mnvCmdSep
syn region	mnvUniqPattern	  contained
      \ matchgroup=Delimiter
      \ start="\z([^[:space:][:alpha:]|]\)"
      \ skip="\\\\\|\\\z1"
      \ end="\z1"
      \ skipwhite nextgroup=@mnvUniqOptions,mnvCmdSep
      \ contains=@mnvSubstList
      \ oneline

syn cluster mnvUniqOptions contains=mnvUniqOptions,mnvUniqOptionsError

" Wincmd: {{{2
" ======
syn match	mnvWincmd	"\<winc\%[md]\>"	skipwhite nextgroup=mnvWincmdArg
" TODO: consider extracting this list from the help file
syn match	mnvWincmdArg	contained
      \ "\<[sSvnqojkhlwWtbpPrRxKJHLTfFz]\>\|[\^:=\-+_<>|\]}]\|\<g\s\+[\]}]\|\<g[fFtT]\>"
      \ skipwhite nextgroup=mnvCmdSep,mnvComment,mnv9Comment

" only handles oneline assignments
MNV9 syn match	mnvWincmd	"\s\=\<winc\%[md]\>\ze\s\+=\s*\%([#|]\|$\)"	skipwhite nextgroup=mnvWincmdArg

" Syntax: {{{2
"=======
syn region	mnvGroupList	contained
      \ start="\S"
      \ skip=+\n\s*\%(\\\|["#]\\ \)+
      "\ need to consume the whitespace
      \ end="\s"he=e-1
      \ end="$"
      \ contains=@mnvGroupListContinue,mnvGroupSpecial,mnvGroupListContinueComma
syn keyword	mnvGroupSpecial	contained	ALL	ALLBUT	CONTAINED	TOP
syn match	mnvGroupListComma		contained	","
syn match	mnvGroupListContinueComma	contained	"\s\+,\s*\|,\s\+"	contains=mnvGroupListComma
syn match	mnvGroupListContinueComma	contained	"\s*,\s*\%(\n\s*\%(\\\s\+\|["#]\\ .*\)\)\+"	contains=@mnvGroupListContinue,mnvGroupListComma

syn match	mnvGroupListEquals	contained	"="		skipwhite skipnl nextgroup=mnvGroupListContinueStart,mnvGroupList
" the first continuation line does not terminate the list at whitepace after \
syn match	mnvGroupListContinueStart	contained	"^\%(\s*["#]\\ .*\n\)*\s*\\\s\+"	skipwhite        nextgroup=mnvGroupList contains=@mnvGroupListContinue transparent

syn match	mnvGroupListContinue	contained	"^\s*\\"	skipwhite skipnl nextgroup=@mnvGroupListContinue,mnvGroupListContinueComma contains=mnvWhitespace
syn match	mnvGroupListContinueComment	contained	'^\s*["#]\\ .*'	skipwhite skipnl nextgroup=@mnvGroupListContinue		   contains=mnvWhitespace
syn cluster	mnvGroupListContinue	contains=mnvGroupListContinue,mnvGroupListContinueComment

if !exists("g:mnvsyn_noerror") && !exists("g:mnvsyn_nomnvsynerror")
 syn match	mnvSynError		contained	"\i\+"
endif
syn match	mnvSynContains		contained	"\<contains\>"	skipwhite nextgroup=mnvGroupListEquals
syn match	mnvSynContainedin		contained	"\<containedin\>"	skipwhite nextgroup=mnvGroupListEquals
syn match	mnvSynNextgroup		contained	"\<nextgroup\>"	skipwhite nextgroup=mnvGroupListEquals
if has("conceal")
 " no whitespace allowed after '='
 syn match	mnvSynCchar	contained	"\<cchar="	nextgroup=mnvSynCcharValue
 syn match	mnvSynCcharValue	contained	"\S"
endif

syn match	mnvSyntax	"\<sy\%[ntax]\>"	contains=mnvCommand skipwhite nextgroup=mnvSynType,@mnvComment
syn cluster mnvFunctionBodyList add=mnvSyntax

" Syntax: case {{{2
syn keyword	mnvSynType	contained	case	skipwhite nextgroup=mnvSynCase,mnvSynCaseError
if !exists("g:mnvsyn_noerror") && !exists("g:mnvsyn_nomnvsyncaseerror")
 syn match	mnvSynCaseError	contained	"\i\+"
endif
syn keyword	mnvSynCase	contained	ignore	match

" Syntax: clear {{{2
syn keyword	mnvSynType	contained	clear

" Syntax: cluster {{{2
syn keyword	mnvSynType	contained	cluster	skipwhite nextgroup=mnvClusterName
syn region	mnvClusterName	contained keepend	matchgroup=mnvGroupName start="\h\w*\>" skip=+\\\\\|\\\|\n\s*\%(\\\|"\\ \)+ matchgroup=mnvCmdSep end="$\||" contains=@mnvContinue,mnvGroupAdd,mnvGroupRem,mnvSynContains,mnvSynError
syn match	mnvGroupAdd	contained	"\<add\>"	skipwhite nextgroup=mnvGroupListEquals
syn match	mnvGroupRem	contained	"\<remove\>"	skipwhite nextgroup=mnvGroupListEquals

" Syntax: conceal {{{2
syn match	mnvSynType	contained	"\<conceal\>"	skipwhite nextgroup=mnvSynConceal,mnvSynConcealError
if !exists("g:mnvsyn_noerror") && !exists("g:mnvsyn_nomnvsynconcealerror")
 syn match	mnvSynConcealError contained	"\i\+"
endif
syn keyword	mnvSynConceal	contained	on	off

" Syntax: foldlevel {{{2
syn keyword	mnvSynType	contained	foldlevel	skipwhite nextgroup=mnvSynFoldlevel,mnvSynFoldlevelError
if !exists("g:mnvsyn_noerror") && !exists("g:mnvsyn_nomnvsynfoldlevelerror")
 syn match	mnvSynFoldlevelError	contained	"\i\+"
endif
syn keyword	mnvSynFoldlevel	contained	start	minimum

" Syntax: iskeyword {{{2
syn keyword	mnvSynType		contained	iskeyword	skipwhite nextgroup=mnvSynIskeyword
syn keyword	mnvSynIskeyword		contained	clear
syn match	mnvSynIskeyword		contained	"\S\+"	contains=mnvSynIskeywordSep
syn match	mnvSynIskeywordSep	contained	","

" Syntax: include {{{2
syn keyword	mnvSynType		contained	include	skipwhite nextgroup=mnvSynIncludeCluster
syn match	mnvSynIncludeCluster	contained	"@[_a-zA-Z0-9]\+\>"

" Syntax: keyword {{{2
syn cluster	mnvSynKeyGroup	contains=@mnvContinue,mnvSynCchar,mnvSynNextgroup,mnvSynKeyOpt,mnvSynContainedin
syn keyword	mnvSynType	contained	keyword	skipwhite nextgroup=mnvSynKeyRegion
syn region	mnvSynKeyRegion	contained         keepend	matchgroup=mnvGroupName start="\h\w*\>" skip=+\\\\\|\\|\|\n\s*\%(\\\|"\\ \)+ matchgroup=mnvCmdSep end="|\|$" contains=@mnvSynKeyGroup
syn match	mnvSynKeyOpt	contained	"\%#=1\<\%(conceal\|contained\|transparent\|skipempty\|skipwhite\|skipnl\)\>"

" Syntax: match {{{2
syn cluster	mnvSynMtchGroup	contains=@mnvContinue,mnvSynCchar,mnvSynContains,mnvSynContainedin,mnvSynError,mnvSynMtchOpt,mnvSynNextgroup,mnvSynRegPat,mnvNotation,mnvMtchComment
syn keyword	mnvSynType	contained	match	skipwhite nextgroup=mnvSynMatchRegion
syn region	mnvSynMatchRegion	contained keepend	matchgroup=mnvGroupName start="\h\w*\>" skip=+\\\\\|\\|\|\n\s*\%(\\\|"\\ \)+ matchgroup=mnvCmdSep end="|\|$" contains=@mnvSynMtchGroup
syn match	mnvSynMtchOpt	contained	"\%#=1\<\%(conceal\|transparent\|contained\|excludenl\|keepend\|skipempty\|skipwhite\|display\|extend\|skipnl\|fold\)\>"

" Syntax: off and on {{{2
syn keyword	mnvSynType	contained	enable	list	manual	off	on	reset

" Syntax: region {{{2
syn cluster	mnvSynRegPatGroup	contains=@mnvContinue,mnvPatSep,mnvNotPatSep,mnvSynPatRange,mnvSynNotPatRange,mnvSubstSubstr,mnvPatRegion,mnvPatSepErr,mnvNotation
syn cluster	mnvSynRegGroup	contains=@mnvContinue,mnvSynCchar,mnvSynContains,mnvSynContainedin,mnvSynNextgroup,mnvSynRegOpt,mnvSynReg,mnvSynMtchGrp
syn keyword	mnvSynType	contained	region	skipwhite nextgroup=mnvSynRegion
syn region	mnvSynRegion	contained keepend	matchgroup=mnvGroupName start="\h\w*" skip=+\\\\\|\\|\|\n\s*\%(\\\|"\\ \)+ matchgroup=mnvCmdSep end="|\|$" contains=@mnvSynRegGroup
syn match	mnvSynRegOpt	contained	"\%#=1\<\%(conceal\%(ends\)\=\|transparent\|contained\|excludenl\|skipempty\|skipwhite\|display\|keepend\|oneline\|extend\|skipnl\|fold\)\>"
syn match	mnvSynReg	contained	"\<\%(start\|skip\|end\)="	nextgroup=mnvSynRegPat
syn match	mnvSynMtchGrp	contained	"matchgroup="	nextgroup=mnvGroup,mnvHLGroup
syn region	mnvSynRegPat	contained extend	start="\z([-`~!@#$%^&*_=+;:'",./?]\)"  skip=/\\\\\|\\\z1\|\n\s*\%(\\\|"\\ \)/  end="\z1"  contains=@mnvSynRegPatGroup skipwhite nextgroup=mnvSynPatMod,mnvSynReg
syn match	mnvSynPatMod	contained	"\%#=1\%(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\%([-+]\d\+\)\="
syn match	mnvSynPatMod	contained	"\%#=1\%(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\%([-+]\d\+\)\=," nextgroup=mnvSynPatMod
syn match	mnvSynPatMod	contained	"lc=\d\+"
syn match	mnvSynPatMod	contained	"lc=\d\+," nextgroup=mnvSynPatMod
syn region	mnvSynPatRange	contained	start="\["	skip="\\\\\|\\]"   end="]"
syn match	mnvSynNotPatRange	contained	"\\\\\|\\\["
syn match	mnvMtchComment	contained	'"[^"]\+$'

" Syntax: spell {{{2
syn keyword	mnvSynType	contained	spell	skipwhite nextgroup=mnvSynSpell,mnvSynSpellError
if !exists("g:mnvsyn_noerror") && !exists("g:mnvsyn_nomnvsynspellerror")
 syn match	mnvSynSpellError contained	"\i\+"
endif
syn keyword	mnvSynSpell	contained	default	notoplevel	toplevel

" Syntax: sync {{{2
" ============
syn keyword mnvSynType	contained	sync	skipwhite	nextgroup=mnvSyncClear,mnvSyncMatch,mnvSyncError,mnvSyncRegion,mnvSyncArgs
if !exists("g:mnvsyn_noerror") && !exists("g:mnvsyn_nomnvsyncerror")
 syn match	mnvSyncError	contained	"\i\+"
endif

syn region	mnvSyncArgs	contained	start="\S" skip=+\\\\\|\\|\|\n\s*\%(\\\|"\\ \)+ matchgroup=mnvCmdSep end="|\|$" contains=mnvSyncLines,mnvSyncLinebreak,mnvSyncLinecont,mnvSyncFromstart,mnvSyncCcomment

syn keyword	mnvSyncCcomment	contained	ccomment	skipwhite	nextgroup=mnvGroupName
syn keyword	mnvSyncClear	contained	clear	skipwhite	nextgroup=mnvSyncGroupName
syn keyword	mnvSyncFromstart	contained	fromstart
syn keyword	mnvSyncMatch	contained	match	skipwhite	nextgroup=mnvSyncGroupName
syn keyword	mnvSyncRegion	contained	region	skipwhite	nextgroup=mnvSynRegion
syn match	mnvSyncLinebreak	contained	"\<linebreaks="		nextgroup=mnvNumber
syn keyword	mnvSyncLinecont	contained	linecont	skipwhite	nextgroup=mnvSynRegPat
syn match	mnvSyncLines	contained	"\<lines="		nextgroup=mnvNumber
syn match	mnvSyncLines	contained	"\<minlines="		nextgroup=mnvNumber
syn match	mnvSyncLines	contained	"\<maxlines="		nextgroup=mnvNumber
syn match	mnvSyncGroupName	contained	"\<\h\w*\>"	skipwhite	nextgroup=mnvSyncKey
syn match	mnvSyncKey	contained	"\<grouphere\>"	skipwhite	nextgroup=mnvSyncGroup
syn match	mnvSyncKey	contained	"\<groupthere\>"	skipwhite	nextgroup=mnvSyncGroup
syn match	mnvSyncGroup	contained	"\<\h\w*\>"	skipwhite	nextgroup=mnvSynRegPat,mnvSyncNone
syn keyword	mnvSyncNone	contained	NONE

" Syntime: {{{2
" =======
syn keyword	mnvSyntimeArg	contained	on off clear report	skipwhite nextgroup=mnvComment,mnv9Comment,mnvCmdSep
syn keyword	mnvSyntime		synti[me]		skipwhite nextgroup=mnvSyntimeArg
" Additional IsCommand: here by reasons of precedence {{{2
" ====================
syn match	mnvIsCommand	"<Bar>\s*\a\+"	transparent contains=mnvCommand,mnvNotation

" Highlighting: {{{2
" ============
syn cluster	mnvHighlightCluster		contains=mnvHiLink,mnvHiClear,mnvHiKeyList,@mnvComment
if !exists("g:mnvsyn_noerror") && !exists("g:mnvsyn_nomnvhictermerror")
 syn match	mnvHiCtermError	contained	"\D\i*"
endif
syn match	mnvHighlight	"\<hi\%[ghlight]\>"	skipwhite nextgroup=mnvHiBang,@mnvHighlightCluster
syn match	mnvHiBang	contained	"\a\@1<=!"	skipwhite nextgroup=@mnvHighlightCluster

syn case ignore
" Conceal is a generated low-priority match
syn match	mnvHiGroup	contained	"\%(\<Conceal\>\)\@!\i\+"
syn keyword	mnvHiNone	contained	NONE
syn keyword	mnvHiAttrib	contained	none bold inverse italic nocombine reverse standout strikethrough underline undercurl underdashed underdotted underdouble
syn keyword	mnvFgBgAttrib	contained	none bg background fg foreground
syn case match
syn match	mnvHiAttribList	contained	"\i\+"	contains=mnvHiAttrib
syn match	mnvHiAttribList	contained	"\i\+,"he=e-1	contains=mnvHiAttrib nextgroup=mnvHiAttribList
syn case ignore
syn keyword	mnvHiCtermColor	contained	black blue brown cyan darkblue darkcyan darkgray darkgreen darkgrey darkmagenta darkred darkyellow gray green grey grey40 grey50 grey90 lightblue lightcyan lightgray lightgreen lightgrey lightmagenta lightred lightyellow magenta red seagreen white yellow
syn match	mnvHiCtermColor	contained	"\<color\d\{1,3}\>"
syn case match

syn match	mnvHiFontname	contained	"[a-zA-Z\-*]\+"
syn match	mnvHiGuiFontname	contained	"'[a-zA-Z\-* ]\+'"
syn match	mnvHiGuiRgb	contained	"#\x\{6}"

" Highlighting: hi group key=arg ... {{{2
syn cluster	mnvHiCluster contains=mnvGroup,mnvHLGroup,mnvHiGroup,mnvHiNone,mnvHiTerm,mnvHiCTerm,mnvHiStartStop,mnvHiCtermFgBg,mnvHiCtermul,mnvHiCtermfont,mnvHiGui,mnvHiGuiFont,mnvHiGuiFgBg,mnvHiKeyError,mnvNotation,mnvComment,mnv9comment
syn region	mnvHiKeyList	contained 	start="\i\+" skip=+\\\\\|\\|\|\n\s*\%(\\\|"\\ \)+ matchgroup=mnvCmdSep end="|" excludenl end="$" contains=@mnvContinue,@mnvHiCluster
if !exists("g:mnvsyn_noerror") && !exists("g:mnvsyn_mnvhikeyerror")
 syn match	mnvHiKeyError	contained	"\i\+="he=e-1
endif
syn match	mnvHiTerm	contained	"\cterm="he=e-1		nextgroup=mnvHiAttribList
syn match	mnvHiStartStop	contained	"\c\%(start\|stop\)="he=e-1	nextgroup=mnvHiTermcap,mnvOption
syn match	mnvHiCTerm	contained	"\ccterm="he=e-1		nextgroup=mnvHiAttribList
syn match	mnvHiCtermFgBg	contained	"\ccterm[fb]g="he=e-1	nextgroup=mnvHiNmbr,mnvHiCtermColor,mnvFgBgAttrib,mnvHiCtermError
syn match	mnvHiCtermul	contained	"\cctermul="he=e-1	nextgroup=mnvHiNmbr,mnvHiCtermColor,mnvFgBgAttrib,mnvHiCtermError
syn match	mnvHiCtermfont	contained	"\cctermfont="he=e-1	nextgroup=mnvHiNmbr,mnvHiCtermColor,mnvFgBgAttrib,mnvHiCtermError
syn match	mnvHiGui	contained	"\cgui="he=e-1		nextgroup=mnvHiAttribList
syn match	mnvHiGuiFont	contained	"\cfont="he=e-1		nextgroup=mnvHiFontname
syn match	mnvHiGuiFgBg	contained	"\cgui\%([fb]g\|sp\)="he=e-1	nextgroup=mnvHiGroup,mnvHiGuiFontname,mnvHiGuiRgb,mnvFgBgAttrib
syn match	mnvHiTermcap	contained	"\S\+"		contains=mnvNotation
syn match	mnvHiNmbr	contained	'\d\+'

" Highlight: clear {{{2
syn keyword	mnvHiClear	contained	clear	skipwhite nextgroup=mnvGroup,mnvHLGroup,mnvHiGroup

" Highlight: link {{{2
" see tst24 (hi def vs hi) (Jul 06, 2018)
"syn region	mnvHiLink	contained oneline matchgroup=mnvCommand start="\(\<hi\%[ghlight]\s\+\)\@<=\(\(def\%[ault]\s\+\)\=link\>\|\<def\>\)" end="$"	contains=mnvHiGroup,mnvGroup,mnvHLGroup,mnvNotation
" TODO: simplify and allow line continuations --djk
syn region	mnvHiLink	contained matchgroup=Type start="\%(\<hi\%[ghlight]!\=\s\+\)\@<=\%(\%(def\%[ault]\s\+\)\=link\>\|\<def\%[ault]\>\)" skip=+\\\\\|\\|\|\n\s*\%(\\\|"\\ \)+ matchgroup=mnvCmdSep end="|" excludenl end="$" contains=@mnvContinue,@mnvHiCluster

" Control Characters: {{{2
" ==================
syn match	mnvCtrlChar	"[--]"

" Embedded Scripts:  {{{2
" ================
"   perl,ruby	: Benoit Cerrina
"   python,tcl	: Johannes Zellner
"   mzscheme, lua : Charles Campbell

" Allows users to specify the type of embedded script highlighting
" they want:  (lua/mzscheme/perl/python/ruby/tcl support)
"   g:mnvsyn_embed == 0   : don't embed any scripts
"   g:mnvsyn_embed =~# 'l' : embed Lua
"   g:mnvsyn_embed =~# 'm' : embed MzScheme
"   g:mnvsyn_embed =~# 'p' : embed Perl
"   g:mnvsyn_embed =~# 'P' : embed Python
"   g:mnvsyn_embed =~# 'r' : embed Ruby
"   g:mnvsyn_embed =~# 't' : embed Tcl

let s:interfaces = get(g:, "mnvsyn_embed", "lP")

" [-- lua --] {{{3
if s:interfaces =~# 'l'
  syn include @mnvLuaScript syntax/lua.mnv
  unlet b:current_syntax
endif

syn keyword	mnvLua	lua	skipwhite nextgroup=mnvLuaHeredoc,mnvLuaStatement
syn keyword	mnvLua	luado	skipwhite nextgroup=mnvLuaStatement
syn keyword	mnvLua	luafile

syn region	mnvLuaStatement	contained
      \ start="\S"
      \ skip=+\n\s*\%(\\\|["#]\\ \)+
      \ end="$"
      \ contains=@mnvLuaScript,@mnvContinue
MNVFoldl syn region mnvLuaHeredoc	contained
      \ matchgroup=mnvScriptHeredocStart
      \ start=+<<\s*\z(\S\+\)\ze\s*$+
      \ matchgroup=mnvScriptHeredocStop
      \ end=+^\z1$+
      \ contains=@mnvLuaScript
MNVFoldl syn region mnvLuaHeredoc	contained
      \ matchgroup=mnvScriptHeredocStart
      \ start=+<<\ze\s*$+
      \ matchgroup=mnvScriptHeredocStop
      \ end=+^\.$+
      \ contains=@mnvLuaScript
MNVFoldl syn region mnvLuaHeredoc	contained
      \ matchgroup=mnvScriptHeredocStart
      \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\s\+\z(\S\+\)\ze\s*$+
      \ matchgroup=mnvScriptHeredocStop
      \ end=+^\z1\=\z2$+
      \ contains=@mnvLuaScript
MNVFoldl syn region mnvLuaHeredoc	contained
      \ matchgroup=mnvScriptHeredocStart
      \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\ze\s*$+
      \ matchgroup=mnvScriptHeredocStop
      \ end=+^\z1\=\.$+
      \ contains=@mnvLuaScript

" [-- mzscheme --] {{{3
if s:interfaces =~# 'm'
  let s:iskKeep = &l:isk
  syn include @mnvMzSchemeScript syntax/scheme.mnv
  unlet b:current_syntax
  let &l:isk = s:iskKeep
endif

syn keyword	mnvMzScheme	mz[scheme]	skipwhite nextgroup=mnvMzSchemeHeredoc,mnvMzSchemeStatement
syn keyword	mnvMzScheme	mzf[ile]

syn region	mnvMzSchemeStatement	contained
      \ start="\S"
      \ skip=+\n\s*\%(\\\|["#]\\ \)+
      \ end="$"
      \ contains=@mnvMzSchemeScript,@mnvContinue
MNVFoldm syn region mnvMzSchemeHeredoc	contained
      \ matchgroup=mnvScriptHeredocStart
      \ start=+<<\s*\z(\S\+\)\ze\s*$+
      \ matchgroup=mnvScriptHeredocStop
      \ end=+^\z1$+
      \ contains=@mnvMzSchemeScript
MNVFoldm syn region mnvMzSchemeHeredoc	contained
      \ matchgroup=mnvScriptHeredocStart
      \ start=+<<\ze\s*$+
      \ matchgroup=mnvScriptHeredocStop
      \ end=+^\.$+
      \ contains=@mnvMzSchemeScript
MNVFoldm syn region mnvMzSchemeHeredoc	contained
      \ matchgroup=mnvScriptHeredocStart
      \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\s\+\z(\S\+\)\ze\s*$+
      \ matchgroup=mnvScriptHeredocStop
      \ end=+^\z1\=\z2$+
      \ contains=@mnvMzSchemeScript
MNVFoldm syn region mnvMzSchemeHeredoc	contained
      \ matchgroup=mnvScriptHeredocStart
      \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\ze\s*$+
      \ matchgroup=mnvScriptHeredocStop
      \ end=+^\z1\=\.$+
      \ contains=@mnvMzSchemeScript

" [-- perl --] {{{3
if s:interfaces =~# 'p'
  syn include @mnvPerlScript syntax/perl.mnv
  unlet b:current_syntax
endif

syn keyword	mnvPerl	pe[rl]	skipwhite nextgroup=mnvPerlHeredoc,mnvPerlStatement
syn keyword	mnvPerl	perld[o]	skipwhite nextgroup=mnvPerlStatement

syn region	mnvPerlStatement	contained
       \ start="\S"
       \ skip=+\n\s*\%(\\\|["#]\\ \)+
       \ end="$"
       \ contains=@mnvPerlScript,@mnvContinue
MNVFoldp syn region mnvPerlHeredoc	contained
       \ matchgroup=mnvScriptHeredocStart
       \ start=+<<\s*\z(\S\+\)\ze\s*$+
       \ matchgroup=mnvScriptHeredocStop
       \ end=+^\z1$+ contains=@mnvPerlScript
MNVFoldp syn region mnvPerlHeredoc	contained
       \ matchgroup=mnvScriptHeredocStart
       \ start=+<<\ze\s*$+	matchgroup=mnvScriptHeredocStop
       \ end=+^\.$+
       \ contains=@mnvPerlScript
MNVFoldp syn region mnvPerlHeredoc	contained
       \ matchgroup=mnvScriptHeredocStart
       \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\s\+\z(\S\+\)\ze\s*$+
       \ matchgroup=mnvScriptHeredocStop
       \ end=+^\z1\=\z2$+
       \ contains=@mnvPerlScript
MNVFoldp syn region mnvPerlHeredoc	contained
       \ matchgroup=mnvScriptHeredocStart
       \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\ze\s*$+
       \ matchgroup=mnvScriptHeredocStop
       \ end=+^\z1\=\.$+
       \ contains=@mnvPerlScript

" [-- python --] {{{3
if s:interfaces =~# 'P'
  syn include @mnvPythonScript syntax/python2.mnv
  unlet b:current_syntax
endif

syn keyword	mnvPython	py[thon]	skipwhite nextgroup=mnvPythonHeredoc,mnvPythonStatement
syn keyword	mnvPython	pydo	skipwhite nextgroup=mnvPythonStatement
syn keyword	mnvPython	pyfile

syn region	mnvPythonStatement	contained
      \ start="\S"
      \ skip=+\n\s*\%(\\\|["#]\\ \)+
      \ end="$"
      \ contains=@mnvPythonScript,@mnvContinue
MNVFoldP syn region mnvPythonHeredoc	contained
      \ matchgroup=mnvScriptHeredocStart
      \ start=+<<\s*\z(\S\+\)\ze\s*$+
      \ matchgroup=mnvScriptHeredocStop
      \ end=+^\z1$+
      \ contains=@mnvPythonScript
MNVFoldP syn region mnvPythonHeredoc	contained
      \ matchgroup=mnvScriptHeredocStart
      \ start=+<<\ze\s*$+
      \ matchgroup=mnvScriptHeredocStop
      \ end=+^\.$+
      \ contains=@mnvPythonScript
MNVFoldP syn region mnvPythonHeredoc	contained
      \ matchgroup=mnvScriptHeredocStart
      \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\s\+\z(\S\+\)\ze\s*$+
      \ matchgroup=mnvScriptHeredocStop
      \ end=+^\z1\=\z2$+
      \ contains=@mnvPythonScript
MNVFoldP syn region mnvPythonHeredoc	contained
      \ matchgroup=mnvScriptHeredocStart
      \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\ze\s*$+
      \ matchgroup=mnvScriptHeredocStop
      \ end=+^\z1\=\.$+
      \ contains=@mnvPythonScript

" [-- python3 --] {{{3
if s:interfaces =~# 'P'
  syn include @mnvPython3Script syntax/python.mnv
  unlet b:current_syntax
endif

syn keyword	mnvPython3	python3 py3	skipwhite nextgroup=mnvPython3Heredoc,mnvPython3Statement
syn keyword	mnvPython3	py3do	skipwhite nextgroup=mnvPython3Statement
syn keyword	mnvPython3	py3file

syn region	mnvPython3Statement	contained
      \ start="\S"
      \ skip=+\n\s*\%(\\\|["#]\\ \)+
      \ end="$"
      \ contains=@mnvPython3Script,@mnvContinue
MNVFoldP syn region mnvPython3Heredoc	contained
      \ matchgroup=mnvScriptHeredocStart
      \ start=+<<\s*\z(\S\+\)\ze\s*$+
      \ matchgroup=mnvScriptHeredocStop
      \ end=+^\z1$+
      \ contains=@mnvPython3Script
MNVFoldP syn region mnvPython3Heredoc	contained
      \ matchgroup=mnvScriptHeredocStart
      \ start=+<<\ze\s*$+
      \ matchgroup=mnvScriptHeredocStop
      \ end=+^\.$+
      \ contains=@mnvPython3Script
MNVFoldP syn region mnvPython3Heredoc	contained
      \ matchgroup=mnvScriptHeredocStart
      \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\s\+\z(\S\+\)\ze\s*$+
      \ matchgroup=mnvScriptHeredocStop
      \ end=+^\z1\=\z2$+
      \ contains=@mnvPython3Script
MNVFoldP syn region mnvPython3Heredoc	contained
      \ matchgroup=mnvScriptHeredocStart
      \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\ze\s*$+
      \ matchgroup=mnvScriptHeredocStop
      \ end=+^\z1\=\.$+
      \ contains=@mnvPython3Script

" [-- pythonx --] {{{3
if s:interfaces =~# 'P'
  if &pyxversion == 2
    syn cluster mnvPythonXScript contains=@mnvPythonScript
  else
    syn cluster mnvPythonXScript contains=@mnvPython3Script
  endif
endif

syn keyword	mnvPythonX	pythonx pyx	skipwhite nextgroup=mnvPythonXHeredoc,mnvPythonXStatement
syn keyword	mnvPythonX	pyxdo	skipwhite nextgroup=mnvPythonXStatement
syn keyword	mnvPythonX	pyxfile

syn region	mnvPythonXStatement	contained
      \ start="\S"
      \ skip=+\n\s*\%(\\\|["#]\\ \)+
      \ end="$"
      \ contains=@mnvPythonXScript,@mnvContinue
MNVFoldP syn region mnvPythonXHeredoc	contained
      \ matchgroup=mnvScriptHeredocStart
      \ start=+<<\s*\z(\S\+\)\ze\s*$+
      \ matchgroup=mnvScriptHeredocStop
      \ end=+^\z1$+
      \ contains=@mnvPythonXScript
MNVFoldP syn region mnvPythonXHeredoc	contained
      \ matchgroup=mnvScriptHeredocStart
      \ start=+<<\ze\s*$+
      \ matchgroup=mnvScriptHeredocStop
      \ end=+^\.$+
      \ contains=@mnvPythonXScript
MNVFoldP syn region mnvPythonXHeredoc	contained
      \ matchgroup=mnvScriptHeredocStart
      \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\s\+\z(\S\+\)\ze\s*$+
      \ matchgroup=mnvScriptHeredocStop
      \ end=+^\z1\=\z2$+
      \ contains=@mnvPythonXScript
MNVFoldP syn region mnvPythonXHeredoc	contained
      \ matchgroup=mnvScriptHeredocStart
      \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\ze\s*$+
      \ matchgroup=mnvScriptHeredocStop
      \ end=+^\z1\=\.$+
      \ contains=@mnvPythonXScript

" [-- ruby --] {{{3
if s:interfaces =~# 'r'
  syn include @mnvRubyScript syntax/ruby.mnv
  unlet b:current_syntax
endif

syn keyword	mnvRuby	rub[y]	skipwhite nextgroup=mnvRubyHeredoc,mnvRubyStatement
syn keyword	mnvRuby	rubyd[o]	skipwhite nextgroup=mnvRubyStatement
syn keyword	mnvRuby	rubyf[ile]

syn region	mnvRubyStatement	contained
      \ start="\S"
      \ skip=+\n\s*\%(\\\|["#]\\ \)+
      \ end="$"
      \ contains=@mnvRubyScript,@mnvContinue
MNVFoldr syn region mnvRubyHeredoc	contained
      \ matchgroup=mnvScriptHeredocStart
      \ start=+<<\s*\z(\S\+\)\ze\s*$+
      \ matchgroup=mnvScriptHeredocStop
      \ end=+^\z1$+
      \ contains=@mnvRubyScript
MNVFoldr syn region mnvRubyHeredoc	contained
      \ matchgroup=mnvScriptHeredocStart
      \ start=+<<\ze\s*$+	matchgroup=mnvScriptHeredocStop
      \ end=+^\.$+
      \ contains=@mnvRubyScript
MNVFoldr syn region mnvRubyHeredoc	contained
      \ matchgroup=mnvScriptHeredocStart
      \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\s\+\z(\S\+\)\ze\s*$+
      \ matchgroup=mnvScriptHeredocStop
      \ end=+^\z1\=\z2$+
      \ contains=@mnvRubyScript
MNVFoldr syn region mnvRubyHeredoc	contained
      \ matchgroup=mnvScriptHeredocStart
      \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\ze\s*$+
      \ matchgroup=mnvScriptHeredocStop
      \ end=+^\z1\.$+
      \ contains=@mnvRubyScript

" [-- tcl --] {{{3
if s:interfaces =~# 't'
  syn include @mnvTclScript syntax/tcl.mnv
  unlet b:current_syntax
endif

syn keyword	mnvTcl	tcl	skipwhite nextgroup=mnvTclHeredoc,mnvTclStatement
syn keyword	mnvTcl	tcld[o]	skipwhite nextgroup=mnvTclStatement
syn keyword	mnvTcl	tclf[ile]
syn region	mnvTclStatement	contained
      \ start="\S"
      \ skip=+\n\s*\%(\\\|["#]\\ \)+
      \ end="$"
      \ contains=@mnvTclScript,@mnvContinue
MNVFoldt syn region mnvTclHeredoc	contained
      \ matchgroup=mnvScriptHeredocStart
      \ start=+<<\s*\z(\S\+\)\ze\s*$+
      \ matchgroup=mnvScriptHeredocStop
      \ end=+^\z1$+
      \ contains=@mnvTclScript
MNVFoldt syn region mnvTclHeredoc	contained
      \ matchgroup=mnvScriptHeredocStart
      \ start=+<<\ze\s*$+
      \ matchgroup=mnvScriptHeredocStop
      \ end=+^\.$+
      \ contains=@mnvTclScript
MNVFoldt syn region mnvTclHeredoc	contained
      \ matchgroup=mnvScriptHeredocStart
      \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\s\+\z(\S\+\)\ze\s*$+
      \ matchgroup=mnvScriptHeredocStop
      \ end=+^\z1\=\z2$+
      \ contains=@mnvTclScript
MNVFoldt syn region mnvTclHeredoc	contained
      \ matchgroup=mnvScriptHeredocStart
      \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\ze\s*$+
      \ matchgroup=mnvScriptHeredocStop
      \ end=+^\z1\=\.$+
      \ contains=@mnvTclScript

unlet s:interfaces
" Function Call Highlighting: {{{2
" (following Gautam Iyer's suggestion)
" ==========================
syn match	mnvFunc	contained	"\<\l\w*\ze\s*("					skipwhite nextgroup=mnvOperParen		contains=mnvFuncName
syn match	mnvUserFunc	contained	"\.\@1<=\l\w*\ze\%(\s*(\|<.*>(\)"				skipwhite nextgroup=mnvOperParen,mnv9TypeArgs
syn match	mnvUserFunc	contained	"\<\%([[:upper:]_]\|\%(\h\w*\.\)\+\h\)\w*\ze\%(\s*(\|<.*>(\)"		skipwhite nextgroup=mnvOperParen,mnv9TypeArgs	contains=mnv9MethodName,mnv9Super,mnv9This
syn match	mnvUserFunc	contained	"\<\%(g:\)\=\%(\h\w*#\)\+\h\w*\ze\%(\s*(\|<.*>(\)"			skipwhite nextgroup=mnvOperParen		contains=mnvVarScope
syn match	mnvUserFunc	contained	"\%(\<[sgbwtlav]:\|<[sS][iI][dD]>\)\%(\h\w*\.\)*\h\w*\ze\%(\s*(\|<.*>(\)"	skipwhite nextgroup=mnvOperParen,mnv9TypeArgs	contains=mnvVarScope,mnvNotation

MNV9 syn match	mnv9UserFunc	"^\s*\zs\%([sgbwtv]:\|<[sS][iI][dD]>\)\=\%(\h\w*[.#]\)*\h\w*\ze[<(]"			skipwhite nextgroup=mnvOperParen,mnv9TypeArgs	contains=mnvVarScope,mnvNotation,mnv9MethodName,mnv9Super,mnv9This
MNV9 syn match	mnv9Func	"^\s*\zs\l\w*\ze("					skipwhite nextgroup=mnvOperParen		contains=mnvFuncName

syn cluster	mnvFunc	contains=mnvFunc,mnvUserFunc
syn cluster	mnv9Func	contains=mnv9Func,mnv9UserFunc

syn region	mnv9TypeArgs	contained
      \ matchgroup=Delimiter
      \ start="<\ze\a"
      \ end=">"
      \ nextgroup=mnvOperParen
      \ contains=@mnvType
      \ oneline

" Beginners - Patterns that involve ^ {{{2
" =========
MNV9 syn region	mnv9LineComment	start=+^[ \t:]*\zs#.*$+ skip=+\n\s*\%(\\\|#\\ \)+ end="$" contains=@mnvCommentGroup,mnvCommentString,mnv9CommentTitle extend
MNVL syn region	mnvLineComment	start=+^[ \t:]*\zs".*$+ skip=+\n\s*\%(\\\|"\\ \)+ end="$" contains=@mnvCommentGroup,mnvCommentString,mnvCommentTitle extend

syn match	mnvCommentTitle	'"\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1	contained contains=mnvCommentTitleLeader,mnvTodo,@mnvCommentGroup
syn match	mnv9CommentTitle	'#\s*\%([sS]:\|\h\w*#\)\=\%([A-DF-Z]\w*\|E\%(\d\{1,4}\>\)\@!\w*\)\(\s\+\u\w*\)*:'hs=s+1	contained contains=mnv9CommentTitleLeader,mnvTodo,@mnvCommentGroup

" allowed anywhere in the file
if !s:mnv9script
  syn match	mnvShebangError	"^\s*\zs#!.*" display
endif
syn match	mnvShebang	"\%^#!.*" display

syn match	mnvContinue		"^\s*\zs\\"
syn match	mnvContinueComment	'^\s*\zs["#]\\ .*' extend
syn match	mnv9ContinueComment	"^\s*\zs#\\ .*"	 extend
syn cluster	mnvContinue	contains=mnvContinue,mnvContinueComment
syn cluster	mnv9Continue	contains=mnvContinue,mnv9ContinueComment

syn region	mnvString	start='^\s*\\"' end='"' oneline keepend contains=@mnvStringGroup,mnvContinue
syn region	mnvString	start="^\s*\\'" end="'" oneline keepend contains=mnvQuoteEscape,mnvContinue

syn match	mnvCommentTitleLeader	'"\s\+'ms=s+1	contained
syn match	mnv9CommentTitleLeader	'#\s\+'ms=s+1	contained

" Searches And Globals: {{{2
" ====================
MNVL syn match	mnvSearch	'^\s*[/?].*'		contains=mnvSearchDelim
syn match	mnvSearchDelim	'^\s*\zs[/?]\|[/?]$'	contained
MNV9 syn match	mnv9Search	'^\s*:[/?].*'		contains=mnv9SearchDelim
syn match	mnv9SearchDelim	'^\s*\zs:[/?]\|[/?]$'	contained contains=mnvCmdSep
syn region	mnvGlobal	matchgroup=Statement start='\<g\%[lobal]!\=/'  skip='\\.' end='/'	skipwhite nextgroup=mnvSubst1
syn region	mnvGlobal	matchgroup=Statement start='\<v\%[global]!\=/' skip='\\.' end='/'	skipwhite nextgroup=mnvSubst1

" MNV9 script Regions: {{{2
" ==================

if s:mnv9script
  syn cluster mnvLegacyTop	contains=TOP,mnv9LegacyHeader,mnv9Comment,mnv9LineComment
  MNVFoldH syn region mnv9LegacyHeader start="\%^" end="^\ze\s*mnv9s\%[cript]\>" contains=@mnvLegacyTop,mnvComment,mnvLineComment

  syn keyword mnv9MNV9ScriptArg	noclear contained
  syn keyword mnv9MNV9Script	mnv9s[cript] nextgroup=mnv9MNV9ScriptArg skipwhite
endif

" Synchronize (speed) {{{2
"============

exe "syn sync minlines=" .. get(g:, "mnvsyn_minlines", 100)
exe "syn sync maxlines=" .. get(g:, "mnvsyn_maxlines", 200)

syn sync linecont	"^\s\+\\"
syn sync linebreaks=2
syn sync match mnvAugroupSyncA	groupthere NONE	"\<aug\%[roup]\>\s\+[eE][nN][dD]"

" ====================
" Highlighting Settings {{{2
" ====================

if !exists("skip_mnv_syntax_inits")
 if !exists("g:mnvsyn_noerror")
  hi def link mnvBehaveError	mnvError
  hi def link mnvCollClassErr	mnvError
  hi def link mnvErrSetting	mnvError
  hi def link mnvFTError	mnvError
  hi def link mnvFunctionError	mnvError
  hi def link mnvFunc         	mnvError
  hi def link mnv9Func         	mnvError
  hi def link mnvHiAttribList	mnvError
  hi def link mnvHiCtermError	mnvError
  hi def link mnvHiKeyError	mnvError
  hi def link mnvMapModErr	mnvError
  hi def link mnvMarkArgError	mnvError
  hi def link mnvShebangError	mnvError
  hi def link mnvSortOptionsError	Error
  hi def link mnvSubstFlagErr	mnvError
  hi def link mnvSynCaseError	mnvError
  hi def link mnvSyncError	mnvError
  hi def link mnvSynConcealError	mnvError
  hi def link mnvSynError	mnvError
  hi def link mnvSynFoldlevelError	mnvError
  hi def link mnvSynIskeywordError	mnvError
  hi def link mnvSynSpellError	mnvError
  hi def link mnvBufnrWarn	mnvWarn

  hi def link mnv9TypeAliasError	mnvError
 endif

 hi def link mnvAbb	mnvCommand
 hi def link mnvAddress	mnvMark
 hi def link mnvAt	mnvCommand
 hi def link mnvAtArg	Special
 hi def link mnvAugroupBang	mnvBang
 hi def link mnvAugroupError	mnvError
 hi def link mnvAugroupKey	mnvCommand
 hi def link mnvAutocmd	mnvCommand
 hi def link mnvAutocmdBang	mnvBang
 hi def link mnvAutocmdPatternEscape	Special
 hi def link mnvAutoEvent	Type
 hi def link mnvAutoEventGlob	Type
 hi def link mnvAutocmdBufferPattern	Special
 hi def link mnvAutocmdMod	Special
 hi def link mnvAutocmdPatternSep	mnvSep
 hi def link mnvBang	mnvOper
 hi def link mnvBehaveBang	mnvBang
 hi def link mnvBehaveModel	mnvBehave
 hi def link mnvBehave	mnvCommand
 hi def link mnvBracket	Delimiter
 hi def link mnvBreakaddFunc	Special
 hi def link mnvBreakaddFile	Special
 hi def link mnvBreakaddHere	Special
 hi def link mnvBreakaddExpr	Special
 hi def link mnvBreakpointGlob	Special
 hi def link mnvBreakadd	mnvCommand
 hi def link mnvBreakdel	mnvCommand
 hi def link mnvBreaklist	mnvCommand
 hi def link mnvCall	mnvCommand
 hi def link mnvCatch	mnvCommand
 hi def link mnvCd	mnvCommand
 hi def link mnvCdBang	mnvBang
 hi def link mnvCmplxRepeat	SpecialChar
 hi def link mnvCommand	Statement
 hi def link mnvCommandModifier	mnvCommand
 hi def link mnvCommandModifierBang	mnvBang
 hi def link mnvComment	Comment
 hi def link mnvCommentError	mnvError
 hi def link mnvCommentString	mnvString
 hi def link mnvCommentTitle	PreProc
 hi def link mnvCondHL	mnvCommand
 hi def link mnvConst	mnvCommand
 hi def link mnvContinue	Special
 hi def link mnvContinueComment	mnvComment
 hi def link mnvContinueString	mnvString
 hi def link mnvCount	Number
 hi def link mnvCtrlChar	SpecialChar
 hi def link mnvDebug	mnvCommand
 hi def link mnvDebuggreedy	mnvCommand
 hi def link mnvDef	mnvCommand
 hi def link mnvDefBang	mnvBang
 hi def link mnvDefComment	mnv9Comment
 hi def link mnvDefer	mnvCommand
 hi def link mnvDefParam	mnvVar
 hi def link mnvDelcommand	mnvCommand
 hi def link mnvDelcommandAttr	mnvUserCmdAttr
 hi def link mnvDelfunction	mnvCommand
 hi def link mnvDelfunctionBang	mnvBang
 hi def link mnvDoautocmd	mnvCommand
 hi def link mnvDoautocmdMod	Special
 hi def link mnvDoCommand	mnvCommand
 hi def link mnvDoCommandBang	mnvBang
 hi def link mnvEcho	mnvCommand
 hi def link mnvEchohlNone	mnvGroup
 hi def link mnvEchohl	mnvCommand
 hi def link mnvElse	mnvCommand
 hi def link mnvElseIfErr	Error
 hi def link mnvEndfunction	mnvCommand
 hi def link mnvEnddef	mnvCommand
 hi def link mnvEndif	mnvCommand
 hi def link mnvEnvvar	PreProc
 hi def link mnvError	Error
 hi def link mnvEscape	Special
 hi def link mnvEval	mnvCommand
 hi def link mnvExFilter	mnvCommand
 hi def link mnvExFilterBang	mnvBang
 hi def link mnvExMark	mnvCommand
 hi def link mnvFBVar	mnvVar
 hi def link mnvFgBgAttrib	mnvHiAttrib
 hi def link mnvFuncEcho	mnvCommand
 hi def link mnvFor	mnvCommand
 hi def link mnvForInContinue	mnvContinue
 hi def link mnvForInContinueComment	mnvContinueComment
 hi def link mnvFTCmd	mnvCommand
 hi def link mnvFTOption	mnvSynType
 hi def link mnvFunction	mnvCommand
 hi def link mnvFunctionBang	mnvBang
 hi def link mnvFunctionComment	mnvComment
 hi def link mnvFuncName	Function
 hi def link mnvFunctionMod	Special
 hi def link mnvFunctionParam	mnvVar
 hi def link mnvFunctionParamEquals	mnvOper
 hi def link mnvFunctionScope	mnvVarScope
 hi def link mnvFunctionSID	mnvNotation
 hi def link mnvGrep	mnvCommand
 hi def link mnvGrepadd	mnvCommand
 hi def link mnvGrepBang	mnvBang
 hi def link mnvGroup	Type
 hi def link mnvGroupAdd	mnvSynOption
 hi def link mnvGroupListEquals	mnvSynOption
 hi def link mnvGroupListContinue		mnvContinue
 hi def link mnvGroupListContinueComment	mnvContinueComment
 hi def link mnvGroupName	Normal
 hi def link mnvGroupRem	mnvSynOption
 hi def link mnvGroupSpecial	Special
 hi def link mnvHelp	mnvCommand
 hi def link mnvHelpBang	mnvBang
 hi def link mnvHelpgrep	mnvCommand
 hi def link mnvHiAttrib	PreProc
 hi def link mnvHiBang	mnvBang
 hi def link mnvHiClear	Type
 hi def link mnvHiCtermColor	Constant
 hi def link mnvHiCtermFgBg	mnvHiTerm
 hi def link mnvHiCtermfont	mnvHiTerm
 hi def link mnvHiCtermul	mnvHiTerm
 hi def link mnvHiCTerm	mnvHiTerm
 hi def link mnvHighlight	mnvCommand
 hi def link mnvHiGroup	mnvGroupName
 hi def link mnvHiGuiFgBg	mnvHiTerm
 hi def link mnvHiGuiFont	mnvHiTerm
 hi def link mnvHiGuiRgb	mnvNumber
 hi def link mnvHiGui	mnvHiTerm
 hi def link mnvHiNmbr	Number
 hi def link mnvHiNone	mnvGroup
 hi def link mnvHiStartStop	mnvHiTerm
 hi def link mnvHiTerm	Type
 hi def link mnvHLGroup	mnvGroup
 hi def link mnvHistory	mnvCommand
 hi def link mnvHistoryName	Special
 hi def link mnvImport	mnvCommand
 hi def link mnvImportAutoload	Special
 hi def link mnvImportAs	mnvImport
 hi def link mnvInsert	mnvString
 hi def link mnv9KeymapLineComment	mnvKeymapLineComment
 hi def link mnvKeymapLineComment	mnvComment
 hi def link mnvKeymapTailComment	mnvComment
 hi def link mnvLambdaBrace	Delimiter
 hi def link mnvLambdaOperator	mnvOper
 hi def link mnvLanguage	mnvCommand
 hi def link mnvLanguageCategory	Special
 hi def link mnvLanguageNameReserved	Constant
 hi def link mnvLet	mnvCommand
 hi def link mnvLetHeredoc	mnvString
 hi def link mnvLetHeredocStart	Special
 hi def link mnvLetHeredocStop	Special
 hi def link mnvLetRegister	mnvRegister
 hi def link mnvLineComment	mnvComment
 hi def link mnvLua	mnvCommand
 hi def link mnvMake	mnvCommand
 hi def link mnvMakeadd	mnvCommand
 hi def link mnvMakeBang	mnvBang
 hi def link mnvMapBang	mnvBang
 hi def link mnvMapLeader	mnvBracket
 hi def link mnvMapLeaderKey	mnvNotation
 hi def link mnvMapModKey	mnvFunctionSID
 hi def link mnvMapMod	mnvBracket
 hi def link mnvMap	mnvCommand
 hi def link mnvMark	Number
 hi def link mnvMarkNumber	mnvNumber
 hi def link mnvMatch	mnvCommand
 hi def link mnvMatchGroup	mnvGroup
 hi def link mnvMatchNone	mnvGroup
 hi def link mnvMenuBang	mnvBang
 hi def link mnvMenuClear	Special
 hi def link mnvMenuMod	mnvMapMod
 hi def link mnvMenuName	PreProc
 hi def link mnvMenu	mnvCommand
 hi def link mnvMenuNotation	mnvNotation
 hi def link mnvMenuPriority	Number
 hi def link mnvMenuStatus	Special
 hi def link mnvMenutranslateComment	mnvComment
 hi def link mnv9MethodName	mnvFuncName
 hi def link mnvMtchComment	mnvComment
 hi def link mnvMzScheme	mnvCommand
 hi def link mnvNonText	NonText
 hi def link mnvNormal	mnvCommand
 hi def link mnvNotation	Special
 hi def link mnvNotFunc	mnvCommand
 hi def link mnvNotPatSep	mnvString
 hi def link mnvNumber	Number
 hi def link mnvOperError	Error
 hi def link mnvOper	Operator
 hi def link mnvOperContinue	mnvContinue
 hi def link mnvOperContinueComment	mnvContinueComment
 hi def link mnvOption	PreProc
 hi def link mnvOptionVar	Identifier
 hi def link mnvOptionVarName	Identifier
 hi def link mnvParenSep	Delimiter
 hi def link mnvPatSepErr	mnvError
 hi def link mnvPatSepR	mnvPatSep
 hi def link mnvPatSep	SpecialChar
 hi def link mnvPatSepZone	mnvString
 hi def link mnvPatSepZ	mnvPatSep
 hi def link mnvPattern	Type
 hi def link mnvPerl	mnvCommand
 hi def link mnvPlainMark	mnvMark
 hi def link mnvProfile	mnvCommand
 hi def link mnvProfileArg	mnvSpecial
 hi def link mnvProfileBang	mnvBang
 hi def link mnvProfdel	mnvCommand
 hi def link mnvProfdelArg	mnvSpecial
 hi def link mnvPrompt	mnvCommand
 hi def link mnvPython	mnvCommand
 hi def link mnvPython3	mnvCommand
 hi def link mnvPythonX	mnvCommand
 hi def link mnvQuoteEscape	mnvEscape
 hi def link mnvRedir	mnvCommand
 hi def link mnvRedirBang	mnvBang
 hi def link mnvRedirFileOperator	mnvOper
 hi def link mnvRedirRegisterOperator	mnvOper
 hi def link mnvRedirVariableOperator	mnvOper
 hi def link mnvRedirEnd	Special
 hi def link mnvRedirRegister	mnvRegister
 hi def link mnvRegister	SpecialChar
 hi def link mnvRuby	mnvCommand
 hi def link mnvScriptDelim	Comment
 hi def link mnvScriptHeredocStart	mnvLetHeredocStart
 hi def link mnvScriptHeredocStop	mnvLetHeredocStop
 hi def link mnvSearch	mnvString
 hi def link mnvSearchDelim	Delimiter
 hi def link mnvSep	Delimiter
 hi def link mnvSet	mnvCommand
 hi def link mnvSetAll	mnvOption
 hi def link mnvSetBang	mnvBang
 hi def link mnvSetComment	mnvComment
 hi def link mnvSetMod	mnvOption
 hi def link mnvSetSep	mnvSep
 hi def link mnvSetTermcap	mnvOption
 hi def link mnvShebang	PreProc
 hi def link mnvSleep	mnvCommand
 hi def link mnvSleepArg	Constant
 hi def link mnvSleepBang	mnvBang
 hi def link mnvSort	mnvCommand
 hi def link mnvSortBang	mnvBang
 hi def link mnvSortOptions	Special
 hi def link mnvSpecFile	Identifier
 hi def link mnvSpecFileMod	mnvSpecFile
 hi def link mnvSpecial	Type
 hi def link mnvStringCont	mnvString
 hi def link mnvString	String
 hi def link mnvStringEnd	mnvString
 hi def link mnvStringInterpolationBrace	mnvEscape
 hi def link mnvSubst1	mnvSubst
 hi def link mnvSubstCount	Number
 hi def link mnvSubstDelim	Delimiter
 hi def link mnvSubstFlags	Special
 hi def link mnvSubstSubstr	SpecialChar
 hi def link mnvSubstTwoBS	mnvString
 hi def link mnvSubst	mnvCommand
 hi def link mnvSynCase	Type
 hi def link mnvSyncCcomment	Type
 hi def link mnvSynCchar	mnvSynOption
 hi def link mnvSynCcharValue	Character
 hi def link mnvSyncClear	Type
 hi def link mnvSyncFromstart	Type
 hi def link mnvSyncGroup	mnvGroupName
 hi def link mnvSyncGroupName	mnvGroupName
 hi def link mnvSyncKey	Type
 hi def link mnvSyncLinebreak	Type
 hi def link mnvSyncLinecont	Type
 hi def link mnvSyncLines	Type
 hi def link mnvSyncMatch	Type
 hi def link mnvSyncNone	Type
 hi def link mnvSynConceal	Type
 hi def link mnvSynContains	mnvSynOption
 hi def link mnvSyncRegion	Type
 hi def link mnvSynFoldlevel	Type
 hi def link mnvSynIskeyword	Type
 hi def link mnvSynIskeywordSep	Delimiter
 hi def link mnvSynContainedin	mnvSynContains
 hi def link mnvSynKeyOpt	mnvSynOption
 hi def link mnvSynMtchGrp	mnvSynOption
 hi def link mnvSynMtchOpt	mnvSynOption
 hi def link mnvSynNextgroup	mnvSynOption
 hi def link mnvSynNotPatRange	mnvSynRegPat
 hi def link mnvSynOption	Special
 hi def link mnvSynPatRange	mnvString
 hi def link mnvSynReg	Type
 hi def link mnvSynRegOpt	mnvSynOption
 hi def link mnvSynRegPat	mnvString
 hi def link mnvSynSpell	Type
 hi def link mnvSyntax	mnvCommand
 hi def link mnvSynType	mnvSpecial
 hi def link mnvSyntime	mnvCommand
 hi def link mnvSyntimeArg	mnvSpecial
 hi def link mnvTcl	mnvCommand
 hi def link mnvTerminal	mnvCommand
 hi def link mnvTerminalContinue	mnvContinue
 hi def link mnvTerminalContinueComment	mnvContinueComment
 hi def link mnvTerminalOption		mnvSpecial
 hi def link mnvTerminalKillOptionArg	Constant
 hi def link mnvTerminalSizeOptionArg	Constant
 hi def link mnvTerminalTypeOptionArg	Constant
 hi def link mnvThrow	mnvCommand
 hi def link mnvTodo	Todo
 hi def link mnvType	Type
 hi def link mnvTypeAny	mnvType
 hi def link mnvTypeObject	mnvType
 hi def link mnvTypeObjectBracket	mnvTypeObject
 hi def link mnvUniq	mnvCommand
 hi def link mnvUniqBang	mnvBang
 hi def link mnvUniqOptions	Special
 hi def link mnvUnlet	mnvCommand
 hi def link mnvUnletBang	mnvBang
 hi def link mnvUnmap	mnvMap
 hi def link mnvUserCmd	mnvCommand
 hi def link mnvUserCmdAttrAddr	mnvSpecial
 hi def link mnvUserCmdAttrComplete	mnvSpecial
 hi def link mnvUserCmdAttrCompleteFunc	mnvVar
 hi def link mnvUserCmdAttrNargs	mnvSpecial
 hi def link mnvUserCmdAttrRange	mnvSpecial
 hi def link mnvUserCmdAttrKey	mnvUserCmdAttr
 hi def link mnvUserCmdAttr	Special
 hi def link mnvUserCmdAttrError	Error
 hi def link mnvUserCmdError	Error
 hi def link mnvUserCmdKey	mnvCommand
 hi def link mnvUserFunc	Normal
 hi def link mnvVar	Normal
 hi def link mnvVarScope	Identifier
 hi def link mnvMNVgrep	mnvCommand
 hi def link mnvMNVgrepadd	mnvCommand
 hi def link mnvMNVgrepBang	mnvBang
 hi def link mnvMNVgrepFlags	Special
 hi def link mnvMNVVar	Identifier
 hi def link mnvMNVVarName	Identifier
 hi def link mnvWarn	WarningMsg
 hi def link mnvWildcard	Special
 hi def link mnvWildcardBraceComma	mnvWildcard
 hi def link mnvWildcardBracket	mnvWildcard
 hi def link mnvWildcardBracketCaret	mnvWildcard
 hi def link mnvWildcardBracketCharacter	Normal
 hi def link mnvWildcardBracketCharacter	Normal
 hi def link mnvWildcardBracketCharacterClass	mnvWildCard
 hi def link mnvWildcardBracketCollatingSymbol	mnvWildCard
 hi def link mnvWildcardBracketEnd		mnvWildcard
 hi def link mnvWildcardBracketEquivalenceClass	mnvWildCard
 hi def link mnvWildcardBracketEscape	mnvWildcard
 hi def link mnvWildcardBracketHyphen	mnvWildcard
 hi def link mnvWildcardBracketRightBracket	mnvWildcardBracketCharacter
 hi def link mnvWildcardBracketStart	mnvWildcard
 hi def link mnvWildcardEscape	mnvWildcard
 hi def link mnvWildcardInterval	mnvWildcard
 hi def link mnvWildcardQuestion	mnvWildcard
 hi def link mnvWildcardStar	mnvWildcard
 hi def link mnvWinCmd	mnvCommand

 hi def link mnv9Abstract	mnvCommand
 hi def link mnv9Boolean	Boolean
 hi def link mnv9Class	mnvCommand
 hi def link mnv9Comment	Comment
 hi def link mnv9CommentError	mnvError
 hi def link mnv9CommentTitle	PreProc
 hi def link mnv9ConstructorDefParam	mnvVar
 hi def link mnv9Const	mnvCommand
 hi def link mnv9ContinueComment	mnvContinueComment
 hi def link mnv9Enum	mnvCommand
 hi def link mnv9EnumImplementedInterfaceComment	mnv9Comment
 hi def link mnv9EnumImplements	mnv9Implements
 hi def link mnv9EnumNameComment	mnv9Comment
 hi def link mnv9EnumNameContinue	mnvContinue
 hi def link mnv9EnumNameContinueComment	mnv9Comment
 hi def link mnv9EnumValueListCommaComment	mnv9Comment
 hi def link mnv9Export	mnvCommand
 hi def link mnv9Extends	Keyword
 hi def link mnv9Final	mnvCommand
 hi def link mnv9For	mnvCommand
 hi def link mnv9ForInComment	mnv9Comment
 hi def link mnv9Implements	Keyword
 hi def link mnv9AbstractDef	mnvCommand
 hi def link mnv9Interface	mnvCommand
 hi def link mnv9LambdaOperator	mnvOper
 hi def link mnv9LambdaOperatorComment	mnv9Comment
 hi def link mnv9LambdaParen	mnvParenSep
 hi def link mnv9LhsRegister	mnvLetRegister
 hi def link mnv9LhsVariable	mnvVar
 hi def link mnv9LineComment	mnvComment
 hi def link mnv9MethodDef	mnvCommand
 hi def link mnv9MethodDefComment	mnvDefComment
 hi def link mnv9MethodNameError	mnvFunctionError
 hi def link mnv9Null	Constant
 hi def link mnv9Public	mnvCommand
 hi def link mnv9Search	mnvString
 hi def link mnv9SearchDelim	Delimiter
 hi def link mnv9Static	mnvCommand
 hi def link mnv9Super	Identifier
 hi def link mnv9This	Identifier
 hi def link mnv9Type	mnvCommand
 hi def link mnv9TypeEquals	mnvOper
 hi def link mnv9Variable	mnvVar
 hi def link mnv9VariableType	mnvType
 hi def link mnv9VariableTypeAny	mnvTypeAny
 hi def link mnv9VariableTypeObject	mnvTypeObject
 hi def link mnv9VariableTypeObjectBracket	mnvTypeObjectBracket
 hi def link mnv9Var	mnvCommand
 hi def link mnv9MNV9ScriptArg	Special
 hi def link mnv9MNV9Script	mnvCommand

 hi def link mnvCompilerSet	mnvCommand
 hi def link mnvSynColor mnvCommand
 hi def link mnvSynLink mnvCommand
 hi def link mnvSynMenu	mnvCommand
 hi def link mnvSynMenuPath	mnvMenuName
endif

" Current Syntax Variable: {{{2
let b:current_syntax = "mnv"

" ---------------------------------------------------------------------
" Cleanup: {{{1
delc MNV9
delc MNVL
delc MNVFolda
delc MNVFoldc
delc MNVFolde
delc MNVFoldf
delc MNVFoldh
delc MNVFoldH
delc MNVFoldi
delc MNVFoldl
delc MNVFoldm
delc MNVFoldp
delc MNVFoldP
delc MNVFoldr
delc MNVFoldt
let &cpo = s:keepcpo
unlet s:keepcpo s:mnv9script
" mnv:ts=18 fdm=marker ft=mnv