runtime(vim): Update base syntax, improve :match highlighting

- Match the range prefix separately as a count.
- Match an explicit count of 1, rarely used but seen in the wild.
- Allow whitespace between the count and command.

closes: #17717

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Doug Kearns
2025-07-13 09:05:23 +02:00
committed by Christian Brabandt
parent 2ab4f907a2
commit ce1d1969f3
145 changed files with 950 additions and 898 deletions

View File

@ -2,7 +2,7 @@
" Language: Vim script
" Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com>
" Doug Kearns <dougkearns@gmail.com>
" Last Change: 2025 Jul 10
" Last Change: 2025 Jul 11
" Former Maintainer: Charles E. Campbell
" DO NOT CHANGE DIRECTLY.
@ -289,7 +289,7 @@ syn cluster vim9CmdList contains=vim9Abstract,vim9Class,vim9Const,vim9Enum,vim9E
syn match vimCmdSep "\\\@1<!|" skipwhite nextgroup=@vimCmdList,vimSubst1,@vimFunc
syn match vimCmdSep ":\+" skipwhite nextgroup=@vimCmdList,vimSubst1
syn match vimCount contained "\d\+"
syn match vimIsCommand "\<\%(\h\w*\|[23]mat\%[ch]\)\>" nextgroup=vimBang contains=vimCommand
syn match vimIsCommand "\<\h\w*\>" nextgroup=vimBang contains=vimCommand
syn match vimBang contained "!"
syn match vimWhitespace contained "\s\+"
@ -1501,12 +1501,18 @@ endif
" Match: {{{2
" =====
syn match vimMatch "\<[23]\=mat\%[ch]\>" skipwhite nextgroup=vimMatchGroup,vimMatchNone
syn match vimMatchGroup contained "[[:alnum:]._-]\+" skipwhite nextgroup=vimMatchPattern
syn match vimMatch "\<\%([1-3]\s*\)\=mat\%[ch]\>" skipwhite nextgroup=vimMatchGroup,vimMatchNone contains=vimCount
syn match vimMatchGroup contained "[[:alnum:]._-]\+" skipwhite nextgroup=vimMatchPattern
syn case ignore
syn keyword vimMatchNone contained none
syn case match
syn region vimMatchPattern contained matchgroup=Delimiter start="\z([!#$%&'()*+,-./:;<=>?@[\]^_`{}~]\)" skip="\\\\\|\\\z1" end="\z1" contains=@vimSubstList oneline
syn region vimMatchPattern contained
\ matchgroup=Delimiter
\ start="\z([!#$%&'()*+,-./:;<=>?@[\]^_`{}~]\)"
\ skip="\\\\\|\\\z1"
\ end="\z1"
\ contains=@vimSubstList
\ oneline
" Normal: {{{2
" ======