├── tools ├── README.md └── GenerateImport.vim ├── README.md └── import ├── vim9SyntaxUtil.vim └── vim9Language.vim /tools/README.md: -------------------------------------------------------------------------------- 1 | This script must be used to generate/update the import file: 2 | 3 | import/vim9Language.vim 4 | 5 | To do so, run this shell command while in the `tools/` directory: 6 | 7 | $ vim -Nu NONE +'set runtimepath=' -S GenerateImport.vim 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Syntax plugin for Vim9. Work in progress. 2 | 3 | # Configuration 4 | 5 | The highlighting can be controlled via keys in the dictionary `g:vim9_syntax`: 6 | 7 | - `builtin_functions` controls whether builtin functions are highlighted (`true` by default) 8 | - `data_types` controls whether Vim9 data types in declarations are highlighted (`true` by default) 9 | - `user_types` controls whether user types are highlighted (`:help :type`; `false` by default) 10 | - `errors` controls whether some possible mistakes are highlighted 11 | - `fenced_languages` is a list of languages which should be highlighted with their own syntax when included inside fenced codeblocks (empty list by default) 12 | 13 | `g:vim9_syntax.errors` is a nested dictionary containing these keys: 14 | 15 | - `event_wrong_case` controls whether names of events in autocmds are highlighted as errors, if they don't have the same case as in the help (`false` by default) 16 | - `octal_missing_o_prefix` controls whether an octal number prefixed with `0` instead of `0o` is highlighted as an error (`false` by default) 17 | - `range_missing_space` controls whether no space between a line specifier and a command is highlighted as an error (`false` by default) 18 | - `range_missing_specifier` controls whether an implicit line specifier is highlighted as an error (`false` by default) 19 | - `strict_whitespace` controls whether missing/superfluous whitespace is highlighted as an error (`true` by default) 20 | 21 | Example of configuration: 22 | 23 | g:vim9_syntax = { 24 | builtin_functions: true, 25 | data_types: false, 26 | user_types: false, 27 | fenced_languages: ['lua', 'python'], 28 | errors: { 29 | event_wrong_case: false, 30 | octal_missing_o_prefix: false, 31 | range_missing_space: false, 32 | range_missing_specifier: false, 33 | strict_whitespace: true, 34 | } 35 | } 36 | 37 | # Requirements 38 | 39 | A recent Vim version. 40 | 41 | # Installation 42 | ## Linux 43 | 44 | Run this shell command: 45 | 46 | git clone https://github.com/lacygoill/vim9-syntax.git ~/.vim/pack/vim9-syntax/opt/vim9-syntax 47 | 48 | Then, add this line in your vimrc: 49 | 50 | packadd! vim9-syntax 51 | 52 | ## Windows 53 | 54 | Run this shell command: 55 | 56 | git clone https://github.com/lacygoill/vim9-syntax.git %USERPROFILE%\vimfiles\pack\vim9-syntax\opt\vim9-syntax 57 | 58 | Then, add this line in your vimrc: 59 | 60 | packadd! vim9-syntax 61 | 62 | -------------------------------------------------------------------------------- /import/vim9SyntaxUtil.vim: -------------------------------------------------------------------------------- 1 | vim9script 2 | 3 | # Interface {{{1 4 | export def Derive( # {{{2 5 | new_group: string, 6 | from: string, 7 | new_attrs: dict, 8 | ) 9 | # Purpose:{{{ 10 | # 11 | # Derive a new syntax group (`new_group`) from an existing one (`from`), 12 | # overriding some attributes (`new_attrs`). 13 | #}}} 14 | # Usage Examples:{{{ 15 | # 16 | # To define `CommentUnderlined` with the same attributes as `Comment`, resetting 17 | # the `term`, `cterm`, and `gui` attributes with the value `underline`: 18 | # 19 | # Derive('CommentUnderlined', 'Comment', {gui: {bold: true}, term: {bold: true}, cterm: {bold: true}}) 20 | # 21 | # To define `PopupSign` with the same attributes as `WarningMsg`, resetting the 22 | # `guibg` or `ctermbg` attributes with the colors of the `Normal` HG: 23 | # 24 | # Derive('PopupSign', 'WarningMsg', {bg: 'Normal'}) 25 | #}}} 26 | 27 | var from_def: dict = hlget(from, true)->get(0, {}) 28 | if from_def->get('cleared') 29 | return 30 | endif 31 | highlights->add(from_def->extend({name: new_group, default: true})->extend(new_attrs)) 32 | highlights->hlset() 33 | 34 | # Make sure the derived highlight groups persist even if the color scheme 35 | # changes, and the Vim syntax plugin is not re-sourced. 36 | autocmd_add([{ 37 | cmd: 'highlights->hlset()', 38 | event: 'ColorScheme', 39 | group: 'DeriveHighlightGroups', 40 | once: true, 41 | pattern: '*', 42 | replace: true, 43 | }]) 44 | enddef 45 | 46 | var highlights: list> 47 | 48 | export def HighlightUserTypes() # {{{2 49 | var buf: number = bufnr('%') 50 | 51 | # remove existing text properties to start from a clean state 52 | if prop_type_list({bufnr: buf})->index('vi9UserType') >= 0 53 | {type: 'vi9UserType', bufnr: buf, all: true} 54 | ->prop_remove(1, line('$')) 55 | endif 56 | # add property type 57 | if prop_type_get('vi9UserType', {bufnr: buf}) == {} 58 | prop_type_add('vi9UserType', {highlight: 'Type', bufnr: buf}) 59 | endif 60 | 61 | var pat: string = '\%(^\|[^|]|\)\s*\%(' 62 | # `:help :type` 63 | .. 'type' 64 | # `:help :enum` 65 | .. '\|' .. 'enum' 66 | # `:help Vim9-using-interface` 67 | # > The interface name can be used as a type: 68 | # A class can also be used as a type: 69 | # https://github.com/vim/vim/commit/eca2c5fff6f6ccad0df8824c4b4354d3f410d225 70 | .. '\|' .. '\%(export\s\+\)\=interface' 71 | .. '\|' .. '\%(\%(export\|abstract\|export\s\+abstract\)\s\+\)\=class' 72 | .. '\)\s\+\zs\u\w*' 73 | var lines: list = getline(1, '$') 74 | var user_type: string = lines 75 | ->copy() 76 | ->map((_, line: string) => line->matchstr(pat)) 77 | ->filter((_, type: string): bool => type != '') 78 | ->sort() 79 | ->uniq() 80 | ->join('\|') 81 | if user_type == '' 82 | return 83 | endif 84 | 85 | user_type = $'\zs\%({user_type}\)\ze' 86 | # def Func(obj1: UserType, obj2: UserType): UserType 87 | # ^------^ ^------^ ^------^ 88 | # var Lambda = (): UserType => ... 89 | # ^------^ 90 | user_type = $':\s\+{user_type}\%([,)[:blank:]]\|$\)' 91 | # var x: list 92 | # ^------^ 93 | .. $'\|<{user_type}>' 94 | # var x: func(..., UserType, ...) 95 | # ^------^ 96 | .. $'\|func(\%(\%(\.\.\.\|?\)\=\w*,\s*\)*{user_type}\%(,\s*\%(\.\.\.\|?\)\=\w*\)*)' 97 | 98 | # let's find out the positions of all the user types 99 | var pos: list> 100 | # iterate over the lines of the buffer 101 | for [lnum: number, line: string] in lines->items() 102 | var old_start: number = -1 103 | # iterate over user types on a given line 104 | while true 105 | # look for a user type name 106 | var [_, start: number, end: number] = 107 | matchstrpos(line, user_type, old_start + 1) 108 | 109 | # bail out if there aren't (anymore) 110 | if start == -1 111 | break 112 | endif 113 | 114 | # remember where the last user type started (useful in the next 115 | # iteration to find the next user type on the same line) 116 | old_start = start 117 | 118 | # ignore a user type inside a comment or a string 119 | if InCommentOrString(lnum + 1, start) 120 | continue 121 | endif 122 | 123 | # save position of text property 124 | pos->add([lnum + 1, start, lnum + 1, end + 1]) 125 | endwhile 126 | endfor 127 | 128 | # finally, add text properties 129 | prop_add_list({bufnr: buf, type: 'vi9UserType'}, pos) 130 | enddef 131 | # }}}1 132 | # Util {{{1 133 | def InCommentOrString(lnum: number, col: number): bool # {{{2 134 | return synstack(lnum, col) 135 | ->indexof((_, id: number): bool => 136 | synIDattr(id, 'name') =~ '\ccomment\|string\|heredoc') >= 0 137 | enddef 138 | -------------------------------------------------------------------------------- /tools/GenerateImport.vim: -------------------------------------------------------------------------------- 1 | vim9script noclear 2 | 3 | if $MYVIMRC != '' 4 | var sfile: string = expand(':t') 5 | var msg: list =<< trim eval END 6 | This script must be sourced without any custom configuration: 7 | 8 | $ vim -Nu NONE -S {sfile} 9 | END 10 | popup_notification(msg, {pos: 'center'}) 11 | finish 12 | endif 13 | 14 | # Declarations {{{1 15 | 16 | const ABBREV_CMDS: list =<< trim END 17 | abbreviate 18 | abclear 19 | cabbrev 20 | cabclear 21 | cnoreabbrev 22 | cunabbrev 23 | iabbrev 24 | iabclear 25 | inoreabbrev 26 | iunabbrev 27 | noreabbrev 28 | unabbreviate 29 | END 30 | 31 | const CONTROL_FLOW_CMDS: list =<< trim END 32 | if 33 | else 34 | elseif 35 | endif 36 | for 37 | endfor 38 | while 39 | endwhile 40 | try 41 | catch 42 | finally 43 | throw 44 | endtry 45 | return 46 | break 47 | continue 48 | finish 49 | END 50 | 51 | const DECLARE_CMDS: list =<< trim END 52 | const 53 | final 54 | unlet 55 | var 56 | END 57 | 58 | const DEPRECATED_CMDS: list =<< trim END 59 | append 60 | change 61 | insert 62 | k 63 | let 64 | mode 65 | open 66 | t 67 | xit 68 | END 69 | 70 | const DO_CMDS: list =<< trim END 71 | argdo 72 | bufdo 73 | cdo 74 | cfdo 75 | ldo 76 | lfdo 77 | tabdo 78 | windo 79 | END 80 | 81 | # :vim9cmd echo getcompletion('*map', 'command')->filter((_, v) => v =~ '^[a-z]' && v != 'loadkeymap') 82 | const MAPPING_CMDS: list =<< trim END 83 | map 84 | cmap 85 | imap 86 | lmap 87 | nmap 88 | omap 89 | smap 90 | tmap 91 | vmap 92 | xmap 93 | cnoremap 94 | inoremap 95 | lnoremap 96 | nnoremap 97 | noremap 98 | onoremap 99 | snoremap 100 | tnoremap 101 | vnoremap 102 | xnoremap 103 | cunmap 104 | iunmap 105 | lunmap 106 | nunmap 107 | ounmap 108 | sunmap 109 | tunmap 110 | unmap 111 | vunmap 112 | xunmap 113 | cmapclear 114 | imapclear 115 | lmapclear 116 | mapclear 117 | nmapclear 118 | omapclear 119 | smapclear 120 | tmapclear 121 | vmapclear 122 | xmapclear 123 | END 124 | 125 | # :helpgrep ^:\%({command}\|{cmd}\) 126 | const MODIFIER_CMDS: list =<< trim END 127 | aboveleft 128 | belowright 129 | botright 130 | browse 131 | confirm 132 | hide 133 | keepalt 134 | keepjumps 135 | keepmarks 136 | keeppatterns 137 | leftabove 138 | legacy 139 | lockmarks 140 | noautocmd 141 | noswapfile 142 | rightbelow 143 | sandbox 144 | silent 145 | tab 146 | topleft 147 | unsilent 148 | verbose 149 | vertical 150 | vim9cmd 151 | END 152 | 153 | const OOP: list =<< trim END 154 | class 155 | endclass 156 | interface 157 | endinterface 158 | enum 159 | endenum 160 | abstract 161 | public 162 | static 163 | type 164 | END 165 | 166 | const VARIOUS_SPECIAL_CMDS: list =<< trim END 167 | augroup 168 | autocmd 169 | command 170 | cd 171 | chdir 172 | lcd 173 | lchdir 174 | tcd 175 | tchdir 176 | copy 177 | digraphs 178 | doautoall 179 | doautocmd 180 | echohl 181 | export 182 | filetype 183 | global 184 | vglobal 185 | highlight 186 | import 187 | lua 188 | luado 189 | mark 190 | move 191 | normal 192 | perl 193 | perldo 194 | python 195 | python3 196 | pythonx 197 | pydo 198 | py3do 199 | pyxdo 200 | ruby 201 | rubydo 202 | set 203 | setglobal 204 | setlocal 205 | substitute 206 | syntax 207 | tcl 208 | tcldo 209 | vimgrep 210 | vimgrepadd 211 | lvimgrep 212 | lvimgrepadd 213 | wincmd 214 | z 215 | END 216 | 217 | const SPECIAL_CMDS: list = 218 | ABBREV_CMDS 219 | + CONTROL_FLOW_CMDS 220 | + DECLARE_CMDS 221 | + DEPRECATED_CMDS 222 | + DO_CMDS 223 | + MAPPING_CMDS 224 | + MODIFIER_CMDS 225 | + OOP 226 | + VARIOUS_SPECIAL_CMDS 227 | 228 | # Util Functions {{{1 229 | def Shorten( #{{{2 230 | to_shorten: list, 231 | for_match: bool = false 232 | ): list 233 | 234 | var shortened: list 235 | for cmd: string in to_shorten 236 | var len: number 237 | for l: number in strcharlen(cmd)->range()->reverse() 238 | if l == 0 239 | continue 240 | endif 241 | if cmd->slice(0, l)->fullcommand() != cmd 242 | len = l 243 | break 244 | endif 245 | endfor 246 | if len == cmd->strcharlen() - 1 247 | shortened->add(cmd) 248 | else 249 | shortened->add(printf( 250 | '%s%s[%s]', 251 | cmd[: len], 252 | for_match ? '\%' : '', 253 | cmd[len + 1 :] 254 | )) 255 | endif 256 | endfor 257 | return shortened 258 | enddef 259 | 260 | def AppendSection(what: string, match_rule = false) #{{{2 261 | # `match_rule` is on when we want the import file to join the items in a heredoc 262 | # with `\|`, instead of a space; which is necessary for `:syntax match` rules. 263 | 264 | # The `:if` block decides whether we want to write a simple string or a heredoc. 265 | # For some tokens, we just want to write a (possibly complex) regex:{{{ 266 | # 267 | # export const command_can_be_before: string = '...' 268 | #}}} 269 | # For other tokens, we want to write a (possibly long) list of names, via a heredoc:{{{ 270 | # 271 | # const builtin_func_list: list =<< trim END 272 | # abs 273 | # acos 274 | # add 275 | # ... 276 | # END 277 | # export const builtin_func: string = builtin_func_list->join() 278 | # 279 | # A heredoc makes it easier to review a list and check whether it contains 280 | # anything wrong. In particular if it's sorted. 281 | #}}} 282 | 283 | var lines: list = ['', '# ' .. what .. ' {{' .. '{1', ''] 284 | if what->eval()->typename() =~ '^list' 285 | lines += ['const ' .. what .. '_list: list =<< trim END'] 286 | + eval(what) 287 | # to suppress `E741: Value is locked: map() argument` 288 | ->copy() 289 | ->map((_, v: string): string => ' ' .. v) 290 | + ['END', ''] 291 | + ['export const ' .. what .. ': string = ' 292 | .. what .. '_list->join(' .. (match_rule ? '"\\|"' : '') .. ')'] 293 | else 294 | lines->add('export const ' .. what .. ': string = ' .. eval(what)->string()) 295 | endif 296 | lines->writefile(IMPORT_FILE, 'a') 297 | enddef 298 | 299 | #}}}1 300 | # Exported Variables {{{1 301 | # regexes {{{2 302 | # command_can_be_before {{{3 303 | 304 | # This regex should make sure that we're in a position where an Ex command could 305 | # appear right before. 306 | # Warning: Do *not* consume any token.{{{ 307 | # 308 | # Only use lookarounds to assert something about the current position. 309 | # If you consume a token, and it turns out that it's indeed a command, then – 310 | # to highlight it – you'll need to include a syntax group: 311 | # 312 | # set option=value 313 | # ^^^ 314 | # vi9Set ⊂ vi9MayBeCmd 315 | # 316 | # This creates a stack which might be problematic for a group defined with 317 | # `nextgroup=`. Suppose that `B ⊂ A`: 318 | # 319 | # BBB 320 | # AAAAAAAAA 321 | # 322 | # And you want `C` to match after `B`, so you define the latter like this: 323 | # 324 | # syntax ... B ... nextgroup=C 325 | # 326 | # If `C` goes beyond `A`, Vim will extend the latter: 327 | # 328 | # BBBCCCCCC 329 | # AAAAAAAAAAAA 330 | # ^^^ 331 | # extended 332 | # 333 | # That's because Vim wants `C` to be contained in `A`, just like its neighbor 334 | # `B`. But that fails if `B` has consumed the end of `A`: 335 | # 336 | # BBB 337 | # AAAAAAAAA 338 | # ^ 339 | # ✘ 340 | # 341 | # Here, Vim won't match `C` after `B`, because it would need to extend `A`; but 342 | # it can't, because it has reached its end: there's nothing left to extend. 343 | # 344 | # In practice, it means that you wouldn't be able to highlight arguments of 345 | # complex commands (like `:autocmd` or `:syntax`). There might be some 346 | # workarounds, but they come with their own pitfalls, and add too much 347 | # complexity. 348 | #}}} 349 | 350 | const command_can_be_before: string = 351 | # after a command, we know there must be some whitespace 352 | '\%(' 353 | .. '[[:blank:]\n]\@=' 354 | .. '\|' 355 | # Special Case: An Ex command in the RHS of a mapping, right after `` or ``. 356 | .. '\c<\%(bar\|cr\)>' 357 | .. '\)' 358 | # but there must *not* be a binary operator 359 | # Warning: Try not to break the highlighting of a command whose first argument is the register `=`.{{{ 360 | # 361 | # That's why it's important to match a space after `=`; so that `:put` is 362 | # correctly highlighted when used to put an expression: 363 | # 364 | # put =1 + 2 365 | # 366 | # But not when used as a variable name: 367 | # 368 | # var put: number 369 | # put = 1 + 2 370 | #}}} 371 | .. '\%(' 372 | .. '\s*\%([-+*/%]=\|=\s\|=<<\|\.\.=\)' 373 | .. '\|' 374 | .. '\_s*\%(' 375 | .. '->' 376 | .. '\|' 377 | .. '[-+*/%]' 378 | # Need to match at least 1 space to avoid breaking the highlighting of a pattern passed as argument to a command.{{{ 379 | # 380 | # Example: 381 | # 382 | # catch /pattern/ 383 | # 384 | # This does mean that the pattern can't start with a space, but IMO it's a 385 | # corner case which doesn't warrant a fix (at least for now). We can still 386 | # write `\s` instead. 387 | # 388 | # ✘ 389 | # v 390 | # catch / pattern/ 391 | # catch /\spattern/ 392 | # ^^ 393 | # ✔ 394 | # 395 | # Or, if we *really* want a space, and not a tab, we can write `[ ]`. 396 | # 397 | # catch /[ ]pattern/ 398 | # ^^^ 399 | #}}} 400 | .. '\%(\s\+\)\@>' 401 | # necessary to be able to match `source` in `source % | eval 0` or `source % eval 0` 402 | .. '[^|<]' 403 | .. '\)' 404 | .. '\)\@!' 405 | 406 | # increment_invalid {{{3 407 | 408 | # This regex should match an increment/decrement operator used with an invalid expression.{{{ 409 | # 410 | # For example: 411 | # 412 | # ++Func() 413 | # ^----^ 414 | # ✘ 415 | #}}} 416 | 417 | const increment_invalid: string = '\%(++\|--\)' 418 | # let's assert what should *not* be matched 419 | .. '\%(' 420 | # that is, anything that is valid 421 | .. '\%(' 422 | # a simple variable identifier (`++name`) 423 | .. '\%([bgstvw]:\)\=\h\w*' 424 | # or an option name (`++&shiftwidth`) 425 | .. '\|' 426 | .. '&\%([lg]:\)\=[a-z]\{2,}' 427 | .. '\)' 428 | # it must be at the end of a line, or followed by a bracket/bar/dot/number sign{{{ 429 | # 430 | # # bracket 431 | # v 432 | # ++list[0] 433 | # ^-----^ 434 | # ✔ 435 | # 436 | # # bar 437 | # v 438 | # ++name | ... 439 | # 440 | # # dot 441 | # v 442 | # ++dict.key 443 | # ^------^ 444 | # ✔ 445 | # 446 | # # number sign 447 | # v 448 | # ++num # inline comment 449 | # ^---^ 450 | # ✔ 451 | # 452 | # We don't try to describe what follows the bracket or dot, because it seems 453 | # too complex. IOW, our regex is not perfect, but should be good enough 454 | # most of the time. 455 | #}}} 456 | .. '\s*\_[[|.#]' 457 | .. '\)\@!' 458 | 459 | # lambda_start, lambda_end {{{3 460 | 461 | # closing paren of arguments: 462 | # 463 | # var Lambda = (a, b) => a + b 464 | # ^ 465 | 466 | const lambda_end: string = ')' 467 | # start a lookbehind to assert the presence of the necessary arrow 468 | .. '\ze' 469 | # there could be a return type before 470 | .. '\%(:.\{-}\)\=' 471 | # the arrow 472 | # var Lambda = (a, b) => a + b 473 | # ^^ 474 | .. '\s\+=>' 475 | 476 | # opening paren of arguments: 477 | # 478 | # var Lambda = (a, b) => a + b 479 | # ^ 480 | const lambda_start: string = '(' 481 | # start a lookbehind to assert the presence of arguments 482 | .. '\ze' 483 | # start a group to make the arguments optional 484 | .. '\%(' 485 | # first argument 486 | .. '\s*\h\w*' 487 | # what follows can be complex 488 | .. '\%(' 489 | # for now, we just say that it's not an opening paren 490 | .. '[^(]' 491 | .. '\|' 492 | # or if it is, it must be preceded by `func` (used as a type) 493 | .. '\%(\map((_, v) => ... 509 | # ^ 510 | # ✔ 511 | # 512 | # ✘ 513 | # v 514 | # (l1 + l2)->map((_, v) => 0) 515 | # ^ 516 | # ✔ 517 | # 518 | # ✘ 519 | # v-------------v 520 | # Foo(name)->Bar((v) => v) 521 | # ^------^ 522 | # ✔ 523 | # 524 | # ✘ 525 | # v--------v 526 | # substitute(a, b, (m) => '', '') 527 | # ^^^ 528 | # ✔ 529 | # 530 | # range(123)->map((..._) => v + 1) 531 | # ^--^ 532 | # should be highlighted as an argument 533 | # 534 | # Also: 535 | # 536 | # echo ((): number => 0)() 537 | # ^----^ 538 | # this should be highlighted as a data type 539 | # 540 | # This is a special case, because the lambda has no arguments, and is contained 541 | # inside another syntax item (`vi9OperParen`). 542 | #}}} 543 | 544 | # legacy autoload invalid {{{3 545 | 546 | # In a Vim9 autoload script, when declaring an autoload function, we cannot 547 | # write `path#to#script#Func()`; `:export` must be used instead: 548 | # 549 | # ✘ 550 | # def path#to#script#Func() 551 | # 552 | # ✔ 553 | # export def Func() 554 | # 555 | # Let's highlight the old way as an error. 556 | # 557 | # --- 558 | # 559 | # Note that we use the `*` quantifier at the end, and not `+`. 560 | # That's because in legacy, it is allowed for an autoload 561 | # function name to be empty: 562 | # 563 | # def path#to#script#() 564 | # ^ 565 | # 566 | # We want to catch the error no matter what. 567 | 568 | const legacy_autoload_invalid: string = '\h\w*#\%(\w\|#\)*' 569 | 570 | # logical_not {{{3 571 | 572 | # This regex should match most binary operators. 573 | 574 | const logical_not: string = '/' 575 | # Don't highlight `!` when used after a command name:{{{ 576 | # 577 | # packadd! 578 | # ^ 579 | # 580 | # Note that we still want to highlight `!` when preceded by a paren: 581 | # 582 | # echo 'aaa' .. (!empty(...) ? ... : ...) 583 | # ^^ 584 | # }}} 585 | .. '\w\@10-9"^.(){}]' 599 | 600 | # maybe_dict_literal_key {{{3 601 | 602 | # This should match a sequence of non-whitespace which could be written where 603 | # a literal key in a dictionary is expected. 604 | # It should not match a valid key, because we want to highlight possible errors. 605 | 606 | const maybe_dict_literal_key: string = '/' 607 | # Start of positive lookbehind.{{{ 608 | # 609 | # Actually, it's not entirely correct. This would be simpler and better: 610 | # 611 | # \%([\n{,]\s*\)\@<= 612 | # 613 | # But it would also be more expensive (10x last time I checked). 614 | # Which doesn't seem like a big deal, because the regex is not used that 615 | # often; but still, for the moment, let's try an optimized regex. 616 | # 617 | # --- 618 | # 619 | # As an example, this lookbehind prevents the highlighting of `2` here: 620 | # 621 | # var d = { 622 | # key: 1 ? 2: 3 623 | # } 624 | # 625 | # But not here: 626 | # 627 | # var d = { 628 | # key: 1 ? 2: 3 629 | # } 630 | # 631 | # Note that both of these snippets are wrong, because `:` should be preceded 632 | # by a space. Still, this is a common temporary mistake; when it occurs, it 633 | # might be distracting to see a token (like a number) wrongly highlighted as 634 | # a string. 635 | #}}} 636 | .. '\%(' 637 | # there must be the start of a line or the start of a dictionary before a key 638 | .. '[{\n]' 639 | .. '\|' 640 | # Or there must be some space.{{{ 641 | # 642 | # But if there is, it should not preceded by a non-whitespace, unless it's a 643 | # comma (separating items), a curly brace (start of dictionary), or a 644 | # backslash (continuation line). 645 | #}}} 646 | .. '[^[:blank:]\n,{\\]\@1>' 672 | # comparison operators 673 | .. '\|' .. '\%(' .. '[=!]=\|[<>]=\=\|[=!]\~\|is\|isnot' .. '\)' 674 | # optional modifier to respect or ignore the case 675 | .. '[?#]\=' 676 | .. '\)' 677 | # there must be a whitespace after 678 | .. '\_s\@=' 679 | # There should be an expression after.{{{ 680 | # 681 | # But an expression cannot start with a bar, nor with `<`. 682 | # It's most probably a special argument to some command: 683 | # 684 | # v 685 | # Cmd + | eval 0 686 | # nnoremap Cmd + eval 0 687 | # ^ 688 | #}}} 689 | .. '\%(\s*[|<]\)\@!' 690 | .. '"' 691 | 692 | # pattern_delimiter {{{3 693 | 694 | const pattern_delimiter: string = 695 | # let's discard invalid delimiters 696 | '[^' 697 | # Warning: keep this part at the start, so that `-` is not parsed as in `a-z`. 698 | # Ambiguity with `->` method call.{{{ 699 | # 700 | # Suppose you have a variable named `g`, to which you apply a method call: 701 | # 702 | # this is not the global command 703 | # ✘ 704 | # v 705 | # g->substitute('-', '', '') 706 | # ^ ^ 707 | # ✘ ✘ 708 | # those are not delimiters around a pattern 709 | # 710 | # `g` would be confused with the global command, and the dashes with delimiters 711 | # around its pattern. 712 | #}}} 713 | .. '-' 714 | # Ambiguity with assignment operators.{{{ 715 | # 716 | # Example: 717 | # 718 | # var s: number = 40 719 | # 720 | # pat rep flags 721 | # v---v vvv vv 722 | # s /= 20 / 2 / 2 723 | # ^ ^ ^ 724 | # delimiters 725 | # 726 | # The last line could be wrongly highlighted as a substitution command. 727 | # In reality, it's a number assignment which does this: 728 | # 729 | # s /= 20 / 2 / 2 730 | # ⇔ 731 | # s /= 10 / 2 732 | # ⇔ 733 | # s /= 5 734 | # ⇔ 735 | # s = s / 5 736 | # ⇔ 737 | # s = 40 / 5 738 | # ⇔ 739 | # s = 8 740 | #}}} 741 | .. '+*/%.' 742 | # Ambiguity with `:` used as separator between namespace and variable name.{{{ 743 | # 744 | # g:pattern:command 745 | # g:variable 746 | # 747 | # See `:help vim9-gotchas`. 748 | # 749 | # Don't try to be smart and find a fix for this. 750 | # It's trickier than it seems. 751 | # For example: 752 | # 753 | # g:a+b:command 754 | # ^ 755 | # 756 | # This is a valid global command, because there is no ambiguity with a global 757 | # variable; thanks to `+` which is a non word character. 758 | # But watch this: 759 | # 760 | # g:name = {key: 'value'} 761 | # ^---------^ 762 | # this is not a pattern 763 | # 764 | # I don't think it's possible for a simple regex to determine the nature of what 765 | # follows `g:`: a pattern vs a variable name. 766 | #}}} 767 | .. ':' 768 | # Not reliable:{{{ 769 | # 770 | # $ vim -Nu NONE +'vim9cmd g #pat# ls' 771 | # Pattern not found: pat˜ 772 | # ✔ 773 | # 774 | # $ vim -Nu NONE +'vim9cmd filter #pat# ls' 775 | # E476: Invalid command: vim9 filter #pat# ls˜ 776 | # ✘ 777 | # 778 | # Besides, let's be consistent; if in legacy, the comment leader doesn't 779 | # work, that should remain true in Vim9. 780 | #}}} 781 | .. '#' 782 | # a delimiter cannot be a whitespace (obviously) 783 | .. ' \t' 784 | # `:help pattern-delimiter` 785 | # In Vim9, `"` is still not a valid delimiter:{{{ 786 | # 787 | # ['aba bab']->repeat(3)->setline(1) 788 | # silent! substitute/nowhere// 789 | # :% s"b"B"g 790 | # E486: Pattern not found: nowhere˜ 791 | #}}} 792 | .. '[:alnum:]\"|' 793 | # end of assertion 794 | .. ']\@=' 795 | # now we have the guarantee that the next character (whatever it is) is a valid delimiter 796 | .. '.' 797 | # We still want to support a few delimiters (especially the popular `/`).{{{ 798 | # 799 | # But for these, we need to make sure that the start of the pattern won't 800 | # cause any trouble. Mainly, we need to assert that it can't be confused 801 | # with an assignment operator (nor a method call). 802 | #}}} 803 | # We could support `.`, but we don't, because it's too tricky.{{{ 804 | # 805 | # .. '\|' .. '\.\%(\.=\s\)\@!' 806 | # 807 | # Test against this: 808 | # 809 | # s.key ..= 'xxx' 810 | # ^ ^^ 811 | # 812 | # `s` would be wrongly matched as `:substitute`, and the dots as its pattern delimiters. 813 | # In reality, `s` is a dictionary. 814 | #}}} 815 | .. '\|' .. '->\@!\%(=\s\)\@!' 816 | .. '\|' .. '[+*/%]\%(=\s\)\@!' 817 | 818 | # option_can_be_after {{{3 819 | 820 | # This regex should make sure that we're in a position where a Vim option could 821 | # appear right after. 822 | 823 | const option_can_be_after: string = '\%(\%(' 824 | .. '^' 825 | .. '\|' 826 | .. '[' 827 | # Support the increment and decrement operators (`--` and `++`).{{{ 828 | # 829 | # Example: 830 | # 831 | # ++&l:foldlevel 832 | # ^^ 833 | #}}} 834 | .. '-+' 835 | .. ' \t!([' 836 | # Support an option after `` or `Bar`.{{{ 837 | # 838 | # Example: 839 | # 840 | # nnoremap &operatorfunc = Opfuncg@ 841 | # ^-----------^ 842 | #}}} 843 | .. '>' 844 | .. ']' 845 | .. '\)\@1<=' 846 | .. '\|' 847 | # support an expression in an `eval` heredoc 848 | .. '{\@1<=' 849 | .. '\)' 850 | 851 | # option_modifier {{{3 852 | 853 | # This regex should make sure that we're in a position where a Vim option could 854 | # appear right after. 855 | 856 | const option_modifier: string = 857 | '\%(' 858 | .. '&\%(vim\)\=' 859 | .. '\|' 860 | .. '[ set wrap eval 0 + 0 865 | # ^ 866 | # this is not a modifier which applies to 'wrap'; 867 | # this is the start of the Vim keycode 868 | #}}} 869 | .. '\%(\_s\||\)\@=' 870 | 871 | # option_sigil {{{3 872 | 873 | # sigil to refer to option value 874 | 875 | const option_sigil: string = '&\%([gl]:\)\=' 876 | 877 | # option_valid {{{3 878 | 879 | # This regex should make sure that we're matching valid characters for a Vim 880 | # option name. 881 | 882 | const option_valid: string = '\%(' 883 | # name of regular option 884 | .. '[a-z]\{2,}\>' 885 | .. '\|' 886 | # name of terminal option 887 | .. 't_[a-zA-Z0-9#%*:@_]\{2}' 888 | .. '\)' 889 | 890 | # wincmd_valid {{{3 891 | 892 | # This regex should make sure that we're giving a valid argument to `:wincmd`. 893 | 894 | def WincmdValid(): string 895 | var cmds: list = getcompletion('^w', 'help') 896 | ->filter((_, v: string): bool => v =~ '^CTRL-W_..\=$') 897 | ->map((_, v: string) => v->matchstr('CTRL-W_\zs.*')) 898 | ->sort() 899 | ->uniq() 900 | 901 | var one_char_cmds: list = cmds 902 | ->copy() 903 | ->filter((_, v: string): bool => v->len() == 1) 904 | var two_char_cmds: list = cmds 905 | ->copy() 906 | ->filter((_, v: string): bool => v->len() == 2) 907 | 908 | # `|` is missing 909 | one_char_cmds->add('|') 910 | 911 | for problematic: string in ['-', ']'] 912 | one_char_cmds->remove(one_char_cmds->index(problematic)) 913 | endfor 914 | 915 | return '/' 916 | .. '\s\@1<=' 917 | .. '\%(' 918 | # when including back the valid `-` and `]` commands, 919 | # we need to make sure they don't break the regex 920 | .. '[' .. '-\]' .. one_char_cmds->join('') .. ']' 921 | .. '\|' 922 | .. two_char_cmds->join('\|') 923 | .. '\)' 924 | .. '\_s\@=' 925 | .. '/' 926 | enddef 927 | 928 | const wincmd_valid: string = WincmdValid() 929 | #}}}2 930 | # names {{{2 931 | # builtin_func {{{3 932 | 933 | def Ambiguous(): list 934 | var cmds: list = getcompletion('', 'command') 935 | ->filter((_, v: string): bool => v =~ '^[a-z]') 936 | var funcs: list = getcompletion('', 'function') 937 | ->map((_, v: string) => v->substitute('()\=', '', '$')) 938 | var ambiguous: list 939 | for func: string in funcs 940 | if cmds->index(func) != -1 941 | ambiguous->add(func) 942 | endif 943 | endfor 944 | return ambiguous 945 | enddef 946 | 947 | const ambiguous: list = Ambiguous() 948 | 949 | const builtin_func: list = getcompletion('', 'function') 950 | # keep only builtin functions 951 | ->filter((_, v: string): bool => v[0] =~ '[a-z]' && v !~ '#') 952 | # remove noisy trailing parens 953 | ->map((_, v: string) => v->substitute('()\=$', '', '')) 954 | # if a function name can also be parsed as an Ex command, remove it 955 | ->filter((_, v: string): bool => ambiguous->index(v) == - 1) 956 | # those functions are missing because they don't work in our Vim build: 957 | # https://github.com/vim/vim/commit/90c2353365c5da40dec01b09e1f482983cf7f55d 958 | + ['debugbreak', 959 | 'luaeval', 960 | 'mzeval', 961 | 'perleval', 962 | 'pyeval', 963 | 'rubyeval'] 964 | 965 | # builtin_func_ambiguous {{{3 966 | 967 | # Functions whose names can be confused with Ex commands. 968 | # E.g. `:eval` vs `eval()`. 969 | const builtin_func_ambiguous: list = ambiguous 970 | 971 | # collation_class {{{3 972 | 973 | const collation_class: list = 974 | getcompletion('[:', 'help') 975 | ->filter((_, v: string): bool => v =~ '^\[:') 976 | ->map((_, v: string) => v->trim('[]:')) 977 | ->sort() 978 | 979 | # command_address_type {{{3 980 | 981 | const command_address_type: list = getcompletion('command -addr=', 'cmdline') 982 | 983 | # command_complete_type {{{3 984 | 985 | const command_complete_type: list = getcompletion('command -complete=', 'cmdline') 986 | # https://github.com/lacygoill/vim9-syntax/issues/4 987 | ->sort((i: string, j: string): number => j->stridx(i) == 0 ? 1 : -1) 988 | 989 | # command_modifier {{{3 990 | 991 | const command_modifier: list = MODIFIER_CMDS->Shorten(true) 992 | 993 | # command_name {{{3 994 | 995 | def CommandName(): list 996 | var to_shorten: list = getcompletion('', 'command') 997 | ->filter((_, v: string): bool => v =~ '^[a-z]') 998 | for cmd: string in SPECIAL_CMDS 999 | var i: number = to_shorten->index(cmd) 1000 | if i == -1 1001 | continue 1002 | endif 1003 | to_shorten->remove(i) 1004 | endfor 1005 | 1006 | var shortened: list = to_shorten->Shorten() 1007 | 1008 | # this one is missing from `getcompletion()` 1009 | shortened->add('addd') 1010 | 1011 | return shortened 1012 | enddef 1013 | 1014 | const command_name: list = CommandName() 1015 | 1016 | # default_highlighting_group {{{3 1017 | 1018 | def DefaultHighlightingGroup(): list 1019 | var completions: list = getcompletion('hl-', 'help') 1020 | ->map((_, v: string) => v->substitute('^hl-', '', '')) 1021 | for name: string in ['Ignore', 'Conceal', 'User1..9'] 1022 | var i: number = completions->index(name) 1023 | completions->remove(i) 1024 | endfor 1025 | completions += range(2, 8)->map((_, v: number): string => 'User' .. v) 1026 | return completions->sort() 1027 | enddef 1028 | 1029 | const default_highlighting_group: list = DefaultHighlightingGroup() 1030 | 1031 | # event {{{3 1032 | 1033 | const event: list = getcompletion('', 'event') 1034 | 1035 | # ex_special_characters {{{3 1036 | 1037 | # `:help cmdline-special` 1038 | const ex_special_characters: list = 1039 | getcompletion(':<', 'help')[1 :] 1040 | ->map((_, v: string) => v->trim(':<>')) 1041 | 1042 | # key_name {{{3 1043 | 1044 | def KeyName(): list 1045 | var completions: list = getcompletion('set <', 'cmdline') 1046 | ->map((_, v: string) => v->trim('<>')) 1047 | ->filter((_, v: string): bool => v !~ '^t_' && v !~ '^F\d\+$') 1048 | 1049 | # `Nop` and `SID` are missing 1050 | completions->add('Nop')->add('SID') 1051 | # for some reason, `Tab` is suggested twice 1052 | completions->remove(completions->index('Tab')) 1053 | # those keys are special, and need to be handled with dedicated rules 1054 | completions->remove(completions->index('Bar')) 1055 | completions->remove(completions->index('Cmd')) 1056 | 1057 | return completions->sort() 1058 | + ['F\d\{1,2}'] 1059 | # 1060 | # ^^^ 1061 | # Need a broad pattern to support special characters:{{{ 1062 | # 1063 | # 1064 | # ^ 1065 | # 1066 | # ^ 1067 | # 1068 | # ^ 1069 | # 1070 | # ^ 1071 | # 1072 | # ^ 1073 | #}}} 1074 | + ['.'] 1075 | enddef 1076 | 1077 | const key_name: list = KeyName() 1078 | 1079 | # option {{{3 1080 | 1081 | def Option(): list 1082 | var helptags: list 1083 | readfile($VIMRUNTIME .. '/doc/options.txt') 1084 | ->join() 1085 | ->substitute('\*''[a-z]\{2,\}''\*', 1086 | (m: list): string => !!helptags->add(m[0]) ? '' : '', 'g') 1087 | 1088 | var deprecated: list =<< trim END 1089 | *'biosk'* 1090 | *'bioskey'* 1091 | *'consk'* 1092 | *'conskey'* 1093 | *'fe'* 1094 | *'nobiosk'* 1095 | *'nobioskey'* 1096 | *'noconsk'* 1097 | *'noconskey'* 1098 | END 1099 | 1100 | for opt: string in deprecated 1101 | var i: number = helptags->index(opt) 1102 | if i == -1 1103 | continue 1104 | endif 1105 | helptags->remove(i) 1106 | endfor 1107 | 1108 | return helptags 1109 | ->map((_, v: string) => v->trim("*'")) 1110 | enddef 1111 | 1112 | const option: list = Option() 1113 | 1114 | # option_terminal {{{3 1115 | 1116 | # terminal options with only word characters 1117 | const option_terminal: list = 1118 | # getting all terminal options is trickier than it seems; 1119 | # let's use 2 sources to cover as much ground as possible 1120 | (getcompletion('t_', 'option') + getcompletion('t_', 'help')) 1121 | ->filter((_, v: string): bool => v =~ '^t_\w\w$') 1122 | ->sort() 1123 | ->uniq() 1124 | 1125 | # option_terminal_special {{{3 1126 | 1127 | # terminal options with at least 1 non-word character 1128 | const option_terminal_special: list = 1129 | (getcompletion('t_', 'option') + getcompletion('t_', 'help')) 1130 | ->map((_, v: string) => v->trim("'")) 1131 | ->filter((_, v: string): bool => v =~ '\W') 1132 | ->sort() 1133 | ->uniq() 1134 | #}}}1 1135 | 1136 | const IMPORT_FILE: string = expand(':p:h:h') .. '/import/vim9Language.vim' 1137 | var header: list =<< trim eval END 1138 | vim9script 1139 | 1140 | # DO NOT EDIT THIS FILE DIRECTLY. 1141 | # It is meant to be generated by ./tools/{expand(':p:t')} 1142 | END 1143 | header->writefile(IMPORT_FILE) 1144 | 1145 | AppendSection('builtin_func') 1146 | AppendSection('builtin_func_ambiguous', true) 1147 | AppendSection('collation_class', true) 1148 | AppendSection('command_address_type', true) 1149 | AppendSection('command_can_be_before') 1150 | AppendSection('command_complete_type', true) 1151 | AppendSection('command_modifier', true) 1152 | AppendSection('command_name') 1153 | AppendSection('default_highlighting_group') 1154 | AppendSection('event') 1155 | AppendSection('ex_special_characters', true) 1156 | AppendSection('increment_invalid') 1157 | AppendSection('key_name', true) 1158 | AppendSection('lambda_end') 1159 | AppendSection('lambda_start') 1160 | AppendSection('legacy_autoload_invalid') 1161 | AppendSection('logical_not') 1162 | AppendSection('mark_valid') 1163 | AppendSection('maybe_dict_literal_key') 1164 | AppendSection('most_operators') 1165 | AppendSection('option') 1166 | AppendSection('option_can_be_after') 1167 | AppendSection('option_modifier') 1168 | AppendSection('option_sigil') 1169 | AppendSection('option_terminal') 1170 | AppendSection('option_terminal_special', true) 1171 | AppendSection('option_valid') 1172 | AppendSection('pattern_delimiter') 1173 | AppendSection('wincmd_valid') 1174 | 1175 | execute 'edit ' .. IMPORT_FILE 1176 | -------------------------------------------------------------------------------- /import/vim9Language.vim: -------------------------------------------------------------------------------- 1 | vim9script 2 | 3 | # DO NOT EDIT THIS FILE DIRECTLY. 4 | # It is meant to be generated by ./tools/GenerateImport.vim 5 | 6 | # builtin_func {{{1 7 | 8 | const builtin_func_list: list =<< trim END 9 | abs 10 | acos 11 | add 12 | and 13 | appendbufline 14 | argc 15 | argidx 16 | arglistid 17 | argv 18 | asin 19 | assert_beeps 20 | assert_equal 21 | assert_equalfile 22 | assert_exception 23 | assert_fails 24 | assert_false 25 | assert_inrange 26 | assert_match 27 | assert_nobeep 28 | assert_notequal 29 | assert_notmatch 30 | assert_report 31 | assert_true 32 | atan 33 | atan2 34 | autocmd_add 35 | autocmd_delete 36 | autocmd_get 37 | balloon_gettext 38 | balloon_show 39 | balloon_split 40 | base64_decode 41 | base64_encode 42 | bindtextdomain 43 | blob2list 44 | blob2str 45 | browsedir 46 | bufadd 47 | bufexists 48 | buffer_exists 49 | buffer_name 50 | buffer_number 51 | buflisted 52 | bufload 53 | bufloaded 54 | bufname 55 | bufnr 56 | bufwinid 57 | bufwinnr 58 | byte2line 59 | byteidx 60 | byteidxcomp 61 | ceil 62 | ch_canread 63 | ch_close 64 | ch_close_in 65 | ch_evalexpr 66 | ch_evalraw 67 | ch_getbufnr 68 | ch_getjob 69 | ch_info 70 | ch_log 71 | ch_logfile 72 | ch_open 73 | ch_read 74 | ch_readblob 75 | ch_readraw 76 | ch_sendexpr 77 | ch_sendraw 78 | ch_setoptions 79 | ch_status 80 | changenr 81 | char2nr 82 | charclass 83 | charcol 84 | charidx 85 | cindent 86 | clearmatches 87 | cmdcomplete_info 88 | col 89 | complete 90 | complete_add 91 | complete_check 92 | complete_info 93 | complete_match 94 | cos 95 | cosh 96 | count 97 | cscope_connection 98 | cursor 99 | deepcopy 100 | deletebufline 101 | did_filetype 102 | diff 103 | diff_filler 104 | diff_hlID 105 | digraph_get 106 | digraph_getlist 107 | digraph_set 108 | digraph_setlist 109 | echoraw 110 | empty 111 | environ 112 | err_teapot 113 | escape 114 | eventhandler 115 | executable 116 | exepath 117 | exists 118 | exists_compiled 119 | exp 120 | expand 121 | expandcmd 122 | extend 123 | extendnew 124 | feedkeys 125 | file_readable 126 | filecopy 127 | filereadable 128 | filewritable 129 | finddir 130 | findfile 131 | flatten 132 | flattennew 133 | float2nr 134 | floor 135 | fmod 136 | fnameescape 137 | fnamemodify 138 | foldclosed 139 | foldclosedend 140 | foldlevel 141 | foldtext 142 | foldtextresult 143 | foreach 144 | foreground 145 | fullcommand 146 | funcref 147 | garbagecollect 148 | get 149 | getbufinfo 150 | getbufline 151 | getbufoneline 152 | getbufvar 153 | getcellpixels 154 | getcellwidths 155 | getchangelist 156 | getchar 157 | getcharmod 158 | getcharpos 159 | getcharsearch 160 | getcharstr 161 | getcmdcomplpat 162 | getcmdcompltype 163 | getcmdline 164 | getcmdpos 165 | getcmdprompt 166 | getcmdscreenpos 167 | getcmdtype 168 | getcmdwintype 169 | getcompletion 170 | getcompletiontype 171 | getcurpos 172 | getcursorcharpos 173 | getcwd 174 | getenv 175 | getfontname 176 | getfperm 177 | getfsize 178 | getftime 179 | getftype 180 | getimstatus 181 | getjumplist 182 | getline 183 | getloclist 184 | getmarklist 185 | getmatches 186 | getmousepos 187 | getmouseshape 188 | getpid 189 | getpos 190 | getqflist 191 | getreg 192 | getreginfo 193 | getregion 194 | getregionpos 195 | getregtype 196 | getscriptinfo 197 | getstacktrace 198 | gettabinfo 199 | gettabvar 200 | gettabwinvar 201 | gettagstack 202 | gettext 203 | getwininfo 204 | getwinpos 205 | getwinposx 206 | getwinposy 207 | getwinvar 208 | glob 209 | glob2regpat 210 | globpath 211 | has 212 | has_key 213 | haslocaldir 214 | hasmapto 215 | highlightID 216 | highlight_exists 217 | histadd 218 | histdel 219 | histget 220 | histnr 221 | hlID 222 | hlexists 223 | hlget 224 | hlset 225 | hostname 226 | iconv 227 | id 228 | indent 229 | index 230 | indexof 231 | input 232 | inputdialog 233 | inputlist 234 | inputrestore 235 | inputsave 236 | inputsecret 237 | instanceof 238 | interrupt 239 | invert 240 | isabsolutepath 241 | isdirectory 242 | isinf 243 | islocked 244 | isnan 245 | items 246 | job_getchannel 247 | job_info 248 | job_setoptions 249 | job_start 250 | job_status 251 | job_stop 252 | js_decode 253 | js_encode 254 | json_decode 255 | json_encode 256 | keys 257 | keytrans 258 | last_buffer_nr 259 | len 260 | libcall 261 | libcallnr 262 | line 263 | line2byte 264 | lispindent 265 | list2blob 266 | list2str 267 | list2tuple 268 | listener_add 269 | listener_flush 270 | listener_remove 271 | localtime 272 | log 273 | log10 274 | maparg 275 | mapcheck 276 | maplist 277 | mapnew 278 | mapset 279 | matchadd 280 | matchaddpos 281 | matcharg 282 | matchbufline 283 | matchdelete 284 | matchend 285 | matchfuzzy 286 | matchfuzzypos 287 | matchlist 288 | matchstr 289 | matchstrlist 290 | matchstrpos 291 | max 292 | menu_info 293 | min 294 | mkdir 295 | nextnonblank 296 | ngettext 297 | nr2char 298 | or 299 | pathshorten 300 | popup_atcursor 301 | popup_beval 302 | popup_clear 303 | popup_close 304 | popup_create 305 | popup_dialog 306 | popup_filter_menu 307 | popup_filter_yesno 308 | popup_findecho 309 | popup_findinfo 310 | popup_findpreview 311 | popup_getoptions 312 | popup_getpos 313 | popup_hide 314 | popup_list 315 | popup_locate 316 | popup_menu 317 | popup_move 318 | popup_notification 319 | popup_setbuf 320 | popup_setoptions 321 | popup_settext 322 | popup_show 323 | pow 324 | preinserted 325 | prevnonblank 326 | printf 327 | prompt_getprompt 328 | prompt_setcallback 329 | prompt_setinterrupt 330 | prompt_setprompt 331 | prop_add 332 | prop_add_list 333 | prop_clear 334 | prop_find 335 | prop_list 336 | prop_remove 337 | prop_type_add 338 | prop_type_change 339 | prop_type_delete 340 | prop_type_get 341 | prop_type_list 342 | pum_getpos 343 | pumvisible 344 | py3eval 345 | pyxeval 346 | rand 347 | range 348 | readblob 349 | readdir 350 | readdirex 351 | readfile 352 | reduce 353 | reg_executing 354 | reg_recording 355 | reltime 356 | reltimefloat 357 | reltimestr 358 | remote_expr 359 | remote_foreground 360 | remote_peek 361 | remote_read 362 | remote_send 363 | remote_startserver 364 | remove 365 | rename 366 | repeat 367 | resolve 368 | reverse 369 | round 370 | screenattr 371 | screenchar 372 | screenchars 373 | screencol 374 | screenpos 375 | screenrow 376 | screenstring 377 | search 378 | searchcount 379 | searchdecl 380 | searchpair 381 | searchpairpos 382 | searchpos 383 | server2client 384 | serverlist 385 | setbufline 386 | setbufvar 387 | setcellwidths 388 | setcharpos 389 | setcharsearch 390 | setcmdline 391 | setcmdpos 392 | setcursorcharpos 393 | setenv 394 | setfperm 395 | setline 396 | setloclist 397 | setmatches 398 | setpos 399 | setqflist 400 | setreg 401 | settabvar 402 | settabwinvar 403 | settagstack 404 | setwinvar 405 | sha256 406 | shellescape 407 | shiftwidth 408 | sign_define 409 | sign_getdefined 410 | sign_getplaced 411 | sign_jump 412 | sign_place 413 | sign_placelist 414 | sign_undefine 415 | sign_unplace 416 | sign_unplacelist 417 | simplify 418 | sin 419 | sinh 420 | slice 421 | sound_clear 422 | sound_playevent 423 | sound_playfile 424 | sound_stop 425 | soundfold 426 | spellbadword 427 | spellsuggest 428 | sqrt 429 | srand 430 | state 431 | str2blob 432 | str2float 433 | str2list 434 | str2nr 435 | strcharlen 436 | strcharpart 437 | strchars 438 | strdisplaywidth 439 | strftime 440 | strgetchar 441 | stridx 442 | string 443 | strlen 444 | strpart 445 | strptime 446 | strridx 447 | strtrans 448 | strutf16len 449 | strwidth 450 | submatch 451 | swapfilelist 452 | swapinfo 453 | synID 454 | synIDattr 455 | synIDtrans 456 | synconcealed 457 | synstack 458 | system 459 | systemlist 460 | tabpagebuflist 461 | tabpagenr 462 | tabpagewinnr 463 | tagfiles 464 | taglist 465 | tan 466 | tanh 467 | tempname 468 | term_dumpdiff 469 | term_dumpload 470 | term_dumpwrite 471 | term_getaltscreen 472 | term_getansicolors 473 | term_getattr 474 | term_getcursor 475 | term_getjob 476 | term_getline 477 | term_getscrolled 478 | term_getsize 479 | term_getstatus 480 | term_gettitle 481 | term_gettty 482 | term_list 483 | term_scrape 484 | term_sendkeys 485 | term_setansicolors 486 | term_setapi 487 | term_setkill 488 | term_setrestore 489 | term_setsize 490 | term_start 491 | term_wait 492 | terminalprops 493 | test_alloc_fail 494 | test_autochdir 495 | test_feedinput 496 | test_garbagecollect_now 497 | test_garbagecollect_soon 498 | test_getvalue 499 | test_gui_event 500 | test_ignore_error 501 | test_mswin_event 502 | test_null_blob 503 | test_null_channel 504 | test_null_dict 505 | test_null_function 506 | test_null_job 507 | test_null_list 508 | test_null_partial 509 | test_null_string 510 | test_null_tuple 511 | test_option_not_set 512 | test_override 513 | test_refcount 514 | test_setmouse 515 | test_settime 516 | test_srand_seed 517 | test_unknown 518 | test_void 519 | timer_info 520 | timer_pause 521 | timer_start 522 | timer_stop 523 | timer_stopall 524 | tolower 525 | toupper 526 | tr 527 | trim 528 | trunc 529 | tuple2list 530 | typename 531 | undofile 532 | undotree 533 | uri_decode 534 | uri_encode 535 | utf16idx 536 | values 537 | virtcol 538 | virtcol2col 539 | visualmode 540 | wildmenumode 541 | wildtrigger 542 | win_execute 543 | win_findbuf 544 | win_getid 545 | win_gettype 546 | win_gotoid 547 | win_id2tabwin 548 | win_id2win 549 | win_move_separator 550 | win_move_statusline 551 | win_screenpos 552 | win_splitmove 553 | winbufnr 554 | wincol 555 | windowsversion 556 | winheight 557 | winlayout 558 | winline 559 | winnr 560 | winrestcmd 561 | winrestview 562 | winsaveview 563 | winwidth 564 | wordcount 565 | writefile 566 | xor 567 | debugbreak 568 | luaeval 569 | mzeval 570 | perleval 571 | pyeval 572 | rubyeval 573 | END 574 | 575 | export const builtin_func: string = builtin_func_list->join() 576 | 577 | # builtin_func_ambiguous {{{1 578 | 579 | const builtin_func_ambiguous_list: list =<< trim END 580 | append 581 | browse 582 | call 583 | chdir 584 | confirm 585 | copy 586 | delete 587 | eval 588 | execute 589 | filter 590 | function 591 | insert 592 | join 593 | map 594 | match 595 | mode 596 | sort 597 | split 598 | substitute 599 | swapname 600 | type 601 | uniq 602 | END 603 | 604 | export const builtin_func_ambiguous: string = builtin_func_ambiguous_list->join("\\|") 605 | 606 | # collation_class {{{1 607 | 608 | const collation_class_list: list =<< trim END 609 | alnum 610 | alpha 611 | backspace 612 | blank 613 | cntrl 614 | digit 615 | escape 616 | fname 617 | graph 618 | ident 619 | keyword 620 | lower 621 | print 622 | punct 623 | return 624 | space 625 | tab 626 | upper 627 | xdigit 628 | END 629 | 630 | export const collation_class: string = collation_class_list->join("\\|") 631 | 632 | # command_address_type {{{1 633 | 634 | const command_address_type_list: list =<< trim END 635 | arguments 636 | buffers 637 | lines 638 | loaded_buffers 639 | other 640 | quickfix 641 | tabs 642 | windows 643 | END 644 | 645 | export const command_address_type: string = command_address_type_list->join("\\|") 646 | 647 | # command_can_be_before {{{1 648 | 649 | export const command_can_be_before: string = '\%([[:blank:]\n]\@=\|\c<\%(bar\|cr\)>\)\%(\s*\%([-+*/%]=\|=\s\|=<<\|\.\.=\)\|\_s*\%(->\|[-+*/%]\%(\s\+\)\@>[^|<]\)\)\@!' 650 | 651 | # command_complete_type {{{1 652 | 653 | const command_complete_type_list: list =<< trim END 654 | arglist 655 | augroup 656 | behave 657 | breakpoint 658 | buffer 659 | color 660 | command 661 | compiler 662 | cscope 663 | customlist 664 | custom 665 | diff_buffer 666 | dir_in_path 667 | dir 668 | environment 669 | event 670 | expression 671 | file_in_path 672 | filetypecmd 673 | filetype 674 | file 675 | function 676 | help 677 | highlight 678 | history 679 | keymap 680 | locale 681 | mapclear 682 | mapping 683 | menu 684 | messages 685 | option 686 | packadd 687 | retab 688 | runtime 689 | scriptnames 690 | shellcmdline 691 | shellcmd 692 | sign 693 | syntax 694 | syntime 695 | tag_listfiles 696 | tag 697 | user 698 | var 699 | END 700 | 701 | export const command_complete_type: string = command_complete_type_list->join("\\|") 702 | 703 | # command_modifier {{{1 704 | 705 | const command_modifier_list: list =<< trim END 706 | abo\%[veleft] 707 | bel\%[owright] 708 | bo\%[tright] 709 | bro\%[wse] 710 | conf\%[irm] 711 | hid\%[e] 712 | keepa\%[lt] 713 | keepj\%[umps] 714 | ke\%[epmarks] 715 | keepp\%[atterns] 716 | lefta\%[bove] 717 | leg\%[acy] 718 | loc\%[kmarks] 719 | noa\%[utocmd] 720 | nos\%[wapfile] 721 | rightb\%[elow] 722 | san\%[dbox] 723 | sil\%[ent] 724 | tab 725 | to\%[pleft] 726 | uns\%[ilent] 727 | verb\%[ose] 728 | vert\%[ical] 729 | vim9\%[cmd] 730 | END 731 | 732 | export const command_modifier: string = command_modifier_list->join("\\|") 733 | 734 | # command_name {{{1 735 | 736 | const command_name_list: list =<< trim END 737 | al[l] 738 | am[enu] 739 | an[oremenu] 740 | arga[dd] 741 | argded[upe] 742 | argd[elete] 743 | arge[dit] 744 | argg[lobal] 745 | argl[ocal] 746 | ar[gs] 747 | argu[ment] 748 | as[cii] 749 | aun[menu] 750 | bN[ext] 751 | bad[d] 752 | ba[ll] 753 | balt 754 | bd[elete] 755 | be[have] 756 | bf[irst] 757 | bl[ast] 758 | bm[odified] 759 | bn[ext] 760 | bp[revious] 761 | breaka[dd] 762 | breakd[el] 763 | breakl[ist] 764 | br[ewind] 765 | b[uffer] 766 | buffers 767 | bun[load] 768 | bw[ipeout] 769 | cN[ext] 770 | cNf[ile] 771 | cabo[ve] 772 | cad[dbuffer] 773 | cadde[xpr] 774 | caddf[ile] 775 | caf[ter] 776 | cal[l] 777 | cbe[fore] 778 | cbel[ow] 779 | cbo[ttom] 780 | cb[uffer] 781 | cc 782 | ccl[ose] 783 | ce[nter] 784 | cex[pr] 785 | cf[ile] 786 | cfir[st] 787 | cgetb[uffer] 788 | cgete[xpr] 789 | cg[etfile] 790 | changes 791 | che[ckpath] 792 | checkt[ime] 793 | chi[story] 794 | cla[st] 795 | cle[arjumps] 796 | clip[reset] 797 | cl[ist] 798 | clo[se] 799 | cme[nu] 800 | cnew[er] 801 | cn[ext] 802 | cnf[ile] 803 | cnoreme[nu] 804 | col[der] 805 | colo[rscheme] 806 | comc[lear] 807 | comp[iler] 808 | cope[n] 809 | cpf[ile] 810 | cp[revious] 811 | cq[uit] 812 | cr[ewind] 813 | cs[cope] 814 | cst[ag] 815 | cunme[nu] 816 | cw[indow] 817 | deb[ug] 818 | debugg[reedy] 819 | def 820 | defc[ompile] 821 | defe[r] 822 | delc[ommand] 823 | d[elete] 824 | delf[unction] 825 | delm[arks] 826 | diffg[et] 827 | diffo[ff] 828 | diffp[atch] 829 | diffpu[t] 830 | diffs[plit] 831 | difft[his] 832 | dif[fupdate] 833 | disa[ssemble] 834 | di[splay] 835 | dj[ump] 836 | dl[ist] 837 | dr[op] 838 | ds[earch] 839 | dsp[lit] 840 | ea[rlier] 841 | ec[ho] 842 | echoc[onsole] 843 | echoe[rr] 844 | echom[sg] 845 | echon 846 | echow[indow] 847 | e[dit] 848 | em[enu] 849 | enddef 850 | endf[unction] 851 | ene[w] 852 | ev[al] 853 | ex 854 | exe[cute] 855 | exi[t] 856 | exu[sage] 857 | f[ile] 858 | files 859 | filt[er] 860 | fin[d] 861 | fir[st] 862 | fix[del] 863 | fo[ld] 864 | foldc[lose] 865 | folddoc[losed] 866 | foldd[oopen] 867 | foldo[pen] 868 | fu[nction] 869 | go[to] 870 | gr[ep] 871 | grepa[dd] 872 | gu[i] 873 | gv[im] 874 | ha[rdcopy] 875 | h[elp] 876 | helpc[lose] 877 | helpf[ind] 878 | helpg[rep] 879 | helpt[ags] 880 | his[tory] 881 | ho[rizontal] 882 | ij[ump] 883 | il[ist] 884 | ime[nu] 885 | inoreme[nu] 886 | int[ro] 887 | ip[ut] 888 | is[earch] 889 | isp[lit] 890 | iunme[nu] 891 | j[oin] 892 | ju[mps] 893 | lN[ext] 894 | lNf[ile] 895 | lab[ove] 896 | laddb[uffer] 897 | lad[dexpr] 898 | laddf[ile] 899 | laf[ter] 900 | lan[guage] 901 | la[st] 902 | lat[er] 903 | lbe[fore] 904 | lbel[ow] 905 | lbo[ttom] 906 | lb[uffer] 907 | lcl[ose] 908 | lcs[cope] 909 | le[ft] 910 | lex[pr] 911 | lf[ile] 912 | lfir[st] 913 | lgetb[uffer] 914 | lgete[xpr] 915 | lg[etfile] 916 | lgr[ep] 917 | lgrepa[dd] 918 | lh[elpgrep] 919 | lhi[story] 920 | l[ist] 921 | ll 922 | lla[st] 923 | lli[st] 924 | lmak[e] 925 | lnew[er] 926 | lne[xt] 927 | lnf[ile] 928 | loadk[eymap] 929 | lo[adview] 930 | lockv[ar] 931 | lol[der] 932 | lop[en] 933 | lpf[ile] 934 | lp[revious] 935 | lr[ewind] 936 | ls 937 | lt[ag] 938 | luaf[ile] 939 | lw[indow] 940 | mak[e] 941 | marks 942 | mat[ch] 943 | me[nu] 944 | menut[ranslate] 945 | mes[sages] 946 | mk[exrc] 947 | mks[ession] 948 | mksp[ell] 949 | mkvie[w] 950 | mkv[imrc] 951 | mzf[ile] 952 | mz[scheme] 953 | nbc[lose] 954 | nb[key] 955 | nbs[tart] 956 | new 957 | n[ext] 958 | nme[nu] 959 | nnoreme[nu] 960 | noh[lsearch] 961 | noreme[nu] 962 | nu[mber] 963 | nunme[nu] 964 | ol[dfiles] 965 | ome[nu] 966 | on[ly] 967 | onoreme[nu] 968 | opt[ions] 969 | ounme[nu] 970 | ow[nsyntax] 971 | pa[ckadd] 972 | packl[oadall] 973 | pb[uffer] 974 | pc[lose] 975 | ped[it] 976 | po[p] 977 | popu[p] 978 | pp[op] 979 | pre[serve] 980 | prev[ious] 981 | p[rint] 982 | profd[el] 983 | prof[ile] 984 | pro[mptfind] 985 | promptr[epl] 986 | ps[earch] 987 | ptN[ext] 988 | pt[ag] 989 | ptf[irst] 990 | ptj[ump] 991 | ptl[ast] 992 | ptn[ext] 993 | ptp[revious] 994 | ptr[ewind] 995 | pts[elect] 996 | pu[t] 997 | pw[d] 998 | py3 999 | py3f[ile] 1000 | pyf[ile] 1001 | pyx 1002 | pyxf[ile] 1003 | qa[ll] 1004 | q[uit] 1005 | quita[ll] 1006 | r[ead] 1007 | rec[over] 1008 | redi[r] 1009 | red[o] 1010 | redr[aw] 1011 | redraws[tatus] 1012 | redrawt[abline] 1013 | redrawtabp[anel] 1014 | reg[isters] 1015 | res[ize] 1016 | ret[ab] 1017 | rew[ind] 1018 | ri[ght] 1019 | rubyf[ile] 1020 | rund[o] 1021 | ru[ntime] 1022 | rv[iminfo] 1023 | sN[ext] 1024 | sal[l] 1025 | sa[rgument] 1026 | sav[eas] 1027 | sbN[ext] 1028 | sba[ll] 1029 | sbf[irst] 1030 | sbl[ast] 1031 | sbm[odified] 1032 | sbn[ext] 1033 | sbp[revious] 1034 | sbr[ewind] 1035 | sb[uffer] 1036 | scripte[ncoding] 1037 | sc[riptnames] 1038 | scriptv[ersion] 1039 | scs[cope] 1040 | setf[iletype] 1041 | sf[ind] 1042 | sfir[st] 1043 | sh[ell] 1044 | sig[n] 1045 | si[malt] 1046 | sla[st] 1047 | sl[eep] 1048 | sm[agic] 1049 | sme[nu] 1050 | smi[le] 1051 | sn[ext] 1052 | sno[magic] 1053 | snoreme[nu] 1054 | sor[t] 1055 | so[urce] 1056 | spelld[ump] 1057 | spe[llgood] 1058 | spelli[nfo] 1059 | spellra[re] 1060 | spellr[epall] 1061 | spellu[ndo] 1062 | spellw[rong] 1063 | sp[lit] 1064 | spr[evious] 1065 | sr[ewind] 1066 | sta[g] 1067 | startg[replace] 1068 | star[tinsert] 1069 | startr[eplace] 1070 | stj[ump] 1071 | st[op] 1072 | stopi[nsert] 1073 | sts[elect] 1074 | sun[hide] 1075 | sunme[nu] 1076 | sus[pend] 1077 | sv[iew] 1078 | sw[apname] 1079 | sync[bind] 1080 | synti[me] 1081 | tN[ext] 1082 | tabN[ext] 1083 | tabc[lose] 1084 | tabe[dit] 1085 | tabf[ind] 1086 | tabfir[st] 1087 | tabl[ast] 1088 | tabm[ove] 1089 | tabnew 1090 | tabn[ext] 1091 | tabo[nly] 1092 | tabp[revious] 1093 | tabr[ewind] 1094 | tabs 1095 | ta[g] 1096 | tags 1097 | tclf[ile] 1098 | te[aroff] 1099 | ter[minal] 1100 | tf[irst] 1101 | this 1102 | tj[ump] 1103 | tl[ast] 1104 | tlm[enu] 1105 | tln[oremenu] 1106 | tlu[nmenu] 1107 | tm[enu] 1108 | tn[ext] 1109 | tp[revious] 1110 | tr[ewind] 1111 | ts[elect] 1112 | tu[nmenu] 1113 | u[ndo] 1114 | undoj[oin] 1115 | undol[ist] 1116 | unh[ide] 1117 | uni[q] 1118 | unlo[ckvar] 1119 | unme[nu] 1120 | up[date] 1121 | ve[rsion] 1122 | vie[w] 1123 | vim9s[cript] 1124 | vi[sual] 1125 | viu[sage] 1126 | vme[nu] 1127 | vne[w] 1128 | vnoreme[nu] 1129 | vs[plit] 1130 | vunme[nu] 1131 | wN[ext] 1132 | wa[ll] 1133 | winp[os] 1134 | wi[nsize] 1135 | wl[restore] 1136 | wn[ext] 1137 | wp[revious] 1138 | wq 1139 | wqa[ll] 1140 | w[rite] 1141 | wu[ndo] 1142 | wv[iminfo] 1143 | xa[ll] 1144 | xme[nu] 1145 | xnoreme[nu] 1146 | xr[estore] 1147 | xunme[nu] 1148 | y[ank] 1149 | addd 1150 | END 1151 | 1152 | export const command_name: string = command_name_list->join() 1153 | 1154 | # default_highlighting_group {{{1 1155 | 1156 | const default_highlighting_group_list: list =<< trim END 1157 | ColorColumn 1158 | ComplMatchIns 1159 | CurSearch 1160 | Cursor 1161 | CursorColumn 1162 | CursorIM 1163 | CursorLine 1164 | CursorLineFold 1165 | CursorLineNr 1166 | CursorLineSign 1167 | DiffAdd 1168 | DiffChange 1169 | DiffDelete 1170 | DiffText 1171 | DiffTextAdd 1172 | Directory 1173 | EndOfBuffer 1174 | ErrorMsg 1175 | FoldColumn 1176 | Folded 1177 | IncSearch 1178 | LineNr 1179 | LineNrAbove 1180 | LineNrBelow 1181 | MatchParen 1182 | Menu 1183 | MessageWindow 1184 | ModeMsg 1185 | MoreMsg 1186 | MsgArea 1187 | NonText 1188 | Normal 1189 | Pmenu 1190 | PmenuBorder 1191 | PmenuExtra 1192 | PmenuExtraSel 1193 | PmenuKind 1194 | PmenuKindSel 1195 | PmenuMatch 1196 | PmenuMatchSel 1197 | PmenuSbar 1198 | PmenuSel 1199 | PmenuShadow 1200 | PmenuThumb 1201 | PopupNotification 1202 | PopupSelected 1203 | PreInsert 1204 | Question 1205 | QuickFixLine 1206 | Scrollbar 1207 | Search 1208 | SignColumn 1209 | SpecialKey 1210 | SpellBad 1211 | SpellCap 1212 | SpellLocal 1213 | SpellRare 1214 | StatusLine 1215 | StatusLineNC 1216 | StatusLineTerm 1217 | StatusLineTermNC 1218 | TOhtmlProgress 1219 | TabLine 1220 | TabLineFill 1221 | TabLineSel 1222 | TabPanel 1223 | TabPanelFill 1224 | TabPanelSel 1225 | Terminal 1226 | Title 1227 | TitleBar 1228 | TitleBarNC 1229 | ToolbarButton 1230 | ToolbarLine 1231 | Tooltip 1232 | User1 1233 | User2 1234 | User3 1235 | User4 1236 | User5 1237 | User6 1238 | User7 1239 | User8 1240 | User9 1241 | VertSplit 1242 | Visual 1243 | VisualNOS 1244 | WarningMsg 1245 | WildMenu 1246 | debugBreakpoint 1247 | debugPC 1248 | lCursor 1249 | END 1250 | 1251 | export const default_highlighting_group: string = default_highlighting_group_list->join() 1252 | 1253 | # event {{{1 1254 | 1255 | const event_list: list =<< trim END 1256 | BufAdd 1257 | BufCreate 1258 | BufDelete 1259 | BufEnter 1260 | BufFilePost 1261 | BufFilePre 1262 | BufHidden 1263 | BufLeave 1264 | BufNew 1265 | BufNewFile 1266 | BufRead 1267 | BufReadCmd 1268 | BufReadPost 1269 | BufReadPre 1270 | BufUnload 1271 | BufWinEnter 1272 | BufWinLeave 1273 | BufWipeout 1274 | BufWrite 1275 | BufWriteCmd 1276 | BufWritePost 1277 | BufWritePre 1278 | CmdUndefined 1279 | CmdlineChanged 1280 | CmdlineEnter 1281 | CmdlineLeave 1282 | CmdlineLeavePre 1283 | CmdwinEnter 1284 | CmdwinLeave 1285 | ColorScheme 1286 | ColorSchemePre 1287 | CompleteChanged 1288 | CompleteDone 1289 | CompleteDonePre 1290 | CursorHold 1291 | CursorHoldI 1292 | CursorMoved 1293 | CursorMovedC 1294 | CursorMovedI 1295 | DiffUpdated 1296 | DirChanged 1297 | DirChangedPre 1298 | EncodingChanged 1299 | ExitPre 1300 | FileAppendCmd 1301 | FileAppendPost 1302 | FileAppendPre 1303 | FileChangedRO 1304 | FileChangedShell 1305 | FileChangedShellPost 1306 | FileEncoding 1307 | FileReadCmd 1308 | FileReadPost 1309 | FileReadPre 1310 | FileType 1311 | FileWriteCmd 1312 | FileWritePost 1313 | FileWritePre 1314 | FilterReadPost 1315 | FilterReadPre 1316 | FilterWritePost 1317 | FilterWritePre 1318 | FocusGained 1319 | FocusLost 1320 | FuncUndefined 1321 | GUIEnter 1322 | GUIFailed 1323 | InsertChange 1324 | InsertCharPre 1325 | InsertEnter 1326 | InsertLeave 1327 | InsertLeavePre 1328 | KeyInputPre 1329 | MenuPopup 1330 | ModeChanged 1331 | OptionSet 1332 | QuickFixCmdPost 1333 | QuickFixCmdPre 1334 | QuitPre 1335 | RemoteReply 1336 | SafeState 1337 | SafeStateAgain 1338 | SessionLoadPost 1339 | SessionWritePost 1340 | ShellCmdPost 1341 | ShellFilterPost 1342 | SigUSR1 1343 | SourceCmd 1344 | SourcePost 1345 | SourcePre 1346 | SpellFileMissing 1347 | StdinReadPost 1348 | StdinReadPre 1349 | SwapExists 1350 | Syntax 1351 | TabClosed 1352 | TabClosedPre 1353 | TabEnter 1354 | TabLeave 1355 | TabNew 1356 | TermChanged 1357 | TermResponse 1358 | TermResponseAll 1359 | TerminalOpen 1360 | TerminalWinOpen 1361 | TextChanged 1362 | TextChangedI 1363 | TextChangedP 1364 | TextChangedT 1365 | TextYankPost 1366 | User 1367 | VimEnter 1368 | VimLeave 1369 | VimLeavePre 1370 | VimResized 1371 | VimResume 1372 | VimSuspend 1373 | WinClosed 1374 | WinEnter 1375 | WinLeave 1376 | WinNew 1377 | WinNewPre 1378 | WinResized 1379 | WinScrolled 1380 | END 1381 | 1382 | export const event: string = event_list->join() 1383 | 1384 | # ex_special_characters {{{1 1385 | 1386 | const ex_special_characters_list: list =<< trim END 1387 | abuf 1388 | afile 1389 | cWORD 1390 | cexpr 1391 | cfile 1392 | cword 1393 | sfile 1394 | slnum 1395 | stack 1396 | amatch 1397 | client 1398 | script 1399 | sflnum 1400 | END 1401 | 1402 | export const ex_special_characters: string = ex_special_characters_list->join("\\|") 1403 | 1404 | # increment_invalid {{{1 1405 | 1406 | export const increment_invalid: string = '\%(++\|--\)\%(\%(\%([bgstvw]:\)\=\h\w*\|&\%([lg]:\)\=[a-z]\{2,}\)\s*\_[[|.#]\)\@!' 1407 | 1408 | # key_name {{{1 1409 | 1410 | const key_name_list: list =<< trim END 1411 | BS 1412 | BackSpace 1413 | Bslash 1414 | CR 1415 | CSI 1416 | CursorHold 1417 | DecMouse 1418 | Del 1419 | Delete 1420 | Down 1421 | Drop 1422 | End 1423 | Enter 1424 | Esc 1425 | FocusGained 1426 | FocusLost 1427 | Help 1428 | Home 1429 | Ignore 1430 | Ins 1431 | Insert 1432 | JsbMouse 1433 | LF 1434 | Left 1435 | LeftDrag 1436 | LeftMouse 1437 | LeftMouseNM 1438 | LeftRelease 1439 | LeftReleaseNM 1440 | LineFeed 1441 | MiddleDrag 1442 | MiddleMouse 1443 | MiddleRelease 1444 | Mouse 1445 | MouseDown 1446 | MouseMove 1447 | MouseUp 1448 | NL 1449 | NetMouse 1450 | NewLine 1451 | Nop 1452 | Nul 1453 | PageDown 1454 | PageUp 1455 | PasteEnd 1456 | PasteStart 1457 | Plug 1458 | PtermMouse 1459 | Return 1460 | Right 1461 | RightDrag 1462 | RightMouse 1463 | RightRelease 1464 | SID 1465 | SNR 1466 | ScriptCmd 1467 | ScrollWheelDown 1468 | ScrollWheelLeft 1469 | ScrollWheelRight 1470 | ScrollWheelUp 1471 | SgrMouse 1472 | SgrMouseRelease 1473 | Space 1474 | Tab 1475 | Undo 1476 | Up 1477 | UrxvtMouse 1478 | X1Drag 1479 | X1Mouse 1480 | X1Release 1481 | X2Drag 1482 | X2Mouse 1483 | X2Release 1484 | k0 1485 | k1 1486 | k2 1487 | k3 1488 | k4 1489 | k5 1490 | k6 1491 | k7 1492 | k8 1493 | k9 1494 | kDel 1495 | kDivide 1496 | kEnd 1497 | kEnter 1498 | kHome 1499 | kInsert 1500 | kMinus 1501 | kMultiply 1502 | kPageDown 1503 | kPageUp 1504 | kPlus 1505 | kPoint 1506 | lt 1507 | xCSI 1508 | xDown 1509 | xEnd 1510 | xF1 1511 | xF2 1512 | xF3 1513 | xF4 1514 | xHome 1515 | xLeft 1516 | xRight 1517 | xUp 1518 | zEnd 1519 | zHome 1520 | F\d\{1,2} 1521 | . 1522 | END 1523 | 1524 | export const key_name: string = key_name_list->join("\\|") 1525 | 1526 | # lambda_end {{{1 1527 | 1528 | export const lambda_end: string = ')\ze\%(:.\{-}\)\=\s\+=>' 1529 | 1530 | # lambda_start {{{1 1531 | 1532 | export const lambda_start: string = '(\ze\%(\s*\h\w*\%([^(]\|\%(\' 1533 | 1534 | # legacy_autoload_invalid {{{1 1535 | 1536 | export const legacy_autoload_invalid: string = '\h\w*#\%(\w\|#\)*' 1537 | 1538 | # logical_not {{{1 1539 | 1540 | export const logical_not: string = '/\w\@10-9"^.(){}]' 1545 | 1546 | # maybe_dict_literal_key {{{1 1547 | 1548 | export const maybe_dict_literal_key: string = '/\%([{\n]\|[^[:blank:]\n,{\\]\@1>\|\%([=!]=\|[<>]=\=\|[=!]\~\|is\|isnot\)[?#]\=\)\_s\@=\%(\s*[|<]\)\@!"' 1553 | 1554 | # option {{{1 1555 | 1556 | const option_list: list =<< trim END 1557 | aleph 1558 | al 1559 | allowrevins 1560 | ari 1561 | noallowrevins 1562 | noari 1563 | altkeymap 1564 | akm 1565 | noaltkeymap 1566 | noakm 1567 | ambiwidth 1568 | ambw 1569 | antialias 1570 | anti 1571 | noantialias 1572 | noanti 1573 | arabic 1574 | arab 1575 | noarabic 1576 | noarab 1577 | arabicshape 1578 | arshape 1579 | noarabicshape 1580 | noarshape 1581 | autochdir 1582 | acd 1583 | noautochdir 1584 | noacd 1585 | autocomplete 1586 | ac 1587 | noautocomplete 1588 | noac 1589 | autocompletedelay 1590 | acl 1591 | autocompletetimeout 1592 | act 1593 | autoindent 1594 | ai 1595 | noautoindent 1596 | noai 1597 | autoread 1598 | ar 1599 | noautoread 1600 | noar 1601 | autoshelldir 1602 | asd 1603 | noautoshelldir 1604 | noasd 1605 | autowrite 1606 | aw 1607 | noautowrite 1608 | noaw 1609 | autowriteall 1610 | awa 1611 | noautowriteall 1612 | noawa 1613 | background 1614 | bg 1615 | backspace 1616 | bs 1617 | backup 1618 | bk 1619 | nobackup 1620 | nobk 1621 | backupcopy 1622 | bkc 1623 | backupdir 1624 | bdir 1625 | backupext 1626 | bex 1627 | backupskip 1628 | bsk 1629 | balloondelay 1630 | bdlay 1631 | ballooneval 1632 | beval 1633 | noballooneval 1634 | nobeval 1635 | balloonevalterm 1636 | bevalterm 1637 | noballoonevalterm 1638 | nobevalterm 1639 | balloonexpr 1640 | bexpr 1641 | belloff 1642 | bo 1643 | binary 1644 | bin 1645 | nobinary 1646 | nobin 1647 | bomb 1648 | nobomb 1649 | breakat 1650 | brk 1651 | breakindent 1652 | bri 1653 | nobreakindent 1654 | nobri 1655 | breakindentopt 1656 | briopt 1657 | browsedir 1658 | bsdir 1659 | bufhidden 1660 | bh 1661 | buflisted 1662 | bl 1663 | nobuflisted 1664 | nobl 1665 | buftype 1666 | bt 1667 | casemap 1668 | cmp 1669 | cdhome 1670 | cdh 1671 | nocdhome 1672 | nocdh 1673 | cdpath 1674 | cd 1675 | cedit 1676 | charconvert 1677 | ccv 1678 | chistory 1679 | chi 1680 | cindent 1681 | cin 1682 | nocindent 1683 | nocin 1684 | cinkeys 1685 | cink 1686 | cinoptions 1687 | cino 1688 | cinscopedecls 1689 | cinsd 1690 | cinwords 1691 | cinw 1692 | clipboard 1693 | cb 1694 | clipmethod 1695 | cpm 1696 | cmdheight 1697 | ch 1698 | cmdwinheight 1699 | cwh 1700 | colorcolumn 1701 | cc 1702 | columns 1703 | co 1704 | comments 1705 | com 1706 | commentstring 1707 | cms 1708 | compatible 1709 | cp 1710 | nocompatible 1711 | nocp 1712 | complete 1713 | cpt 1714 | completefunc 1715 | cfu 1716 | completefuzzycollect 1717 | cfc 1718 | completeitemalign 1719 | cia 1720 | completeopt 1721 | cot 1722 | completepopup 1723 | cpp 1724 | completeslash 1725 | csl 1726 | completetimeout 1727 | cto 1728 | concealcursor 1729 | cocu 1730 | conceallevel 1731 | cole 1732 | confirm 1733 | cf 1734 | noconfirm 1735 | nocf 1736 | copyindent 1737 | ci 1738 | nocopyindent 1739 | noci 1740 | cpoptions 1741 | cpo 1742 | cryptmethod 1743 | cm 1744 | cscopepathcomp 1745 | cspc 1746 | cscopeprg 1747 | csprg 1748 | cscopequickfix 1749 | csqf 1750 | cscoperelative 1751 | csre 1752 | nocscoperelative 1753 | nocsre 1754 | cscopetag 1755 | cst 1756 | nocscopetag 1757 | nocst 1758 | cscopetagorder 1759 | csto 1760 | cscopeverbose 1761 | csverb 1762 | nocscopeverbose 1763 | nocsverb 1764 | cursorbind 1765 | crb 1766 | nocursorbind 1767 | nocrb 1768 | cursorcolumn 1769 | cuc 1770 | nocursorcolumn 1771 | nocuc 1772 | cursorline 1773 | cul 1774 | nocursorline 1775 | nocul 1776 | cursorlineopt 1777 | culopt 1778 | debug 1779 | define 1780 | def 1781 | delcombine 1782 | deco 1783 | nodelcombine 1784 | nodeco 1785 | dictionary 1786 | dict 1787 | diff 1788 | nodiff 1789 | dia 1790 | diffanchors 1791 | dex 1792 | diffexpr 1793 | dip 1794 | diffopt 1795 | digraph 1796 | dg 1797 | nodigraph 1798 | nodg 1799 | directory 1800 | dir 1801 | display 1802 | dy 1803 | eadirection 1804 | ead 1805 | ed 1806 | edcompatible 1807 | noed 1808 | noedcompatible 1809 | emoji 1810 | emo 1811 | noemoji 1812 | noemo 1813 | encoding 1814 | enc 1815 | endoffile 1816 | eof 1817 | noendoffile 1818 | noeof 1819 | endofline 1820 | eol 1821 | noendofline 1822 | noeol 1823 | equalalways 1824 | ea 1825 | noequalalways 1826 | noea 1827 | equalprg 1828 | ep 1829 | errorbells 1830 | eb 1831 | noerrorbells 1832 | noeb 1833 | errorfile 1834 | ef 1835 | errorformat 1836 | efm 1837 | esckeys 1838 | ek 1839 | noesckeys 1840 | noek 1841 | eventignore 1842 | ei 1843 | eventignorewin 1844 | eiw 1845 | expandtab 1846 | et 1847 | noexpandtab 1848 | noet 1849 | exrc 1850 | ex 1851 | noexrc 1852 | noex 1853 | fileencoding 1854 | fenc 1855 | fileencodings 1856 | fencs 1857 | fileformat 1858 | ff 1859 | fileformats 1860 | ffs 1861 | fileignorecase 1862 | fic 1863 | nofileignorecase 1864 | nofic 1865 | filetype 1866 | ft 1867 | fillchars 1868 | fcs 1869 | findfunc 1870 | ffu 1871 | fixendofline 1872 | fixeol 1873 | nofixendofline 1874 | nofixeol 1875 | fkmap 1876 | fk 1877 | nofkmap 1878 | nofk 1879 | foldclose 1880 | fcl 1881 | foldcolumn 1882 | fdc 1883 | foldenable 1884 | fen 1885 | nofoldenable 1886 | nofen 1887 | foldexpr 1888 | fde 1889 | foldignore 1890 | fdi 1891 | foldlevel 1892 | fdl 1893 | foldlevelstart 1894 | fdls 1895 | foldmarker 1896 | fmr 1897 | foldmethod 1898 | fdm 1899 | foldminlines 1900 | fml 1901 | foldnestmax 1902 | fdn 1903 | foldopen 1904 | fdo 1905 | foldtext 1906 | fdt 1907 | formatexpr 1908 | fex 1909 | formatlistpat 1910 | flp 1911 | formatoptions 1912 | fo 1913 | formatprg 1914 | fp 1915 | fsync 1916 | fs 1917 | nofsync 1918 | nofs 1919 | gdefault 1920 | gd 1921 | nogdefault 1922 | nogd 1923 | grepformat 1924 | gfm 1925 | grepprg 1926 | gp 1927 | guicursor 1928 | gcr 1929 | guifont 1930 | gfn 1931 | guifontset 1932 | gfs 1933 | guifontwide 1934 | gfw 1935 | guiheadroom 1936 | ghr 1937 | guiligatures 1938 | gli 1939 | guioptions 1940 | go 1941 | guipty 1942 | noguipty 1943 | guitablabel 1944 | gtl 1945 | guitabtooltip 1946 | gtt 1947 | helpfile 1948 | hf 1949 | helpheight 1950 | hh 1951 | helplang 1952 | hlg 1953 | hidden 1954 | hid 1955 | nohidden 1956 | nohid 1957 | highlight 1958 | hl 1959 | history 1960 | hi 1961 | hkmap 1962 | hk 1963 | nohkmap 1964 | nohk 1965 | hkmapp 1966 | hkp 1967 | nohkmapp 1968 | nohkp 1969 | hlsearch 1970 | hls 1971 | nohlsearch 1972 | nohls 1973 | icon 1974 | noicon 1975 | iconstring 1976 | ignorecase 1977 | ic 1978 | noignorecase 1979 | noic 1980 | imactivatefunc 1981 | imaf 1982 | imactivatekey 1983 | imak 1984 | imcmdline 1985 | imc 1986 | noimcmdline 1987 | noimc 1988 | imdisable 1989 | imd 1990 | noimdisable 1991 | noimd 1992 | iminsert 1993 | imi 1994 | imsearch 1995 | ims 1996 | imstatusfunc 1997 | imsf 1998 | imstyle 1999 | imst 2000 | include 2001 | inc 2002 | includeexpr 2003 | inex 2004 | incsearch 2005 | is 2006 | noincsearch 2007 | nois 2008 | indentexpr 2009 | inde 2010 | indentkeys 2011 | indk 2012 | infercase 2013 | inf 2014 | noinfercase 2015 | noinf 2016 | isexpand 2017 | ise 2018 | insertmode 2019 | im 2020 | noinsertmode 2021 | noim 2022 | isfname 2023 | isf 2024 | isident 2025 | isi 2026 | iskeyword 2027 | isk 2028 | isprint 2029 | isp 2030 | joinspaces 2031 | js 2032 | nojoinspaces 2033 | nojs 2034 | jumpoptions 2035 | jop 2036 | key 2037 | keymap 2038 | kmp 2039 | keymodel 2040 | km 2041 | keyprotocol 2042 | kpc 2043 | keywordprg 2044 | kp 2045 | langmap 2046 | lmap 2047 | langmenu 2048 | lm 2049 | langnoremap 2050 | lnr 2051 | nolangnoremap 2052 | nolnr 2053 | langremap 2054 | lrm 2055 | nolangremap 2056 | nolrm 2057 | laststatus 2058 | ls 2059 | lazyredraw 2060 | lz 2061 | nolazyredraw 2062 | nolz 2063 | lhistory 2064 | lhi 2065 | linebreak 2066 | lbr 2067 | nolinebreak 2068 | nolbr 2069 | lines 2070 | linespace 2071 | lsp 2072 | lisp 2073 | nolisp 2074 | lispoptions 2075 | lop 2076 | lispwords 2077 | lw 2078 | list 2079 | nolist 2080 | listchars 2081 | lcs 2082 | lpl 2083 | nolpl 2084 | loadplugins 2085 | noloadplugins 2086 | luadll 2087 | macatsui 2088 | nomacatsui 2089 | magic 2090 | nomagic 2091 | makeef 2092 | mef 2093 | makeencoding 2094 | menc 2095 | makeprg 2096 | mp 2097 | matchpairs 2098 | mps 2099 | matchtime 2100 | mat 2101 | maxcombine 2102 | mco 2103 | maxfuncdepth 2104 | mfd 2105 | maxmapdepth 2106 | mmd 2107 | maxmem 2108 | mm 2109 | maxmempattern 2110 | mmp 2111 | maxmemtot 2112 | mmt 2113 | maxsearchcount 2114 | msc 2115 | menuitems 2116 | mis 2117 | messagesopt 2118 | mopt 2119 | mkspellmem 2120 | msm 2121 | modeline 2122 | ml 2123 | nomodeline 2124 | noml 2125 | modelineexpr 2126 | mle 2127 | nomodelineexpr 2128 | nomle 2129 | modelines 2130 | mls 2131 | modifiable 2132 | ma 2133 | nomodifiable 2134 | noma 2135 | modified 2136 | mod 2137 | nomodified 2138 | nomod 2139 | more 2140 | nomore 2141 | mouse 2142 | mousefocus 2143 | mousef 2144 | nomousefocus 2145 | nomousef 2146 | mousehide 2147 | mh 2148 | nomousehide 2149 | nomh 2150 | mousemodel 2151 | mousem 2152 | mousemoveevent 2153 | mousemev 2154 | nomousemoveevent 2155 | nomousemev 2156 | mouseshape 2157 | mouses 2158 | mousetime 2159 | mouset 2160 | mzquantum 2161 | mzq 2162 | mzschemedll 2163 | mzschemegcdll 2164 | nrformats 2165 | nf 2166 | number 2167 | nu 2168 | nonumber 2169 | nonu 2170 | numberwidth 2171 | nuw 2172 | omnifunc 2173 | ofu 2174 | opendevice 2175 | odev 2176 | noopendevice 2177 | noodev 2178 | operatorfunc 2179 | opfunc 2180 | osctimeoutlen 2181 | ost 2182 | osfiletype 2183 | oft 2184 | packpath 2185 | pp 2186 | paragraphs 2187 | para 2188 | paste 2189 | nopaste 2190 | pastetoggle 2191 | pt 2192 | pex 2193 | patchexpr 2194 | patchmode 2195 | pm 2196 | path 2197 | pa 2198 | perldll 2199 | preserveindent 2200 | pi 2201 | nopreserveindent 2202 | nopi 2203 | previewheight 2204 | pvh 2205 | previewpopup 2206 | pvp 2207 | previewwindow 2208 | nopreviewwindow 2209 | pvw 2210 | nopvw 2211 | printdevice 2212 | pdev 2213 | printencoding 2214 | penc 2215 | printexpr 2216 | pexpr 2217 | printfont 2218 | pfn 2219 | printheader 2220 | pheader 2221 | printmbcharset 2222 | pmbcs 2223 | printmbfont 2224 | pmbfn 2225 | printoptions 2226 | popt 2227 | prompt 2228 | noprompt 2229 | pumborder 2230 | pb 2231 | pumheight 2232 | ph 2233 | pummaxwidth 2234 | pmw 2235 | pumwidth 2236 | pw 2237 | pythondll 2238 | pythonhome 2239 | pythonthreedll 2240 | pythonthreehome 2241 | pyxversion 2242 | pyx 2243 | quickfixtextfunc 2244 | qftf 2245 | quoteescape 2246 | qe 2247 | readonly 2248 | ro 2249 | noreadonly 2250 | noro 2251 | redrawtime 2252 | rdt 2253 | regexpengine 2254 | re 2255 | relativenumber 2256 | rnu 2257 | norelativenumber 2258 | nornu 2259 | remap 2260 | noremap 2261 | renderoptions 2262 | rop 2263 | report 2264 | restorescreen 2265 | rs 2266 | norestorescreen 2267 | nors 2268 | revins 2269 | ri 2270 | norevins 2271 | nori 2272 | rightleft 2273 | rl 2274 | norightleft 2275 | norl 2276 | rightleftcmd 2277 | rlc 2278 | rubydll 2279 | ruler 2280 | ru 2281 | noruler 2282 | noru 2283 | rulerformat 2284 | ruf 2285 | runtimepath 2286 | rtp 2287 | scroll 2288 | scr 2289 | scrollbind 2290 | scb 2291 | noscrollbind 2292 | noscb 2293 | scrollfocus 2294 | scf 2295 | noscrollfocus 2296 | noscf 2297 | scrolljump 2298 | sj 2299 | scrolloff 2300 | so 2301 | scrollopt 2302 | sbo 2303 | sections 2304 | sect 2305 | secure 2306 | nosecure 2307 | selection 2308 | sel 2309 | selectmode 2310 | slm 2311 | sessionoptions 2312 | ssop 2313 | shell 2314 | sh 2315 | shellcmdflag 2316 | shcf 2317 | shellpipe 2318 | sp 2319 | shellquote 2320 | shq 2321 | shellredir 2322 | srr 2323 | shellslash 2324 | ssl 2325 | noshellslash 2326 | nossl 2327 | shelltemp 2328 | stmp 2329 | noshelltemp 2330 | nostmp 2331 | shelltype 2332 | st 2333 | shellxescape 2334 | sxe 2335 | shellxquote 2336 | sxq 2337 | shiftround 2338 | sr 2339 | noshiftround 2340 | nosr 2341 | shiftwidth 2342 | sw 2343 | shortmess 2344 | shm 2345 | shortname 2346 | sn 2347 | noshortname 2348 | nosn 2349 | showbreak 2350 | sbr 2351 | showcmd 2352 | sc 2353 | noshowcmd 2354 | nosc 2355 | showcmdloc 2356 | sloc 2357 | showfulltag 2358 | sft 2359 | noshowfulltag 2360 | nosft 2361 | showmatch 2362 | sm 2363 | noshowmatch 2364 | nosm 2365 | showmode 2366 | smd 2367 | noshowmode 2368 | nosmd 2369 | showtabline 2370 | stal 2371 | showtabpanel 2372 | stpl 2373 | sidescroll 2374 | ss 2375 | sidescrolloff 2376 | siso 2377 | signcolumn 2378 | scl 2379 | smartcase 2380 | scs 2381 | nosmartcase 2382 | noscs 2383 | smartindent 2384 | si 2385 | nosmartindent 2386 | nosi 2387 | smarttab 2388 | sta 2389 | nosmarttab 2390 | nosta 2391 | smoothscroll 2392 | sms 2393 | nosmoothscroll 2394 | nosms 2395 | softtabstop 2396 | sts 2397 | spell 2398 | nospell 2399 | spellcapcheck 2400 | spc 2401 | spellfile 2402 | spf 2403 | spelllang 2404 | spl 2405 | spelloptions 2406 | spo 2407 | spellsuggest 2408 | sps 2409 | splitbelow 2410 | sb 2411 | nosplitbelow 2412 | nosb 2413 | splitkeep 2414 | spk 2415 | splitright 2416 | spr 2417 | nosplitright 2418 | nospr 2419 | startofline 2420 | sol 2421 | nostartofline 2422 | nosol 2423 | statusline 2424 | stl 2425 | suffixes 2426 | su 2427 | suffixesadd 2428 | sua 2429 | swapfile 2430 | swf 2431 | noswapfile 2432 | noswf 2433 | swapsync 2434 | sws 2435 | switchbuf 2436 | swb 2437 | synmaxcol 2438 | smc 2439 | syntax 2440 | syn 2441 | tabclose 2442 | tcl 2443 | tabline 2444 | tal 2445 | tabpagemax 2446 | tpm 2447 | tabpanel 2448 | tpl 2449 | tabpanelopt 2450 | tplo 2451 | tabstop 2452 | ts 2453 | tagbsearch 2454 | tbs 2455 | notagbsearch 2456 | notbs 2457 | tagcase 2458 | tc 2459 | tagfunc 2460 | tfu 2461 | taglength 2462 | tl 2463 | tagrelative 2464 | tr 2465 | notagrelative 2466 | notr 2467 | tags 2468 | tag 2469 | tagstack 2470 | tgst 2471 | notagstack 2472 | notgst 2473 | tcldll 2474 | term 2475 | termbidi 2476 | tbidi 2477 | notermbidi 2478 | notbidi 2479 | termencoding 2480 | tenc 2481 | termguicolors 2482 | tgc 2483 | notermguicolors 2484 | notgc 2485 | termwinkey 2486 | twk 2487 | termwinscroll 2488 | twsl 2489 | termwinsize 2490 | tws 2491 | termwintype 2492 | twt 2493 | terse 2494 | noterse 2495 | textauto 2496 | ta 2497 | notextauto 2498 | nota 2499 | textmode 2500 | tx 2501 | notextmode 2502 | notx 2503 | textwidth 2504 | tw 2505 | thesaurus 2506 | tsr 2507 | thesaurusfunc 2508 | tsrfu 2509 | tildeop 2510 | top 2511 | notildeop 2512 | notop 2513 | timeout 2514 | to 2515 | notimeout 2516 | noto 2517 | ttimeout 2518 | nottimeout 2519 | timeoutlen 2520 | tm 2521 | ttimeoutlen 2522 | ttm 2523 | title 2524 | notitle 2525 | titlelen 2526 | titleold 2527 | titlestring 2528 | toolbar 2529 | tb 2530 | toolbariconsize 2531 | tbis 2532 | ttybuiltin 2533 | tbi 2534 | nottybuiltin 2535 | notbi 2536 | ttyfast 2537 | tf 2538 | nottyfast 2539 | notf 2540 | ttymouse 2541 | ttym 2542 | ttyscroll 2543 | tsl 2544 | ttytype 2545 | tty 2546 | undodir 2547 | udir 2548 | undofile 2549 | noundofile 2550 | udf 2551 | noudf 2552 | undolevels 2553 | ul 2554 | undoreload 2555 | ur 2556 | updatecount 2557 | uc 2558 | updatetime 2559 | ut 2560 | varsofttabstop 2561 | vsts 2562 | vartabstop 2563 | vts 2564 | verbose 2565 | vbs 2566 | verbosefile 2567 | vfile 2568 | viewdir 2569 | vdir 2570 | viewoptions 2571 | vop 2572 | viminfo 2573 | vi 2574 | viminfofile 2575 | vif 2576 | virtualedit 2577 | ve 2578 | visualbell 2579 | vb 2580 | novisualbell 2581 | novb 2582 | warn 2583 | nowarn 2584 | weirdinvert 2585 | wiv 2586 | noweirdinvert 2587 | nowiv 2588 | whichwrap 2589 | ww 2590 | wildchar 2591 | wc 2592 | wildcharm 2593 | wcm 2594 | wildignore 2595 | wig 2596 | wildignorecase 2597 | wic 2598 | nowildignorecase 2599 | nowic 2600 | wildmenu 2601 | wmnu 2602 | nowildmenu 2603 | nowmnu 2604 | wildmode 2605 | wim 2606 | wildoptions 2607 | wop 2608 | winaltkeys 2609 | wak 2610 | wincolor 2611 | wcr 2612 | window 2613 | wi 2614 | winfixbuf 2615 | wfb 2616 | winfixheight 2617 | wfh 2618 | nowinfixheight 2619 | nowfh 2620 | winfixwidth 2621 | wfw 2622 | nowinfixwidth 2623 | nowfw 2624 | winheight 2625 | wh 2626 | winminheight 2627 | wmh 2628 | winminwidth 2629 | wmw 2630 | winptydll 2631 | winwidth 2632 | wiw 2633 | wlseat 2634 | wse 2635 | wlsteal 2636 | wst 2637 | nowlsteal 2638 | nowst 2639 | wltimeoutlen 2640 | wtm 2641 | wrap 2642 | nowrap 2643 | wrapmargin 2644 | wm 2645 | wrapscan 2646 | ws 2647 | nowrapscan 2648 | nows 2649 | write 2650 | nowrite 2651 | writeany 2652 | wa 2653 | nowriteany 2654 | nowa 2655 | writebackup 2656 | wb 2657 | nowritebackup 2658 | nowb 2659 | writedelay 2660 | wd 2661 | xtermcodes 2662 | noxtermcodes 2663 | END 2664 | 2665 | export const option: string = option_list->join() 2666 | 2667 | # option_can_be_after {{{1 2668 | 2669 | export const option_can_be_after: string = '\%(\%(^\|[-+ \t!([>]\)\@1<=\|{\@1<=\)' 2670 | 2671 | # option_modifier {{{1 2672 | 2673 | export const option_modifier: string = '\%(&\%(vim\)\=\|[ =<< trim END 2682 | t_8b 2683 | t_8f 2684 | t_8u 2685 | t_AB 2686 | t_AF 2687 | t_AL 2688 | t_AU 2689 | t_BD 2690 | t_BE 2691 | t_CF 2692 | t_CS 2693 | t_CV 2694 | t_Ce 2695 | t_Co 2696 | t_Cs 2697 | t_DL 2698 | t_Ds 2699 | t_EC 2700 | t_EI 2701 | t_F1 2702 | t_F2 2703 | t_F3 2704 | t_F4 2705 | t_F5 2706 | t_F6 2707 | t_F7 2708 | t_F8 2709 | t_F9 2710 | t_GP 2711 | t_IE 2712 | t_IS 2713 | t_K1 2714 | t_K3 2715 | t_K4 2716 | t_K5 2717 | t_K6 2718 | t_K7 2719 | t_K8 2720 | t_K9 2721 | t_KA 2722 | t_KB 2723 | t_KC 2724 | t_KD 2725 | t_KE 2726 | t_KF 2727 | t_KG 2728 | t_KH 2729 | t_KI 2730 | t_KJ 2731 | t_KK 2732 | t_KL 2733 | t_PE 2734 | t_PS 2735 | t_RB 2736 | t_RC 2737 | t_RF 2738 | t_RI 2739 | t_RK 2740 | t_RS 2741 | t_RT 2742 | t_RV 2743 | t_Ri 2744 | t_SC 2745 | t_SH 2746 | t_SI 2747 | t_SR 2748 | t_ST 2749 | t_Sb 2750 | t_Sf 2751 | t_Si 2752 | t_TE 2753 | t_TI 2754 | t_Te 2755 | t_Ts 2756 | t_Us 2757 | t_VS 2758 | t_WP 2759 | t_WS 2760 | t_XM 2761 | t_ZH 2762 | t_ZR 2763 | t_al 2764 | t_bc 2765 | t_cd 2766 | t_ce 2767 | t_ci 2768 | t_cl 2769 | t_cm 2770 | t_cs 2771 | t_cv 2772 | t_da 2773 | t_db 2774 | t_dl 2775 | t_ds 2776 | t_ed 2777 | t_el 2778 | t_f1 2779 | t_f2 2780 | t_f3 2781 | t_f4 2782 | t_f5 2783 | t_f6 2784 | t_f7 2785 | t_f8 2786 | t_f9 2787 | t_fd 2788 | t_fe 2789 | t_fs 2790 | t_il 2791 | t_k1 2792 | t_k2 2793 | t_k3 2794 | t_k4 2795 | t_k5 2796 | t_k6 2797 | t_k7 2798 | t_k8 2799 | t_k9 2800 | t_kB 2801 | t_kD 2802 | t_kI 2803 | t_kN 2804 | t_kP 2805 | t_kb 2806 | t_kd 2807 | t_ke 2808 | t_kh 2809 | t_kl 2810 | t_kr 2811 | t_ks 2812 | t_ku 2813 | t_le 2814 | t_mb 2815 | t_md 2816 | t_me 2817 | t_mr 2818 | t_ms 2819 | t_nd 2820 | t_op 2821 | t_se 2822 | t_so 2823 | t_sr 2824 | t_tb 2825 | t_te 2826 | t_ti 2827 | t_tp 2828 | t_ts 2829 | t_u7 2830 | t_ue 2831 | t_us 2832 | t_ut 2833 | t_vb 2834 | t_ve 2835 | t_vi 2836 | t_vs 2837 | t_xn 2838 | t_xo 2839 | t_xs 2840 | END 2841 | 2842 | export const option_terminal: string = option_terminal_list->join() 2843 | 2844 | # option_terminal_special {{{1 2845 | 2846 | const option_terminal_special_list: list =<< trim END 2847 | t_#2 2848 | t_#4 2849 | t_%1 2850 | t_%i 2851 | t_&8 2852 | t_*7 2853 | t_@7 2854 | t_k; 2855 | END 2856 | 2857 | export const option_terminal_special: string = option_terminal_special_list->join("\\|") 2858 | 2859 | # option_valid {{{1 2860 | 2861 | export const option_valid: string = '\%([a-z]\{2,}\>\|t_[a-zA-Z0-9#%*:@_]\{2}\)' 2862 | 2863 | # pattern_delimiter {{{1 2864 | 2865 | export const pattern_delimiter: string = '[^-+*/%.:# \t[:alnum:]\"|]\@=.\|->\@!\%(=\s\)\@!\|[+*/%]\%(=\s\)\@!' 2866 | 2867 | # wincmd_valid {{{1 2868 | 2869 | export const wincmd_valid: string = '/\s\@1<=\%([-\]+:<=>FHJKLPRSTW^_bcdfhijklnopqrstvwxz}|]\|gF\|gT\|g]\|gf\|gt\|g}\)\_s\@=/' 2870 | --------------------------------------------------------------------------------