diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim index 8abe337f9f..f5dae0f94e 100644 --- a/runtime/ftplugin/vim.vim +++ b/runtime/ftplugin/vim.vim @@ -58,7 +58,7 @@ endif " Set 'comments' to format dashed lists in comments, both in Vim9 and legacy " script. -setlocal com=sO:#\ -,mO:#\ \ ,eO:##,:#,sO:\"\ -,mO:\"\ \ ,eO:\"\",:\" +setlocal com=sO:#\ -,mO:#\ \ ,eO:##,:#\\\ ,:#,sO:\"\ -,mO:\"\ \ ,eO:\"\",:\"\\\ ,:\" " Format comments to be up to 78 characters long diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 5fb47bdcef..327790fe92 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -204,7 +204,7 @@ syn keyword vimAugroupKey contained aug[roup] " Operators: {{{2 " ========= -syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimType,vimRegister,vimContinue,vim9Comment,vimVar +syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimType,vimRegister,@vimContinue,vim9Comment,vimVar syn match vimOper "||\|&&\|[-+*/%.!]" skipwhite nextgroup=vimString,vimSpecFile syn match vimOper "\%#=1\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\|!\~#\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile syn match vimOper "\(\" skipwhite nextgroup=vimString,vimSpecFile @@ -476,23 +476,23 @@ syn match vimNormCmds contained ".*$" " Syntax: {{{2 "======= -syn match vimGroupList contained "@\=[^[:space:],]\+" nextgroup=vimGroupListComma skipwhite skipnl -syn match vimGroupListContinue contained "\\" nextgroup=vimGroupList skipwhite -syn match vimGroupListComma contained "," nextgroup=vimGroupList,vimGroupListContinue skipwhite skipnl -syn keyword vimGroupSpecial contained ALL ALLBUT CONTAINED TOP +syn match vimGroupList contained "[^[:space:],]\+\%(\s*,\s*[^[:space:],]\+\)*" contains=vimGroupSpecial +syn region vimGroupList contained start=/^\s*["#]\\ \|^\s*\\\|[^[:space:],]\+\s*,/ skip=/\s*\n\s*\\\|\s*\n\s*["#]\\ \|^\s*\\\|^\s*["#]\\ / end=/[^[:space:],]\s*$\|[^[:space:],]\ze\s\+\w/ contains=@vimContinue,vimGroupSpecial +syn keyword vimGroupSpecial contained ALL ALLBUT CONTAINED TOP + if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsynerror") syn match vimSynError contained "\i\+" syn match vimSynError contained "\i\+=" nextgroup=vimGroupList endif -syn match vimSynContains contained "\