vim-patch:f6869212c9e1

runtime(vim): Update syntax file (vim/vim#13653)

Improve variable highlighting in :let, :unlet, :const and :for commands.

Match registers and local, global and terminal option variables.

f6869212c9

Co-authored-by: dkearns <dougkearns@gmail.com>
This commit is contained in:
Christian Clason
2023-12-10 16:14:29 +01:00
parent f31f260f0c
commit 745b74162c

View File

@@ -153,7 +153,9 @@ syn match vimCmdSep "[:|]\+" skipwhite nextgroup=vimAddress,vimAutoCmd,vimEcho,v
syn match vimIsCommand "\<\h\w*\>" contains=vimCommand syn match vimIsCommand "\<\h\w*\>" contains=vimCommand
syn match vimVar contained "\<\h[a-zA-Z0-9#_]*\>" syn match vimVar contained "\<\h[a-zA-Z0-9#_]*\>"
syn match vimVar "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>" syn match vimVar "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>"
syn match vimVar "\s\zs&\a\+\>" syn match vimVar "\s\zs&\%([lg]:\)\=\a\+\>"
syn match vimVar "\s\zs&t_\S[a-zA-Z0-9]\>"
syn match vimVar "\s\zs&t_k;"
syn match vimFBVar contained "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>" syn match vimFBVar contained "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>"
syn keyword vimCommand contained in syn keyword vimCommand contained in
@@ -346,6 +348,7 @@ syn match vimRegister '\<norm\s\+\zs"[a-zA-Z0-9]'
syn match vimRegister '\<normal\s\+\zs"[a-zA-Z0-9]' syn match vimRegister '\<normal\s\+\zs"[a-zA-Z0-9]'
syn match vimRegister '@"' syn match vimRegister '@"'
syn match vimPlainRegister contained '"[a-zA-Z0-9\-:.%#*+=]' syn match vimPlainRegister contained '"[a-zA-Z0-9\-:.%#*+=]'
syn match vimLetRegister contained '@["0-9\-a-zA-Z#=*+_/]'
syn match vimAddress ",\zs[.$]" skipwhite nextgroup=vimSubst1 syn match vimAddress ",\zs[.$]" skipwhite nextgroup=vimSubst1
syn match vimAddress "%\ze\a" skipwhite nextgroup=vimString,vimSubst1 syn match vimAddress "%\ze\a" skipwhite nextgroup=vimString,vimSubst1
@@ -367,9 +370,19 @@ syn match vimSetMod contained "&vim\=\|[!&?<]\|all&"
" Let: {{{2 " Let: {{{2
" === " ===
syn keyword vimLet let unl[et] skipwhite nextgroup=vimVar,vimFuncVar,vimLetHereDoc syn keyword vimLet let skipwhite nextgroup=vimVar,vimFuncVar,vimLetHereDoc,vimLetRegister,vimVarList
syn keyword vimConst cons[t] skipwhite nextgroup=vimVar,vimLetHereDoc,vimVarList
syn region vimVarList contained start="\[" end="]" contains=vimVar,vimContinue
syn keyword vimUnlet unl[et] skipwhite nextgroup=vimUnletBang,vimUnletVars
syn match vimUnletBang contained "!" skipwhite nextgroup=vimUnletVars
syn region vimUnletVars contained start="$\I\|\h" skip="\n\s*\\" end="$" end="|" contains=vimVar,vimEnvvar,vimContinue,vimString,vimNumber
VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='=<<\s*\%(trim\s\+\%(eval\s\+\)\=\|eval\s\+\%(trim\s\+\)\=\)\=\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\s*\z1\s*$' VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='=<<\s*\%(trim\s\+\%(eval\s\+\)\=\|eval\s\+\%(trim\s\+\)\=\)\=\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\s*\z1\s*$'
" For: {{{2
" ===
syn keyword vimFor for skipwhite nextgroup=vimVar,vimVarList
" Abbreviations: {{{2 " Abbreviations: {{{2
" ============= " =============
syn keyword vimAbb ab[breviate] ca[bbrev] inorea[bbrev] cnorea[bbrev] norea[bbrev] ia[bbrev] skipwhite nextgroup=vimMapMod,vimMapLhs syn keyword vimAbb ab[breviate] ca[bbrev] inorea[bbrev] cnorea[bbrev] norea[bbrev] ia[bbrev] skipwhite nextgroup=vimMapMod,vimMapLhs
@@ -863,6 +876,7 @@ if !exists("skip_vim_syntax_inits")
hi def link vimCommentString vimString hi def link vimCommentString vimString
hi def link vimCommentTitle PreProc hi def link vimCommentTitle PreProc
hi def link vimCondHL vimCommand hi def link vimCondHL vimCommand
hi def link vimConst vimCommand
hi def link vimContinue Special hi def link vimContinue Special
hi def link vimCtrlChar SpecialChar hi def link vimCtrlChar SpecialChar
hi def link vimEchoHLNone vimGroup hi def link vimEchoHLNone vimGroup
@@ -912,6 +926,7 @@ if !exists("skip_vim_syntax_inits")
hi def link vimLetHereDoc vimString hi def link vimLetHereDoc vimString
hi def link vimLetHereDocStart Special hi def link vimLetHereDocStart Special
hi def link vimLetHereDocStop Special hi def link vimLetHereDocStop Special
hi def link vimLetRegister Special
hi def link vimLineComment vimComment hi def link vimLineComment vimComment
hi def link vim9LineComment vimComment hi def link vim9LineComment vimComment
hi def link vimMapBang vimCommand hi def link vimMapBang vimCommand
@@ -988,6 +1003,8 @@ if !exists("skip_vim_syntax_inits")
hi def link vimSynType vimSpecial hi def link vimSynType vimSpecial
hi def link vimTodo Todo hi def link vimTodo Todo
hi def link vimType Type hi def link vimType Type
hi def link vimUnlet vimCommand
hi def link vimUnletBang vimCommand
hi def link vimUnmap vimMap hi def link vimUnmap vimMap
hi def link vimUserAttrbCmpltFunc Special hi def link vimUserAttrbCmpltFunc Special
hi def link vimUserAttrbCmplt vimSpecial hi def link vimUserAttrbCmplt vimSpecial