Mercurial > vim
comparison runtime/syntax/generator/vim.vim.base @ 34439:a4aa5fe4a477
runtime(vim): Update base-syntax, improve :echo highlighting (#14103)
Commit: https://github.com/vim/vim/commit/b1427b46f5fe50a1daba102c4017d0ef2624b3ba
Author: dkearns <dougkearns@gmail.com>
Date: Wed Feb 28 05:59:30 2024 +1100
runtime(vim): Update base-syntax, improve :echo highlighting (https://github.com/vim/vim/issues/14103)
- Normalise behaviour of :echo commands and improve expression matching.
- Allow continued argument lines.
- Refine string interpolation groups.
- Remove duplicated :menu and :map generated commands that are handled
specially later in the file.
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 27 Feb 2024 20:00:03 +0100 |
parents | f7438681c79b |
children | 1454f1f19f98 |
comparison
equal
deleted
inserted
replaced
34438:f8951966ef0c | 34439:a4aa5fe4a477 |
---|---|
1 " Vim syntax file | 1 " Vim syntax file |
2 " Language: Vim script | 2 " Language: Vim script |
3 " Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com> | 3 " Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com> |
4 " Doug Kearns <dougkearns@gmail.com> | 4 " Doug Kearns <dougkearns@gmail.com> |
5 " URL: https://github.com/vim-jp/syntax-vim-ex | 5 " URL: https://github.com/vim-jp/syntax-vim-ex |
6 " Last Change: Feb 18, 2024 | 6 " Last Change: Feb 27, 2024 |
7 " Former Maintainer: Charles E. Campbell | 7 " Former Maintainer: Charles E. Campbell |
8 " Base File URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM | 8 " Base File URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM |
9 " Base File Version: 9.0-25 | 9 " Base File Version: 9.0-25 |
10 | 10 |
11 " DO NOT CHANGE DIRECTLY. | 11 " DO NOT CHANGE DIRECTLY. |
174 syn match vimVar "\s\zs&t_\S[a-zA-Z0-9]\>" | 174 syn match vimVar "\s\zs&t_\S[a-zA-Z0-9]\>" |
175 syn match vimVar "\s\zs&t_k;" | 175 syn match vimVar "\s\zs&t_k;" |
176 syn match vimFBVar contained "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>" | 176 syn match vimFBVar contained "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>" |
177 syn keyword vimCommand contained in | 177 syn keyword vimCommand contained in |
178 | 178 |
179 syn cluster vimExprList contains=vimEnvvar,vimFunc,vimFuncVar,vimNumber,vimOper,vimOperParen,vimLetRegister,vimString,vimVar | |
180 | |
179 " Insertions And Appends: insert append {{{2 | 181 " Insertions And Appends: insert append {{{2 |
180 " (buftype != nofile test avoids having append, change, insert show up in the command window) | 182 " (buftype != nofile test avoids having append, change, insert show up in the command window) |
181 " ======================= | 183 " ======================= |
182 if &buftype != 'nofile' | 184 if &buftype != 'nofile' |
183 syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=a\%[ppend]$" matchgroup=vimCommand end="^\.$"" | 185 syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=a\%[ppend]$" matchgroup=vimCommand end="^\.$"" |
342 " syn match vimEscape contained +\\[befnrt\"]+ | 344 " syn match vimEscape contained +\\[befnrt\"]+ |
343 syn match vimEscape contained "\\\o\{1,3}\|\\[xX]\x\{1,2}\|\\u\x\{1,4}\|\\U\x\{1,8}" | 345 syn match vimEscape contained "\\\o\{1,3}\|\\[xX]\x\{1,2}\|\\u\x\{1,4}\|\\U\x\{1,8}" |
344 syn match vimEscape contained "\\<" contains=vimNotation | 346 syn match vimEscape contained "\\<" contains=vimNotation |
345 syn match vimEscape contained "\\<\*[^>]*>\=>" | 347 syn match vimEscape contained "\\<\*[^>]*>\=>" |
346 | 348 |
347 syn region vimString start=+$'+ end=+'+ skip=+''+ oneline contains=vimStringInterpolationBrace,vimStringInterpolationExpr | 349 syn region vimString oneline start=+$'+ skip=+''+ end=+'+ contains=vimStringInterpolationBrace,vimStringInterpolationExpr |
348 syn region vimString start=+$"+ end=+"+ oneline contains=@vimStringGroup,vimStringInterpolationBrace,vimStringInterpolationExpr | 350 syn region vimString oneline start=+$"+ end=+"+ contains=@vimStringGroup,vimStringInterpolationBrace,vimStringInterpolationExpr |
349 syn region vimStringInterpolationExpr matchgroup=vimSep start=+{+ end=+}+ oneline contains=vimFunc,vimFuncVar,vimOper,vimOperParen,vimNotation,vimNumber,vimString,vimVar | 351 syn region vimStringInterpolationExpr oneline contained matchgroup=vimSep start=+{+ end=+}+ contains=@vimExprList |
350 syn match vimStringInterpolationBrace "{{" | 352 syn match vimStringInterpolationBrace contained "{{" |
351 syn match vimStringInterpolationBrace "}}" | 353 syn match vimStringInterpolationBrace contained "}}" |
352 | 354 |
353 " Substitutions: {{{2 | 355 " Substitutions: {{{2 |
354 " ============= | 356 " ============= |
355 syn cluster vimSubstList contains=vimPatSep,vimPatRegion,vimPatSepErr,vimSubstTwoBS,vimSubstRange,vimNotation | 357 syn cluster vimSubstList contains=vimPatSep,vimPatRegion,vimPatSepErr,vimSubstTwoBS,vimSubstRange,vimNotation |
356 syn cluster vimSubstRepList contains=vimSubstSubstr,vimSubstTwoBS,vimNotation | 358 syn cluster vimSubstRepList contains=vimSubstSubstr,vimSubstTwoBS,vimNotation |
440 syn keyword vimAutoCmd au[tocmd] do[autocmd] doautoa[ll] skipwhite nextgroup=vimAutoEventList | 442 syn keyword vimAutoCmd au[tocmd] do[autocmd] doautoa[ll] skipwhite nextgroup=vimAutoEventList |
441 syn match vimAutoCmdMod "\(++\)\=\(once\|nested\)" | 443 syn match vimAutoCmdMod "\(++\)\=\(once\|nested\)" |
442 | 444 |
443 " Echo And Execute: -- prefer strings! {{{2 | 445 " Echo And Execute: -- prefer strings! {{{2 |
444 " ================ | 446 " ================ |
445 syn region vimEcho oneline excludenl matchgroup=vimCommand start="\<ec\%[ho]\>" skip="\(\\\\\)*\\|" end="$\||" contains=vimFunc,vimFuncVar,vimString,vimVar | 447 " GEN_SYN_VIM: vimCommand echo, START_STR='syn keyword vimEcho', END_STR='skipwhite nextgroup=vimEchoExpr' |
446 syn region vimExecute oneline excludenl matchgroup=vimCommand start="\<exe\%[cute]\>" skip="\(\\\\\)*\\|" end="$\||\|<[cC][rR]>" contains=vimFuncVar,vimIsCommand,vimOper,vimNotation,vimOperParen,vimString,vimVar | 448 syn region vimEchoExpr contained start="[^[:space:]|]" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|" end="$" contains=@vimContinue,@vimExprList |
447 syn match vimEchoHL "echohl\=" skipwhite nextgroup=vimGroup,vimHLGroup,vimEchoHLNone | 449 |
450 syn match vimEchoHL "\<echohl\=\>" skipwhite nextgroup=vimGroup,vimHLGroup,vimEchoHLNone | |
448 syn case ignore | 451 syn case ignore |
449 syn keyword vimEchoHLNone none | 452 syn keyword vimEchoHLNone none |
450 syn case match | 453 syn case match |
454 | |
455 syn region vimExecute oneline excludenl matchgroup=vimCommand start="\<exe\%[cute]\>" skip="\(\\\\\)*\\|" end="$\||\|<[cC][rR]>" contains=vimFuncVar,vimIsCommand,vimOper,vimNotation,vimOperParen,vimString,vimVar | |
451 | 456 |
452 " Maps: {{{2 | 457 " Maps: {{{2 |
453 " ==== | 458 " ==== |
454 syn match vimMap "\<map\>\ze\s*(\@!" skipwhite nextgroup=vimMapMod,vimMapLhs | 459 syn match vimMap "\<map\>\ze\s*(\@!" skipwhite nextgroup=vimMapMod,vimMapLhs |
455 syn match vimMap "\<map!" contains=vimMapBang skipwhite nextgroup=vimMapMod,vimMapLhs | 460 syn match vimMap "\<map!" contains=vimMapBang skipwhite nextgroup=vimMapMod,vimMapLhs |
947 hi def link vimCondHL vimCommand | 952 hi def link vimCondHL vimCommand |
948 hi def link vimConst vimCommand | 953 hi def link vimConst vimCommand |
949 hi def link vimContinue Special | 954 hi def link vimContinue Special |
950 hi def link vimContinueComment vimComment | 955 hi def link vimContinueComment vimComment |
951 hi def link vimCtrlChar SpecialChar | 956 hi def link vimCtrlChar SpecialChar |
957 hi def link vimEcho vimCommand | |
952 hi def link vimEchoHLNone vimGroup | 958 hi def link vimEchoHLNone vimGroup |
953 hi def link vimEchoHL vimCommand | 959 hi def link vimEchoHL vimCommand |
954 hi def link vimElseIfErr Error | 960 hi def link vimElseIfErr Error |
955 hi def link vimElseif vimCondHL | 961 hi def link vimElseif vimCondHL |
956 hi def link vimEnvvar PreProc | 962 hi def link vimEnvvar PreProc |