codekingpro/portable-devtools
114k
1" Vim syntax file2" Language: Vim script3" Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com>4" Doug Kearns <dougkearns@gmail.com>5" Last Change: 2026 Apr 156" Former Maintainer: Charles E. Campbell7 8" DO NOT CHANGE DIRECTLY.9" THIS FILE PARTLY GENERATED BY gen_syntax_vim.vim.10" (Search string "GEN_SYN_VIM:" in this file)11 12" Quit when a syntax file was already loaded {{{113if exists("b:current_syntax")14 finish15endif16let s:keepcpo= &cpo17set cpo&vim18 19" Feature testing {{{120 21" NOTE: vimsyn_force_vim9 for internal use only22let s:vim9script = get(b:, "vimsyn_force_vim9", v:false) || "\n" .. getline(1, 32)->join("\n") =~# '\n\s*vim9\%[script]\>'23 24function s:has(feature)25 return has(a:feature) || index(get(g:, "vimsyn_vim_features", []), a:feature) != -126endfunction27 28" Automatically generated keyword lists: {{{129 30" vimTodo: contains common special-notices for comments {{{231" Use the vimCommentGroup cluster to add your own.32syn keyword vimTodo contained COMBAK FIXME TODO XXX33syn cluster vimCommentGroup contains=vimTodo,@Spell34 35" regular vim commands {{{236" GEN_SYN_VIM: vimCommand normal, START_STR='syn keyword vimCommand contained', END_STR='nextgroup=vimBang'37syn keyword vimCommand contained al[l] ar[gs] arga[dd] argd[elete] argded[upe] arge[dit] argg[lobal] argl[ocal] argu[ment] as[cii] b[uffer] bN[ext] ba[ll] bad[d] balt bd[elete] bf[irst] bl[ast] bm[odified] bn[ext] bp[revious] br[ewind] brea[k] buffers bun[load] bw[ipeout] cN[ext] cNf[ile] cabo[ve] cad[dbuffer] cadde[xpr] caddf[ile] caf[ter] cb[uffer] cbe[fore] cbel[ow] cbo[ttom] cc ccl[ose] ce[nter] cex[pr] cf[ile] cfir[st] cg[etfile] cgetb[uffer] cgete[xpr] changes che[ckpath] checkt[ime] chi[story] cl[ist] clip[reset] cla[st] clo[se] cle[arjumps] cn[ext] cnew[er] cnf[ile] col[der] colo[rscheme] comc[lear] comp[iler] con[tinue] cope[n] cp[revious] cpf[ile] cq[uit] cr[ewind] cs[cope] cst[ag] cw[indow] delm[arks] defc[ompile] di[splay] dif[fupdate] diffg[et] diffo[ff] nextgroup=vimBang38syn keyword vimCommand contained diffp[atch] diffpu[t] diffs[plit] difft[his] dig[raphs] disa[ssemble] dj[ump] dli[st] dr[op] ds[earch] dsp[lit] e[dit] ea[rlier] em[enu] endfo[r] endt[ry] endw[hile] ene[w] ex exi[t] exu[sage] f[ile] files fin[d] fina[lly] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] foldo[pen] g[lobal] go[to] gu[i] gv[im] helpc[lose] helpf[ind] helpt[ags] ha[rdcopy] ij[ump] il[ist] int[ro] ip[ut] is[earch] isp[lit] ju[mps] l[ist] lN[ext] lNf[ile] la[st] lab[ove] lad[dexpr] laddb[uffer] laddf[ile] laf[ter] lat[er] lb[uffer] lbe[fore] lbel[ow] lbo[ttom] lcl[ose] lcs[cope] le[ft] lex[pr] lf[ile] lfir[st] lg[etfile] lgetb[uffer] lgete[xpr] lhi[story] ll lla[st] lli[st] lmak[e] lne[xt] lnew[er] lnf[ile] lo[adview] lockv[ar] lol[der] lop[en] lp[revious] nextgroup=vimBang39syn keyword vimCommand contained lpf[ile] lr[ewind] lt[ag] lw[indow] ls m[ove] marks mes[sages] mk[exrc] mks[ession] mksp[ell] mkv[imrc] mkvie[w] mod[e] n[ext] nb[key] nbc[lose] nbs[tart] noh[lsearch] nu[mber] o[pen] ol[dfiles] on[ly] opt[ions] ow[nsyntax] p[rint] pa[ckadd] packl[oadall] pb[uffer] pc[lose] ped[it] po[p] pp[op] pre[serve] prev[ious] ps[earch] pt[ag] ptN[ext] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] q[uit] quita[ll] qa[ll] r[ead] rec[over] red[o] redr[aw] redraws[tatus] redrawt[abline] redrawtabp[anel] reg[isters] res[ize] ret[ab] rew[ind] ri[ght] ru[ntime] rund[o] rv[iminfo] sN[ext] sa[rgument] sal[l] sav[eas] sb[uffer] sbN[ext] sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbp[revious] sbr[ewind] scr[iptnames] nextgroup=vimBang40syn keyword vimCommand contained scripte[ncoding] scriptv[ersion] scs[cope] setf[iletype] sf[ind] sfir[st] sh[ell] sim[alt] sig[n] sla[st] sn[ext] so[urce] spe[llgood] spelld[ump] spelli[nfo] spellr[epall] spellra[re] spellu[ndo] spellw[rong] spr[evious] sre[wind] st[op] sta[g] star[tinsert] startg[replace] startr[eplace] stopi[nsert] stj[ump] sts[elect] sun[hide] sus[pend] sv[iew] sync[bind] smi[le] t tN[ext] ta[g] tags tabc[lose] tabe[dit] tabf[ind] tabfir[st] tabm[ove] tabl[ast] tabn[ext] tabnew tabo[nly] tabp[revious] tabN[ext] tabr[ewind] tabs te[aroff] tf[irst] tj[ump] tl[ast] tn[ext] tp[revious] tr[ewind] try ts[elect] u[ndo] undoj[oin] undol[ist] unh[ide] up[date] v[global] ve[rsion] vi[sual] vie[w] viu[sage] vne[w] vs[plit] w[rite] wN[ext] wa[ll] wi[nsize] nextgroup=vimBang41syn keyword vimCommand contained winp[os] wl[restore] wn[ext] wp[revious] wq wqa[ll] wu[ndo] wv[iminfo] x[it] xa[ll] xr[estore] y[ank] z dl dell delel deletl deletel dp dep delp delep deletp deletep a i nextgroup=vimBang42 43" Lower priority :syn-match to allow for :command/function() distinction44" :chdir is handled specially elsewhere45syn match vimCommand "\<co\%[py]\>" nextgroup=vimBang46syn match vimCommand "\<d\%[elete]\>" nextgroup=vimBang47syn match vimCommand "\<j\%[oin]\>" nextgroup=vimBang48syn match vimCommand "\<sp\%[lit]\>" nextgroup=vimBang49syn match vimCommand "\<sw\%[apname]\>" nextgroup=vimBang50 51" GEN_SYN_VIM: vimCommand modifier, START_STR='syn keyword vimCommandModifier', END_STR='skipwhite nextgroup=vimCommandModifierBang,@vimCmdList'52syn keyword vimCommandModifier abo[veleft] bel[owright] bo[tright] hid[e] hor[izontal] kee[pmarks] keepj[umps] keepp[atterns] keepa[lt] lefta[bove] leg[acy] loc[kmarks] noa[utocmd] nos[wapfile] rightb[elow] san[dbox] sil[ent] tab to[pleft] uns[ilent] verb[ose] vert[ical] vim9[cmd] skipwhite nextgroup=vimCommandModifierBang,@vimCmdList53" :filter is handled specially elsewhere54syn match vimCommandModifierBang contained "\a\@1<=!" skipwhite nextgroup=@vimCmdList55 56" Lower priority :syn-match to allow for :command/function() distinction57syn match vimCommand "\<bro\%[wse]\>" skipwhite nextgroup=vimCommandModifierBang,@vimCmdList58syn match vimCommand "\<conf\%[irm]\>" skipwhite nextgroup=vimCommandModifierBang,@vimCmdList59 60" Lower priority for _new_ to distinguish constructors from the command.61syn match vimCommand contained "\<new\>(\@!"62syn match vimCommand contained "\<z[-+^.=]\=\>"63syn keyword vimStdPlugin contained Arguments Asm Break Cfilter Clear Continue DiffOrig Evaluate Finish Gdb Lfilter Man Over Program Run S Source Step Stop Termdebug TermdebugCommand TOhtml Until Winbar XMLent XMLns64 65" vimOptions are caught only when contained in a vimSet {{{266" GEN_SYN_VIM: vimOption normal, START_STR='syn keyword vimOption contained', END_STR='skipwhite nextgroup=vimSetEqual,vimSetMod'67syn keyword vimOption contained al aleph ari allowrevins ambw ambiwidth arab arabic arshape arabicshape acd autochdir ac autocomplete acl autocompletedelay act autocompletetimeout ai autoindent ar autoread asd autoshelldir aw autowrite awa autowriteall bg background bs backspace bk backup bkc backupcopy bdir backupdir bex backupext bsk backupskip bdlay balloondelay beval ballooneval bevalterm balloonevalterm bexpr balloonexpr bo belloff bin binary bomb brk breakat bri breakindent briopt breakindentopt bsdir browsedir bh bufhidden bl buflisted bt buftype cmp casemap cdh cdhome cd cdpath cedit ccv charconvert chi chistory cin cindent cink cinkeys cino cinoptions cinsd cinscopedecls cinw cinwords cb clipboard cpm clipmethod ch cmdheight cwh cmdwinheight cc colorcolumn skipwhite nextgroup=vimSetEqual,vimSetMod68syn keyword vimOption contained co columns com comments cms commentstring cp compatible cpt complete cfu completefunc cia completeitemalign cot completeopt cpp completepopup csl completeslash cto completetimeout cocu concealcursor cole conceallevel cf confirm ci copyindent cpo cpoptions cm cryptmethod cspc cscopepathcomp csprg cscopeprg csqf cscopequickfix csre cscoperelative cst cscopetag csto cscopetagorder csverb cscopeverbose crb cursorbind cuc cursorcolumn cul cursorline culopt cursorlineopt debug def define deco delcombine dict dictionary diff dia diffanchors dex diffexpr dip diffopt dg digraph dir directory dy display ead eadirection ed edcompatible emo emoji enc encoding eof endoffile eol endofline ea equalalways ep equalprg eb errorbells ef errorfile skipwhite nextgroup=vimSetEqual,vimSetMod69syn keyword vimOption contained efm errorformat ek esckeys ei eventignore eiw eventignorewin et expandtab ex exrc fenc fileencoding fencs fileencodings ff fileformat ffs fileformats fic fileignorecase ft filetype fcs fillchars ffu findfunc fixeol fixendofline fcl foldclose fdc foldcolumn fen foldenable fde foldexpr fdi foldignore fdl foldlevel fdls foldlevelstart fmr foldmarker fdm foldmethod fml foldminlines fdn foldnestmax fdo foldopen fdt foldtext fex formatexpr flp formatlistpat fo formatoptions fp formatprg fs fsync gd gdefault gfm grepformat gp grepprg gcr guicursor gfn guifont gfs guifontset gfw guifontwide ghr guiheadroom gli guiligatures go guioptions guipty gtl guitablabel gtt guitabtooltip hf helpfile hh helpheight hlg helplang hid hidden hl highlight skipwhite nextgroup=vimSetEqual,vimSetMod70syn keyword vimOption contained hi history hk hkmap hkp hkmapp hls hlsearch icon iconstring ic ignorecase imaf imactivatefunc imak imactivatekey imc imcmdline imd imdisable imi iminsert ims imsearch imsf imstatusfunc imst imstyle inc include inex includeexpr is incsearch inde indentexpr indk indentkeys inf infercase im insertmode isf isfname isi isident isk iskeyword isp isprint js joinspaces jop jumpoptions key kmp keymap km keymodel kpc keyprotocol kp keywordprg lmap langmap lm langmenu lnr langnoremap lrm langremap ls laststatus lz lazyredraw lhi lhistory lbr linebreak lines lsp linespace lisp lop lispoptions lw lispwords list lcs listchars lpl loadplugins luadll magic mef makeef menc makeencoding mp makeprg mps matchpairs mat matchtime mco maxcombine mfd maxfuncdepth skipwhite nextgroup=vimSetEqual,vimSetMod71syn keyword vimOption contained mmd maxmapdepth mm maxmem mmp maxmempattern mmt maxmemtot msc maxsearchcount mis menuitems mopt messagesopt msm mkspellmem ml modeline mle modelineexpr mls modelines mlst modelinestrict ma modifiable mod modified more mouse mousef mousefocus mh mousehide mousem mousemodel mousemev mousemoveevent mouses mouseshape mouset mousetime mzq mzquantum mzschemedll mzschemegcdll nf nrformats nu number nuw numberwidth ofu omnifunc odev opendevice opfunc operatorfunc ost osctimeoutlen pp packpath para paragraphs paste pt pastetoggle pex patchexpr pm patchmode pa path perldll pi preserveindent pvh previewheight pvp previewpopup pvw previewwindow pdev printdevice penc printencoding pexpr printexpr pfn printfont pheader printheader pmbcs printmbcharset skipwhite nextgroup=vimSetEqual,vimSetMod72syn keyword vimOption contained pmbfn printmbfont popt printoptions prompt pb pumborder ph pumheight pmw pummaxwidth pumopt pw pumwidth pythondll pythonhome pythonthreedll pythonthreehome pyx pyxversion qftf quickfixtextfunc qe quoteescape ro readonly rdt redrawtime re regexpengine rnu relativenumber remap rop renderoptions report rs restorescreen ri revins rl rightleft rlc rightleftcmd rubydll ru ruler ruf rulerformat rtp runtimepath scr scroll scb scrollbind scf scrollfocus sj scrolljump so scrolloff sop scrolloffpad sbo scrollopt sect sections secure sel selection slm selectmode ssop sessionoptions sh shell shcf shellcmdflag sp shellpipe shq shellquote srr shellredir ssl shellslash stmp shelltemp st shelltype sxe shellxescape sxq shellxquote sr shiftround sw shiftwidth skipwhite nextgroup=vimSetEqual,vimSetMod73syn keyword vimOption contained shm shortmess sn shortname sbr showbreak sc showcmd sloc showcmdloc sft showfulltag sm showmatch smd showmode stal showtabline stpl showtabpanel ss sidescroll siso sidescrolloff scl signcolumn scs smartcase si smartindent sta smarttab sms smoothscroll sts softtabstop spell spc spellcapcheck spf spellfile spl spelllang spo spelloptions sps spellsuggest sb splitbelow spk splitkeep spr splitright sol startofline stl statusline stlo statuslineopt su suffixes sua suffixesadd swf swapfile sws swapsync swb switchbuf smc synmaxcol syn syntax tcl tabclose tal tabline tpm tabpagemax tpl tabpanel tplo tabpanelopt ts tabstop tbs tagbsearch tc tagcase tfu tagfunc tl taglength tr tagrelative tag tags tgst tagstack tcldll term tbidi termbidi tenc termencoding skipwhite nextgroup=vimSetEqual,vimSetMod74syn keyword vimOption contained tgc termguicolors trz termresize tsy termsync twk termwinkey twsl termwinscroll tws termwinsize twt termwintype terse ta textauto tx textmode tw textwidth tsr thesaurus tsrfu thesaurusfunc top tildeop to timeout tm timeoutlen title titlelen titleold titlestring tb toolbar tbis toolbariconsize ttimeout ttm ttimeoutlen tbi ttybuiltin tf ttyfast ttym ttymouse tsl ttyscroll tty ttytype udir undodir udf undofile ul undolevels ur undoreload uc updatecount ut updatetime vsts varsofttabstop vts vartabstop vbs verbose vfile verbosefile vdir viewdir vop viewoptions vi viminfo vif viminfofile ve virtualedit vb visualbell warn wiv weirdinvert ww whichwrap wc wildchar wcm wildcharm wig wildignore wic wildignorecase wmnu wildmenu wim wildmode skipwhite nextgroup=vimSetEqual,vimSetMod75syn keyword vimOption contained wop wildoptions wak winaltkeys wcr wincolor wi window wfb winfixbuf wfh winfixheight wfw winfixwidth wh winheight whl winhighlight wmh winminheight wmw winminwidth winptydll wiw winwidth wse wlseat wst wlsteal wtm wltimeoutlen wrap wm wrapmargin ws wrapscan write wa writeany wb writebackup wd writedelay xtermcodes skipwhite nextgroup=vimSetEqual,vimSetMod76 77" vimOptions: These are the turn-off setting variants {{{278" GEN_SYN_VIM: vimOption turn-off, START_STR='syn keyword vimOption contained', END_STR=''79syn keyword vimOption contained noari noallowrevins noarab noarabic noarshape noarabicshape noacd noautochdir noac noautocomplete noai noautoindent noar noautoread noasd noautoshelldir noaw noautowrite noawa noautowriteall nobk nobackup nobeval noballooneval nobevalterm noballoonevalterm nobin nobinary nobomb nobri nobreakindent nobl nobuflisted nocdh nocdhome nocin nocindent nocp nocompatible nocf noconfirm noci nocopyindent nocsre nocscoperelative nocst nocscopetag nocsverb nocscopeverbose nocrb nocursorbind nocuc nocursorcolumn nocul nocursorline nodeco nodelcombine nodiff nodg nodigraph noed noedcompatible noemo noemoji noeof noendoffile noeol noendofline noea noequalalways noeb noerrorbells noek noesckeys noet noexpandtab noex noexrc nofic nofileignorecase80syn keyword vimOption contained nofixeol nofixendofline nofen nofoldenable nofs nofsync nogd nogdefault noguipty nohid nohidden nohk nohkmap nohkp nohkmapp nohls nohlsearch noicon noic noignorecase noimc noimcmdline noimd noimdisable nois noincsearch noinf noinfercase noim noinsertmode nojs nojoinspaces nolnr nolangnoremap nolrm nolangremap nolz nolazyredraw nolbr nolinebreak nolisp nolist nolpl noloadplugins nomagic noml nomodeline nomle nomodelineexpr nomlst nomodelinestrict noma nomodifiable nomod nomodified nomore nomousef nomousefocus nomh nomousehide nomousemev nomousemoveevent nonu nonumber noodev noopendevice nopaste nopi nopreserveindent nopvw nopreviewwindow noprompt noro noreadonly nornu norelativenumber noremap nors norestorescreen nori norevins norl norightleft81syn keyword vimOption contained noru noruler noscb noscrollbind noscf noscrollfocus nosecure nossl noshellslash nostmp noshelltemp nosr noshiftround nosn noshortname nosc noshowcmd nosft noshowfulltag nosm noshowmatch nosmd noshowmode noscs nosmartcase nosi nosmartindent nosta nosmarttab nosms nosmoothscroll nospell nosb nosplitbelow nospr nosplitright nosol nostartofline noswf noswapfile notbs notagbsearch notr notagrelative notgst notagstack notbidi notermbidi notgc notermguicolors notsy notermsync noterse nota notextauto notx notextmode notop notildeop noto notimeout notitle nottimeout notbi nottybuiltin notf nottyfast noudf noundofile novb novisualbell nowarn nowiv noweirdinvert nowic nowildignorecase nowmnu nowildmenu nowfb nowinfixbuf nowfh nowinfixheight82syn keyword vimOption contained nowfw nowinfixwidth nowst nowlsteal nowrap nows nowrapscan nowrite nowa nowriteany nowb nowritebackup noxtermcodes83 84" vimOptions: These are the invertible variants {{{285" GEN_SYN_VIM: vimOption invertible, START_STR='syn keyword vimOption contained', END_STR=''86syn keyword vimOption contained invari invallowrevins invarab invarabic invarshape invarabicshape invacd invautochdir invac invautocomplete invai invautoindent invar invautoread invasd invautoshelldir invaw invautowrite invawa invautowriteall invbk invbackup invbeval invballooneval invbevalterm invballoonevalterm invbin invbinary invbomb invbri invbreakindent invbl invbuflisted invcdh invcdhome invcin invcindent invcp invcompatible invcf invconfirm invci invcopyindent invcsre invcscoperelative invcst invcscopetag invcsverb invcscopeverbose invcrb invcursorbind invcuc invcursorcolumn invcul invcursorline invdeco invdelcombine invdiff invdg invdigraph inved invedcompatible invemo invemoji inveof invendoffile inveol invendofline invea invequalalways inveb inverrorbells87syn keyword vimOption contained invek invesckeys invet invexpandtab invex invexrc invfic invfileignorecase invfixeol invfixendofline invfen invfoldenable invfs invfsync invgd invgdefault invguipty invhid invhidden invhk invhkmap invhkp invhkmapp invhls invhlsearch invicon invic invignorecase invimc invimcmdline invimd invimdisable invis invincsearch invinf invinfercase invim invinsertmode invjs invjoinspaces invlnr invlangnoremap invlrm invlangremap invlz invlazyredraw invlbr invlinebreak invlisp invlist invlpl invloadplugins invmagic invml invmodeline invmle invmodelineexpr invmlst invmodelinestrict invma invmodifiable invmod invmodified invmore invmousef invmousefocus invmh invmousehide invmousemev invmousemoveevent invnu invnumber invodev invopendevice invpaste88syn keyword vimOption contained invpi invpreserveindent invpvw invpreviewwindow invprompt invro invreadonly invrnu invrelativenumber invremap invrs invrestorescreen invri invrevins invrl invrightleft invru invruler invscb invscrollbind invscf invscrollfocus invsecure invssl invshellslash invstmp invshelltemp invsr invshiftround invsn invshortname invsc invshowcmd invsft invshowfulltag invsm invshowmatch invsmd invshowmode invscs invsmartcase invsi invsmartindent invsta invsmarttab invsms invsmoothscroll invspell invsb invsplitbelow invspr invsplitright invsol invstartofline invswf invswapfile invtbs invtagbsearch invtr invtagrelative invtgst invtagstack invtbidi invtermbidi invtgc invtermguicolors invtsy invtermsync invterse invta invtextauto invtx invtextmode89syn keyword vimOption contained invtop invtildeop invto invtimeout invtitle invttimeout invtbi invttybuiltin invtf invttyfast invudf invundofile invvb invvisualbell invwarn invwiv invweirdinvert invwic invwildignorecase invwmnu invwildmenu invwfb invwinfixbuf invwfh invwinfixheight invwfw invwinfixwidth invwst invwlsteal invwrap invws invwrapscan invwrite invwa invwriteany invwb invwritebackup invxtermcodes90" termcap codes (which can also be set) {{{291" GEN_SYN_VIM: vimOption term output code, START_STR='syn keyword vimOption contained', END_STR='skipwhite nextgroup=vimSetEqual,vimSetMod'92syn keyword vimOption contained t_AB t_AF t_AU t_AL t_al t_bc t_BE t_BD t_cd t_ce t_Ce t_CF t_cl t_cm t_Co t_CS t_Cs t_cs t_CV t_da t_db t_DL t_dl t_ds t_Ds t_EC t_EI t_fs t_fd t_fe t_GP t_IE t_IS t_ke t_ks t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_RF t_RB t_RC t_RI t_Ri t_RK t_RS t_RT t_RV t_Sb t_SC t_se t_Sf t_SH t_SI t_Si t_so t_SR t_sr t_ST t_Te t_te t_TE t_ti t_TI t_Ts t_ts t_u7 t_ue t_us t_Us t_ut t_vb t_ve t_vi t_VS t_vs t_WP t_WS t_XM t_xn t_xs t_ZH t_ZR t_8f t_8b t_8u t_xo t_BS t_ES skipwhite nextgroup=vimSetEqual,vimSetMod93" term key codes94syn keyword vimOption contained t_F1 t_F2 t_F3 t_F4 t_F5 t_F6 t_F7 t_F8 t_F9 t_k1 t_K1 t_k2 t_k3 t_K3 t_k4 t_K4 t_k5 t_K5 t_k6 t_K6 t_k7 t_K7 t_k8 t_K8 t_k9 t_K9 t_KA t_kb t_kB t_KB t_KC t_kd t_kD t_KD t_KE t_KF t_KG t_kh t_KH t_kI t_KI t_KJ t_KK t_kl t_KL t_kN t_kP t_kr t_ku95syn match vimOption contained "t_%1"96syn match vimOption contained "t_#2"97syn match vimOption contained "t_#4"98syn match vimOption contained "t_@7"99syn match vimOption contained "t_*7"100syn match vimOption contained "t_&8"101syn match vimOption contained "t_%i"102syn match vimOption contained "t_k;"103 104" vimOptions: These are the variable names {{{2105" GEN_SYN_VIM: vimOption normal variable, START_STR='syn keyword vimOptionVarName contained', END_STR=''106syn keyword vimOptionVarName contained al aleph ari allowrevins ambw ambiwidth arab arabic arshape arabicshape acd autochdir ac autocomplete acl autocompletedelay act autocompletetimeout ai autoindent ar autoread asd autoshelldir aw autowrite awa autowriteall bg background bs backspace bk backup bkc backupcopy bdir backupdir bex backupext bsk backupskip bdlay balloondelay beval ballooneval bevalterm balloonevalterm bexpr balloonexpr bo belloff bin binary bomb brk breakat bri breakindent briopt breakindentopt bsdir browsedir bh bufhidden bl buflisted bt buftype cmp casemap cdh cdhome cd cdpath cedit ccv charconvert chi chistory cin cindent cink cinkeys cino cinoptions cinsd cinscopedecls cinw cinwords cb clipboard cpm clipmethod ch cmdheight cwh cmdwinheight cc colorcolumn107syn keyword vimOptionVarName contained co columns com comments cms commentstring cp compatible cpt complete cfu completefunc cia completeitemalign cot completeopt cpp completepopup csl completeslash cto completetimeout cocu concealcursor cole conceallevel cf confirm ci copyindent cpo cpoptions cm cryptmethod cspc cscopepathcomp csprg cscopeprg csqf cscopequickfix csre cscoperelative cst cscopetag csto cscopetagorder csverb cscopeverbose crb cursorbind cuc cursorcolumn cul cursorline culopt cursorlineopt debug def define deco delcombine dict dictionary diff dia diffanchors dex diffexpr dip diffopt dg digraph dir directory dy display ead eadirection ed edcompatible emo emoji enc encoding eof endoffile eol endofline ea equalalways ep equalprg eb errorbells ef errorfile108syn keyword vimOptionVarName contained efm errorformat ek esckeys ei eventignore eiw eventignorewin et expandtab ex exrc fenc fileencoding fencs fileencodings ff fileformat ffs fileformats fic fileignorecase ft filetype fcs fillchars ffu findfunc fixeol fixendofline fcl foldclose fdc foldcolumn fen foldenable fde foldexpr fdi foldignore fdl foldlevel fdls foldlevelstart fmr foldmarker fdm foldmethod fml foldminlines fdn foldnestmax fdo foldopen fdt foldtext fex formatexpr flp formatlistpat fo formatoptions fp formatprg fs fsync gd gdefault gfm grepformat gp grepprg gcr guicursor gfn guifont gfs guifontset gfw guifontwide ghr guiheadroom gli guiligatures go guioptions guipty gtl guitablabel gtt guitabtooltip hf helpfile hh helpheight hlg helplang hid hidden hl highlight109syn keyword vimOptionVarName contained hi history hk hkmap hkp hkmapp hls hlsearch icon iconstring ic ignorecase imaf imactivatefunc imak imactivatekey imc imcmdline imd imdisable imi iminsert ims imsearch imsf imstatusfunc imst imstyle inc include inex includeexpr is incsearch inde indentexpr indk indentkeys inf infercase im insertmode isf isfname isi isident isk iskeyword isp isprint js joinspaces jop jumpoptions key kmp keymap km keymodel kpc keyprotocol kp keywordprg lmap langmap lm langmenu lnr langnoremap lrm langremap ls laststatus lz lazyredraw lhi lhistory lbr linebreak lines lsp linespace lisp lop lispoptions lw lispwords list lcs listchars lpl loadplugins luadll magic mef makeef menc makeencoding mp makeprg mps matchpairs mat matchtime mco maxcombine110syn keyword vimOptionVarName contained mfd maxfuncdepth mmd maxmapdepth mm maxmem mmp maxmempattern mmt maxmemtot msc maxsearchcount mis menuitems mopt messagesopt msm mkspellmem ml modeline mle modelineexpr mls modelines mlst modelinestrict ma modifiable mod modified more mouse mousef mousefocus mh mousehide mousem mousemodel mousemev mousemoveevent mouses mouseshape mouset mousetime mzq mzquantum mzschemedll mzschemegcdll nf nrformats nu number nuw numberwidth ofu omnifunc odev opendevice opfunc operatorfunc ost osctimeoutlen pp packpath para paragraphs paste pt pastetoggle pex patchexpr pm patchmode pa path perldll pi preserveindent pvh previewheight pvp previewpopup pvw previewwindow pdev printdevice penc printencoding pexpr printexpr pfn printfont pheader printheader111syn keyword vimOptionVarName contained pmbcs printmbcharset pmbfn printmbfont popt printoptions prompt pb pumborder ph pumheight pmw pummaxwidth pumopt pw pumwidth pythondll pythonhome pythonthreedll pythonthreehome pyx pyxversion qftf quickfixtextfunc qe quoteescape ro readonly rdt redrawtime re regexpengine rnu relativenumber remap rop renderoptions report rs restorescreen ri revins rl rightleft rlc rightleftcmd rubydll ru ruler ruf rulerformat rtp runtimepath scr scroll scb scrollbind scf scrollfocus sj scrolljump so scrolloff sop scrolloffpad sbo scrollopt sect sections secure sel selection slm selectmode ssop sessionoptions sh shell shcf shellcmdflag sp shellpipe shq shellquote srr shellredir ssl shellslash stmp shelltemp st shelltype sxe shellxescape sxq shellxquote112syn keyword vimOptionVarName contained sr shiftround sw shiftwidth shm shortmess sn shortname sbr showbreak sc showcmd sloc showcmdloc sft showfulltag sm showmatch smd showmode stal showtabline stpl showtabpanel ss sidescroll siso sidescrolloff scl signcolumn scs smartcase si smartindent sta smarttab sms smoothscroll sts softtabstop spell spc spellcapcheck spf spellfile spl spelllang spo spelloptions sps spellsuggest sb splitbelow spk splitkeep spr splitright sol startofline stl statusline stlo statuslineopt su suffixes sua suffixesadd swf swapfile sws swapsync swb switchbuf smc synmaxcol syn syntax tcl tabclose tal tabline tpm tabpagemax tpl tabpanel tplo tabpanelopt ts tabstop tbs tagbsearch tc tagcase tfu tagfunc tl taglength tr tagrelative tag tags tgst tagstack113syn keyword vimOptionVarName contained tcldll term tbidi termbidi tenc termencoding tgc termguicolors trz termresize tsy termsync twk termwinkey twsl termwinscroll tws termwinsize twt termwintype terse ta textauto tx textmode tw textwidth tsr thesaurus tsrfu thesaurusfunc top tildeop to timeout tm timeoutlen title titlelen titleold titlestring tb toolbar tbis toolbariconsize ttimeout ttm ttimeoutlen tbi ttybuiltin tf ttyfast ttym ttymouse tsl ttyscroll tty ttytype udir undodir udf undofile ul undolevels ur undoreload uc updatecount ut updatetime vsts varsofttabstop vts vartabstop vbs verbose vfile verbosefile vdir viewdir vop viewoptions vi viminfo vif viminfofile ve virtualedit vb visualbell warn wiv weirdinvert ww whichwrap wc wildchar wcm wildcharm wig wildignore114syn keyword vimOptionVarName contained wic wildignorecase wmnu wildmenu wim wildmode wop wildoptions wak winaltkeys wcr wincolor wi window wfb winfixbuf wfh winfixheight wfw winfixwidth wh winheight whl winhighlight wmh winminheight wmw winminwidth winptydll wiw winwidth wse wlseat wst wlsteal wtm wltimeoutlen wrap wm wrapmargin ws wrapscan write wa writeany wb writebackup wd writedelay xtermcodes115" GEN_SYN_VIM: vimOption term output code variable, START_STR='syn keyword vimOptionVarName contained', END_STR=''116syn keyword vimOptionVarName contained t_AB t_AF t_AU t_AL t_al t_bc t_BE t_BD t_cd t_ce t_Ce t_CF t_cl t_cm t_Co t_CS t_Cs t_cs t_CV t_da t_db t_DL t_dl t_ds t_Ds t_EC t_EI t_fs t_fd t_fe t_GP t_IE t_IS t_ke t_ks t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_RF t_RB t_RC t_RI t_Ri t_RK t_RS t_RT t_RV t_Sb t_SC t_se t_Sf t_SH t_SI t_Si t_so t_SR t_sr t_ST t_Te t_te t_TE t_ti t_TI t_Ts t_ts t_u7 t_ue t_us t_Us t_ut t_vb t_ve t_vi t_VS t_vs t_WP t_WS t_XM t_xn t_xs t_ZH t_ZR t_8f t_8b t_8u t_xo t_BS t_ES117syn keyword vimOptionVarName contained t_F1 t_F2 t_F3 t_F4 t_F5 t_F6 t_F7 t_F8 t_F9 t_k1 t_K1 t_k2 t_k3 t_K3 t_k4 t_K4 t_k5 t_K5 t_k6 t_K6 t_k7 t_K7 t_k8 t_K8 t_k9 t_K9 t_KA t_kb t_kB t_KB t_KC t_kd t_kD t_KD t_KE t_KF t_KG t_kh t_KH t_kI t_KI t_KJ t_KK t_kl t_KL t_kN t_kP t_kr t_ku118syn match vimOptionVarName contained "t_%1"119syn match vimOptionVarName contained "t_#2"120syn match vimOptionVarName contained "t_#4"121syn match vimOptionVarName contained "t_@7"122syn match vimOptionVarName contained "t_*7"123syn match vimOptionVarName contained "t_&8"124syn match vimOptionVarName contained "t_%i"125syn match vimOptionVarName contained "t_k;"126 127" unsupported settings: some were supported by vi but don't do anything in vim {{{2128" GEN_SYN_VIM: Missing vimOption, START_STR='syn keyword vimErrSetting contained', END_STR=''129syn keyword vimErrSetting contained akm altkeymap anti antialias ap autoprint bf beautify biosk bioskey consk conskey fk fkmap fl flash gr graphic ht hardtabs macatsui mesg novice open opt optimize oft osfiletype redraw slow slowopen sourceany w1200 w300 w9600130syn keyword vimErrSetting contained noakm noaltkeymap noanti noantialias noap noautoprint nobf nobeautify nobiosk nobioskey noconsk noconskey nofk nofkmap nofl noflash nogr nographic nomacatsui nomesg nonovice noopen noopt nooptimize noredraw noslow noslowopen nosourceany131syn keyword vimErrSetting contained invakm invaltkeymap invanti invantialias invap invautoprint invbf invbeautify invbiosk invbioskey invconsk invconskey invfk invfkmap invfl invflash invgr invgraphic invmacatsui invmesg invnovice invopen invopt invoptimize invredraw invslow invslowopen invsourceany132 133" AutoCmd Events {{{2134syn case ignore135" GEN_SYN_VIM: vimAutoEvent, START_STR='syn keyword vimAutoEvent contained', END_STR='skipwhite nextgroup=vimAutoEventSep,@vimAutocmdPattern'136syn keyword vimAutoEvent contained BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre CmdlineChanged CmdlineEnter CmdlineLeave CmdlineLeavePre CmdUndefined CmdwinEnter CmdwinLeave ColorScheme ColorSchemePre CompleteChanged CompleteDone CompleteDonePre CursorHold CursorHoldI CursorMoved CursorMovedC CursorMovedI DiffUpdated DirChanged DirChangedPre EncodingChanged ExitPre FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre skipwhite nextgroup=vimAutoEventSep,@vimAutocmdPattern137syn keyword vimAutoEvent contained FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave InsertLeavePre KeyInputPre MenuPopup ModeChanged OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SafeState SafeStateAgain SessionLoadPost SessionLoadPre SessionWritePost ShellCmdPost ShellFilterPost SigUSR1 SourceCmd SourcePost SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabClosed TabClosedPre TabEnter TabLeave TabNew TermChanged TerminalOpen TerminalWinOpen TermResponse TermResponseAll TextChanged TextChangedI TextChangedP TextChangedT TextYankPost VimEnter VimLeave VimLeavePre VimResized VimResume VimSuspend WinClosed WinEnter WinLeave WinNew WinNewPre skipwhite nextgroup=vimAutoEventSep,@vimAutocmdPattern138syn keyword vimAutoEvent contained WinResized WinScrolled skipwhite nextgroup=vimAutoEventSep,@vimAutocmdPattern139 140syn keyword vimAutoEvent contained User skipwhite nextgroup=vimUserAutoEvent141syn match vimUserAutoEvent contained "\<\h\w*\>" skipwhite nextgroup=vimUserAutoEventSep,vimAutocmdMod,vimAutocmdBlock142 143" Highlight commonly used Groupnames {{{2144" GEN_SYN_VIM: vimGroup, START_STR='syn keyword vimGroup contained', END_STR=''145syn keyword vimGroup contained Added Bold BoldItalic Boolean Changed Character Comment Conditional Constant Debug Define Delimiter Error Exception Float Function Identifier Ignore Include Italic Keyword Label Macro Number Operator PreCondit PreProc Removed Repeat Special SpecialChar SpecialComment Statement StorageClass String Structure Tag Todo Type Typedef Underlined146 147" Default highlighting groups {{{2148" GEN_SYN_VIM: vimHLGroup, START_STR='syn keyword vimHLGroup contained', END_STR=''149syn keyword vimHLGroup contained ErrorMsg IncSearch ModeMsg NonText StatusLine StatusLineNC EndOfBuffer VertSplit VertSplitNC VisualNOS DiffText DiffTextAdd PmenuSbar TabLineSel TabLineFill TabPanel TabPanelSel TabPanelFill Cursor lCursor TitleBar TitleBarNC QuickFixLine CursorLineSign CursorLineFold CurSearch PmenuKind PmenuKindSel PmenuMatch PmenuMatchSel PmenuExtra PmenuExtraSel PmenuBorder PopupSelected MessageWindow PopupNotification PreInsert Normal Directory LineNr CursorLineNr MoreMsg Question Search SpellBad SpellCap SpellRare SpellLocal PmenuThumb PmenuShadow Pmenu PmenuSel SpecialKey Title WarningMsg WildMenu Folded FoldColumn SignColumn Visual DiffAdd DiffChange DiffDelete TabLine CursorColumn CursorLine ColorColumn MatchParen StatusLineTerm StatusLineTermNC150syn keyword vimHLGroup contained ToolbarLine ToolbarButton TitleBar TitleBarNC Menu Tooltip Scrollbar CursorIM ComplMatchIns LineNrAbove LineNrBelow MsgArea Terminal User1 User2 User3 User4 User5 User6 User7 User8 User9151syn match vimHLGroup contained "\<Conceal\>"152syn case match153 154" Function Names {{{2155" GEN_SYN_VIM: vimFuncName, START_STR='syn keyword vimFuncName contained', END_STR=''156syn keyword vimFuncName contained abs acos add and append appendbufline argc argidx arglistid argv asin assert_beeps assert_equal assert_equalfile assert_exception assert_fails assert_false assert_inrange assert_match assert_nobeep assert_notequal assert_notmatch assert_report assert_true atan atan2 autocmd_add autocmd_delete autocmd_get balloon_gettext balloon_show balloon_split base64_decode base64_encode bindtextdomain blob2list blob2str browse browsedir bufadd bufexists buflisted bufload bufloaded bufname bufnr bufwinid bufwinnr byte2line byteidx byteidxcomp call ceil ch_canread ch_close ch_close_in ch_evalexpr ch_evalraw ch_getbufnr ch_getjob ch_info ch_listen ch_log ch_logfile ch_open ch_read ch_readblob ch_readraw ch_sendexpr ch_sendraw ch_setoptions ch_status157syn keyword vimFuncName contained changenr char2nr charclass charcol charidx chdir cindent clearmatches cmdcomplete_info col complete complete_add complete_check complete_info confirm copy cos cosh count cscope_connection cursor debugbreak deepcopy delete deletebufline did_filetype diff diff_filler diff_hlID digraph_get digraph_getlist digraph_set digraph_setlist echoraw empty environ err_teapot escape eval eventhandler executable execute exepath exists exists_compiled exp expand expandcmd extend extendnew feedkeys filecopy filereadable filewritable filter finddir findfile flatten flattennew float2nr floor fmod fnameescape fnamemodify foldclosed foldclosedend foldlevel foldtext foldtextresult foreach foreground fullcommand funcref function garbagecollect get getbufinfo158syn keyword vimFuncName contained getbufline getbufoneline getbufvar getcellpixels getcellwidths getchangelist getchar getcharmod getcharpos getcharsearch getcharstr getcmdcomplpat getcmdcompltype getcmdline getcmdpos getcmdprompt getcmdscreenpos getcmdtype getcmdwintype getcompletion getcompletiontype getcurpos getcursorcharpos getcwd getenv getfontname getfperm getfsize getftime getftype getimstatus getjumplist getline getloclist getmarklist getmatches getmousepos getmouseshape getpid getpos getqflist getreg getreginfo getregion getregionpos getregtype getscriptinfo getstacktrace gettabinfo gettabvar gettabwinvar gettagstack gettext getwininfo getwinpos getwinposx getwinposy getwinvar glob glob2regpat globpath has has_key haslocaldir hasmapto histadd histdel159syn keyword vimFuncName contained histget histnr hlID hlexists hlget hlset hostname iconv id indent index indexof input inputdialog inputlist inputrestore inputsave inputsecret insert instanceof interrupt invert isabsolutepath isdirectory isinf islocked isnan items job_getchannel job_info job_setoptions job_start job_status job_stop join js_decode js_encode json_decode json_encode keys keytrans len libcall libcallnr line line2byte lispindent list2blob list2str list2tuple listener_add listener_flush listener_remove localtime log log10 luaeval map maparg mapcheck maplist mapnew mapset match matchadd matchaddpos matcharg matchbufline matchdelete matchend matchfuzzy matchfuzzypos matchlist matchstr matchstrlist matchstrpos max menu_info min mkdir mode mzeval nextnonblank160syn keyword vimFuncName contained ngettext nr2char or pathshorten perleval popup_atcursor popup_beval popup_clear popup_close popup_create popup_dialog popup_filter_menu popup_filter_yesno popup_findecho popup_findinfo popup_findpreview popup_getoptions popup_getpos popup_hide popup_list popup_locate popup_menu popup_move popup_notification popup_setbuf popup_setoptions popup_settext popup_show pow preinserted prevnonblank printf prompt_getprompt prompt_setcallback prompt_setinterrupt prompt_setprompt prop_add prop_add_list prop_clear prop_find prop_list prop_remove prop_type_add prop_type_change prop_type_delete prop_type_get prop_type_list pum_getpos pumvisible py3eval pyeval pyxeval rand range readblob readdir readdirex readfile redraw_listener_add redraw_listener_remove161syn keyword vimFuncName contained reduce reg_executing reg_recording reltime reltimefloat reltimestr remote_expr remote_foreground remote_peek remote_read remote_send remote_startserver remove rename repeat resolve reverse round rubyeval screenattr screenchar screenchars screencol screenpos screenrow screenstring search searchcount searchdecl searchpair searchpairpos searchpos server2client serverlist setbufline setbufvar setcellwidths setcharpos setcharsearch setcmdline setcmdpos setcursorcharpos setenv setfperm setline setloclist setmatches setpos setqflist setreg settabvar settabwinvar settagstack setwinvar sha256 shellescape shiftwidth sign_define sign_getdefined sign_getplaced sign_jump sign_place sign_placelist sign_undefine sign_unplace sign_unplacelist162syn keyword vimFuncName contained simplify sin sinh slice sort sound_clear sound_playevent sound_playfile sound_stop soundfold spellbadword spellsuggest split sqrt srand state str2blob str2float str2list str2nr strcharlen strcharpart strchars strdisplaywidth strftime strgetchar stridx string strlen strpart strptime strridx strtrans strutf16len strwidth submatch substitute swapfilelist swapinfo swapname synID synIDattr synIDtrans synconcealed synstack system systemlist tabpagebuflist tabpagenr tabpagewinnr tagfiles taglist tan tanh tempname term_dumpdiff term_dumpload term_dumpwrite term_getaltscreen term_getansicolors term_getattr term_getcursor term_getjob term_getline term_getscrolled term_getsize term_getstatus term_gettitle term_gettty term_list term_scrape163syn keyword vimFuncName contained term_sendkeys term_setansicolors term_setapi term_setkill term_setrestore term_setsize term_start term_wait terminalprops test_alloc_fail test_autochdir test_feedinput test_garbagecollect_now test_garbagecollect_soon test_getvalue test_gui_event test_ignore_error test_mswin_event test_null_blob test_null_channel test_null_dict test_null_function test_null_job test_null_list test_null_partial test_null_string test_null_tuple test_option_not_set test_override test_refcount test_setmouse test_settime test_srand_seed test_unknown test_void timer_info timer_pause timer_start timer_stop timer_stopall tolower toupper tr trim trunc tuple2list type typename undofile undotree uniq uri_decode uri_encode utf16idx values virtcol virtcol2col164syn keyword vimFuncName contained visualmode wildmenumode wildtrigger win_execute win_findbuf win_getid win_gettype win_gotoid win_id2tabwin win_id2win win_move_separator win_move_statusline win_screenpos win_splitmove winbufnr wincol windowsversion winheight winlayout winline winnr winrestcmd winrestview winsaveview winwidth wordcount writefile xor165 166" Predefined variable names {{{2167" GEN_SYN_VIM: vimVarName, START_STR='syn keyword vimVimVarName contained', END_STR=''168syn keyword vimVimVarName contained count count1 prevcount errmsg warningmsg statusmsg shell_error this_session version lnum termresponse fname lang lc_time ctype charconvert_from charconvert_to fname_in fname_out fname_new fname_diff cmdarg foldstart foldend folddashes foldlevel progname servername dying exception throwpoint register cmdbang insertmode val key profiling fcs_reason fcs_choice beval_bufnr beval_winnr beval_winid beval_lnum beval_col beval_text scrollstart swapname swapchoice swapcommand char mouse_win mouse_winid mouse_lnum mouse_col operator searchforward hlsearch oldfiles windowid progpath completed_item option_new option_old option_oldlocal option_oldglobal option_command option_type errors false true none null numbermax numbermin numbersize169syn keyword vimVimVarName contained vim_did_enter testing t_number t_string t_func t_list t_dict t_float t_bool t_none t_job t_channel t_blob t_class t_object termrfgresp termrbgresp termu7resp termstyleresp termblinkresp event versionlong echospace argv collate exiting colornames sizeofint sizeoflong sizeofpointer maxcol python3_version t_typealias t_enum t_enumvalue stacktrace t_tuple wayland_display clipmethod termda1 termosc vim_did_init clipproviders170 171"--- syntax here and above generated by runtime/syntax/generator/gen_syntax_vim.vim ---172 173" Special Vim Highlighting (not automatic) {{{1174 175" Neovim keyword list additions {{{2176 177if s:has("nvim")178 syn keyword vimOptionVarName contained channel inccommand mousescroll pumblend redrawdebug scrollback shada shadafile statuscolumn termpastefilter termsync winbar winblend winhighlight179 syn keyword vimFuncName contained api_info buffer_exists buffer_name buffer_number chanclose chansend ctxget ctxpop ctxpush ctxset ctxsize dictwatcheradd dictwatcherdel file_readable highlight_exists highlightID jobclose jobpid jobresize jobsend jobstart jobstop jobwait last_buffer_nr menu_get msgpackdump msgpackparse reg_recorded rpcnotify rpcrequest rpcstart rpcstop serverstart serverstop sockconnect stdioopen stdpath termopen test_write_list_log wait180 syn match vimFuncName contained "\<nvim_\w\+\>"181 syn keyword vimVimVarName contained lua msgpack_types relnum stderr termrequest virtnum182endif183 184" Set up commands for this syntax highlighting file {{{2185 186com! -nargs=* Vim9 execute <q-args> s:vim9script ? "" : "contained"187com! -nargs=* VimL execute <q-args> s:vim9script ? "contained" : ""188 189if exists("g:vimsyn_folding") && g:vimsyn_folding =~# '[acefhiHlmpPrt]'190 if g:vimsyn_folding =~# 'a'191 com! -nargs=* VimFolda <args> fold192 else193 com! -nargs=* VimFolda <args>194 endif195 if g:vimsyn_folding =~# 'c'196 com! -nargs=* VimFoldc <args> fold197 else198 com! -nargs=* VimFoldc <args>199 endif200 if g:vimsyn_folding =~# 'e'201 com! -nargs=* VimFolde <args> fold202 else203 com! -nargs=* VimFolde <args>204 endif205 if g:vimsyn_folding =~# 'f'206 com! -nargs=* VimFoldf <args> fold207 else208 com! -nargs=* VimFoldf <args>209 endif210 if g:vimsyn_folding =~# 'h'211 com! -nargs=* VimFoldh <args> fold212 else213 com! -nargs=* VimFoldh <args>214 endif215 if g:vimsyn_folding =~# 'H'216 com! -nargs=* VimFoldH <args> fold217 else218 com! -nargs=* VimFoldH <args>219 endif220 if g:vimsyn_folding =~# 'i'221 com! -nargs=* VimFoldi <args> fold222 else223 com! -nargs=* VimFoldi <args>224 endif225 if g:vimsyn_folding =~# 'l'226 com! -nargs=* VimFoldl <args> fold227 else228 com! -nargs=* VimFoldl <args>229 endif230 if g:vimsyn_folding =~# 'm'231 com! -nargs=* VimFoldm <args> fold232 else233 com! -nargs=* VimFoldm <args>234 endif235 if g:vimsyn_folding =~# 'p'236 com! -nargs=* VimFoldp <args> fold237 else238 com! -nargs=* VimFoldp <args>239 endif240 if g:vimsyn_folding =~# 'P'241 com! -nargs=* VimFoldP <args> fold242 else243 com! -nargs=* VimFoldP <args>244 endif245 if g:vimsyn_folding =~# 'r'246 com! -nargs=* VimFoldr <args> fold247 else248 com! -nargs=* VimFoldr <args>249 endif250 if g:vimsyn_folding =~# 't'251 com! -nargs=* VimFoldt <args> fold252 else253 com! -nargs=* VimFoldt <args>254 endif255else256 com! -nargs=* VimFolda <args>257 com! -nargs=* VimFoldc <args>258 com! -nargs=* VimFolde <args>259 com! -nargs=* VimFoldf <args>260 com! -nargs=* VimFoldi <args>261 com! -nargs=* VimFoldh <args>262 com! -nargs=* VimFoldH <args>263 com! -nargs=* VimFoldl <args>264 com! -nargs=* VimFoldm <args>265 com! -nargs=* VimFoldp <args>266 com! -nargs=* VimFoldP <args>267 com! -nargs=* VimFoldr <args>268 com! -nargs=* VimFoldt <args>269endif270 271" Deprecated variable options {{{2272if exists("g:vim_minlines")273 let g:vimsyn_minlines= g:vim_minlines274endif275if exists("g:vim_maxlines")276 let g:vimsyn_maxlines= g:vim_maxlines277endif278if exists("g:vimsyntax_noerror")279 let g:vimsyn_noerror= g:vimsyntax_noerror280endif281 282" Nulls {{{2283" =====284Vim9 syn keyword vim9Null null null_blob null_channel null_class null_dict null_function null_job null_list null_object null_partial null_string null_tuple285 286" Booleans {{{2287" ========288Vim9 syn keyword vim9Boolean true false289 290" Numbers {{{2291" =======292syn case ignore293syn match vimNumber "\<\d\+\%('\d\+\)*" skipwhite nextgroup=@vimComment,vimSubscript,vimGlobal,vimSubst1294syn match vimNumber "\<\d\+\%('\d\+\)*\.\d\+\%(e[+-]\=\d\+\)\=" skipwhite nextgroup=@vimComment295syn match vimNumber "\<0b[01]\+\%('[01]\+\)*" skipwhite nextgroup=@vimComment,vimSubscript296syn match vimNumber "\<0o\=\o\+\%('\o\+\)*" skipwhite nextgroup=@vimComment,vimSubscript297syn match vimNumber "\<0x\x\+\%('\x\+\)*" skipwhite nextgroup=@vimComment,vimSubscript298syn match vimNumber '\<0z\>' skipwhite nextgroup=@vimComment299syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=@vimComment,vimSubscript300syn case match301 302" All vimCommands are contained by vimIsCommand. {{{2303syn cluster vimCmdList contains=vimAbb,vimAddress,vimAt,vimAutocmd,vimAugroup,vimBehave,vimBreakadd,vimBreakdel,vimBreaklist,vimCall,vimCatch,vimCd,vimCommandModifier,vimConst,vimDoautocmd,vimDebug,vimDebuggreedy,vimDef,vimDefFold,vimDefer,vimDelcommand,vimDelFunction,vimDoCommand,@vimEcho,vimElse,vimEnddef,vimEndfunction,vimEndif,vimEval,vimExecute,vimIsCommand,vimExtCmd,vimExFilter,vimExMark,vimFiletype,vimFor,vimFunction,vimFunctionFold,vimGrep,vimGrepAdd,vimGlobal,vimHelp,vimHelpgrep,vimHighlight,vimHistory,vimImport,vimLanguage,vimLet,vimLoadkeymap,vimLockvar,vimMake,vimMap,vimMark,vimMatch,vimNotFunc,vimNormal,vimProfdel,vimProfile,vimPrompt,vimRedir,vimSet,vimSleep,vimSort,vimSyntax,vimSyntime,vimSynColor,vimSynLink,vimTerminal,vimThrow,vimUniq,vimUnlet,vimUnlockvar,vimUnmap,vimUserCmd,vimVimgrep,vimVimgrepadd,vimWincmd,vimMenu,vimMenutranslate,@vim9CmdList,@vimExUserCmdList,vimLua,vimMzScheme,vimPerl,vimPython,vimPython3,vimPythonX,vimRuby,vimTcl304syn cluster vim9CmdList contains=vim9Abstract,vim9Class,vim9Const,vim9Enum,vim9Export,vim9Final,vim9For,vim9Interface,vim9Type,vim9Var305syn match vimCmdSep "\\\@1<!|" skipwhite nextgroup=@vimCmdList,vimSubst1,@vimFunc306syn match vimCmdSep ":\+" skipwhite nextgroup=@vimCmdList,vimSubst1307syn match vimCount contained "\d\+"308syn match vimIsCommand "\<\h\w*\>" nextgroup=vimBang contains=vimCommand309syn match vimBang contained "!"310syn match vimWhitespace contained "\s\+"311 312syn region vimSubscript contained matchgroup=vimSubscriptBracket start="\[" end="]" nextgroup=vimSubscript contains=@vimExprList313 314syn match vimVar contained "\<\h[a-zA-Z0-9#_]*\>" nextgroup=vimSubscript contains=vim9Super,vim9This315syn match vimVar "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>" nextgroup=vimSubscript contains=vimVarScope316syn match vimVar "\<a:\%(000\|1\=[0-9]\|20\)\>" nextgroup=vimSubscript contains=vimVarScope317syn match vimFBVar contained "\<[bwglsta]:\h[a-zA-Z0-9#_]*\>" nextgroup=vimSubscript contains=vimVarScope318 319" match the scope prefix independently of the retrofitted scope dictionary320syn match vimVarScope contained "\<[bwglstav]:"321syn match vimVimVar contained "\<[bwglstav]:\%(\h\|\d\)\@!" nextgroup=vimSubscript322 323syn match vimVarNameError contained "\<\h\w*\>"324syn match vimVimVar "\<v:" nextgroup=vimSubscript,vimVimVarName,vimVarNameError325syn match vimOptionVar "&\%([lg]:\)\=" nextgroup=vimSubscript,vimOptionVarName,vimVarNameError326syn cluster vimSpecialVar contains=vimEnvvar,vimLetRegister,vimOptionVar,vimVimVar327 328Vim9 syn match vimVar contained "\<\h\w*\ze<" nextgroup=vim9TypeArgs329 330Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s\+[-+/*%]\==\%(\s\|$\)"331Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s\+\.\.=\%(\s\|$\)"332Vim9 syn match vim9LhsVariable "\s\=\%([bwgt]:\)\=\h[a-zA-Z0-9#_]*\ze\s\+=<<\s" skipwhite nextgroup=vimLetHeredoc contains=vimVarScope333Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\[" nextgroup=vimSubscript334Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\." nextgroup=vimOper contains=vim9Super,vim9This335Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s*->" contains=vim9Super,vim9This336 337Vim9 syn match vim9LhsVariableList "\[\_[^]]\+]\ze\s\+[-+/*%]\==" contains=vimVar,@vimSpecialVar338Vim9 syn match vim9LhsVariableList "\[\_[^]]\+]\ze\s\+=<<" skipwhite nextgroup=vimLetHeredoc contains=vimVar,@vimSpecialVar339Vim9 syn match vim9LhsVariableList "\[\_[^]]\+]\ze\s\+\.\.=" contains=vimVar,@vimSpecialVar340 341Vim9 syn match vim9LhsRegister "@["0-9\-a-zA-Z#=*+_/]\ze\s\+\%(\.\.\)\=="342 343syn cluster vimExprList contains=@vimSpecialVar,@vimFunc,vimNumber,vimOper,vimOperParen,vimLambda,vimString,vimVar,@vim9ExprList344syn cluster vim9ExprList contains=vim9Boolean,vim9LambdaParams,vim9Null345 346" Insertions And Appends: insert append {{{2347" (buftype != nofile test avoids having append, change, insert show up in the command window)348" =======================349if &buftype != 'nofile'350 syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=a\%[ppend]$" matchgroup=vimCommand end="^\.$" extend351 syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=c\%[hange]$" matchgroup=vimCommand end="^\.$" extend352 syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=i\%[nsert]$" matchgroup=vimCommand end="^\.$" extend353endif354 355" Behave! {{{2356" =======357if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_nobehaveerror")358 syn match vimBehaveError contained "[^ ]\+"359endif360syn match vimBehave "\<be\%[have]\>" nextgroup=vimBehaveBang,vimBehaveModel,vimBehaveError skipwhite361syn match vimBehaveBang contained "\a\@1<=!" nextgroup=vimBehaveModel skipwhite362syn keyword vimBehaveModel contained mswin xterm363 364" Break* commands {{{2365" ===============366syn keyword vimBreakaddFunc contained func skipwhite nextgroup=vimBreakpointFunctionLine,vimBreakpointFunction367syn keyword vimBreakaddFile contained file skipwhite nextgroup=vimBreakpointFileLine,vimBreakpointFilename368syn keyword vimBreakaddHere contained here skipwhite nextgroup=vimComment,vim9Comment,vimSep369syn keyword vimBreakaddExpr contained expr skipwhite nextgroup=@vimExprList370 371syn match vimBreakpointGlob contained "*" skipwhite nextgroup=vimComment,vim9Comment,vimSep372syn match vimBreakpointNumber contained "\<\d\+\>" skipwhite nextgroup=vimComment,vim9Comment,vimSep373 374syn cluster vimBreakpointArg contains=vimBreakaddFunc,vimBreakaddFile,vimBreakaddHere,vimBreakaddExpr375 376syn match vimBreakpointFunction contained "\<\%(\*\|\w\)\+\>" skipwhite nextgroup=vimComment,vim9Comment,vimSep377syn match vimBreakpointFilename contained "\<\%(\*\|\f\)\+\>" skipwhite nextgroup=vimComment,vim9Comment,vimSep378syn match vimBreakpointFunctionLine contained "\<\d\+\>" skipwhite nextgroup=vimBreakpointFunction379syn match vimBreakpointFileLine contained "\<\d\+\>" skipwhite nextgroup=vimBreakpointFilename380 381syn keyword vimBreakadd breaka[dd] skipwhite nextgroup=@vimBreakpointArg382syn keyword vimBreakdel breakd[el] skipwhite nextgroup=@vimBreakpointArg,vimBreakpointNumber,vimBreakpointGlob383syn keyword vimBreaklist breakl[ist] skipwhite nextgroup=vimComment,vim9Comment,vimSep384 385" Call {{{2386" ====387syn match vimCall "\<call\=\>" skipwhite nextgroup=vimVar,@vimFunc388 389" Cd: {{{2390" ==391" GEN_SYN_VIM: vimCommand cd, START_STR='syn keyword vimCd', END_STR='skipwhite nextgroup=vimCdBang,vimCdArg,vimComment,vim9Comment,vimCmdSep'392syn keyword vimCd cd lc[d] lch[dir] tc[d] tch[dir] skipwhite nextgroup=vimCdBang,vimCdArg,vimComment,vim9Comment,vimCmdSep393syn match vimCd "\<chd\%[ir]\>" skipwhite nextgroup=vimCdBang,vimCdArg,vimComment,vim9Comment,vimCmdSep394syn region vimCdArg contained395 \ start=+["#|]\@!\S+396 \ end="\ze\s*$"397 \ end=+\ze\s*\\\@1<!["#|]+398 \ skipwhite nextgroup=vimComment,vim9Comment,vimCmdSep399 \ contains=vimSpecfile,@vimWildCard400 \ oneline401 402syn match vimCdBang contained "\a\@1<=!" skipwhite nextgroup=vimCdArg,vimComment,vim9Comment,vimCmdSep403 404" Debug {{{2405" =====406syn keyword vimDebug deb[ug] skipwhite nextgroup=@vimCmdList407 408" Debuggreedy {{{2409" ===========410" TODO: special-cased until generalised range/count support is implemented411syn match vimDebuggreedy "\<0\=debugg\%[reedy]\>" contains=vimCount412 413" Defer {{{2414" =====415syn match vimDefer "\<defer\=\>" skipwhite nextgroup=@vimFunc,vim9LambdaParams416 417" *Do commands {{{2418" ============419syn match vimDoCommandBang contained "\a\@1<=!" skipwhite nextgroup=@vimCmdList420 421syn keyword vimDoCommand argdo bufd[o] skipwhite nextgroup=vimDoCommandBang,@vimCmdList422syn keyword vimDoCommand tabd[o] wind[o] skipwhite nextgroup=@vimCmdList423syn keyword vimDoCommand cdo cfd[o] skipwhite nextgroup=vimDoCommandBang,@vimCmdList424syn keyword vimDoCommand ld[o] lfd[o] skipwhite nextgroup=vimDoCommandBang,@vimCmdList425syn keyword vimDoCommand foldd[oopen] folddoc[losed] skipwhite nextgroup=@vimCmdList426 427" Exception Handling {{{2428syn keyword vimThrow th[row] skipwhite nextgroup=@vimExprList429syn keyword vimCatch cat[ch] skipwhite nextgroup=vimCatchPattern430syn region vimCatchPattern contained matchgroup=Delimiter start="\z([!#$%&'()*+,-./:;<=>?@[\]^_`{}~]\)" skip="\\\\\|\\\z1" end="\z1" contains=@vimSubstList oneline431 432" Export {{{2433" ======434if s:vim9script435 syn keyword vim9Export export skipwhite nextgroup=vim9Abstract,vim9ClassBody,vim9Const,vim9Def,vim9EnumBody,vim9Final,vim9InterfaceBody,vim9Type,vim9Var436endif437 438" Filetypes {{{2439" =========440syn match vimFiletype "\<filet\%[ype]\(\s\+\I\i*\)*" skipwhite contains=vimFTCmd,vimFTOption,vimFTError441if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_vimFTError")442 syn match vimFTError contained "\I\i*"443endif444syn keyword vimFTCmd contained filet[ype]445syn keyword vimFTOption contained detect indent off on plugin446 447" History {{{2448" =======449" TODO: handle Vim9 "history" variable assignment (like :wincmd, but a common variable name)450syn keyword vimHistory his[tory] skipwhite nextgroup=vimHistoryName,vimHistoryRange,vimCmdSep,vimComment,vim9Comment451syn keyword vimHistoryName contained c[md] s[earch] e[xpr] i[nput] d[ebug] a[ll] skipwhite nextgroup=vimHistoryRange,vimCmdSep,vimComment,vim9Comment452syn match vimHistoryName contained "[:/?=@>]" skipwhite nextgroup=vimHistoryRange,vimCmdSep,vimComment,vim9Comment453syn match vimHistoryRange contained "-\=\<\d\+\>\%(\s*,\)\=" skipwhite nextgroup=vimCmdSep,vimComment,vim9Comment454syn match vimHistoryRange contained ",\s*-\=\d\+\>" skipwhite nextgroup=vimCmdSep,vimComment,vim9Comment455syn match vimHistoryRange contained "-\=\<\d\+\s*,\s*-\=\d\+\>" skipwhite nextgroup=vimCmdSep,vimComment,vim9Comment456 457" Import {{{2458" ======459syn keyword vimImportAutoload contained autoload skipwhite nextgroup=vimImportFilename460if s:vim9script461 syn region vimImportFilename contained462 \ start="\S"463 \ skip=+\%#=1464 "\ continuation operators at SOL465 \\n\%(\s*#.*\n\)*\s*\%([[:punct:]]\+\&[^#"'(]\)466 \\|467 "\ continuation operators at EOL468 \\%(\%([[:punct:]]\+\&[^#"')]\)\s*\%(#.*\)\=\)\@<=$469 \\|470 \\n\%(\s*#.*\n\)*\s*as\s471 \\|472 \\%(^\s*#.*\)\@<=$473 \\|474 \\n\s*\%(\\\|#\\ \)475 \+476 \ matchgroup=vimCommand477 \ end="\s\+\zsas\ze\s\+\h"478 \ matchgroup=NONE479 \ end="$"480 \ skipwhite nextgroup=vimImportName481 \ contains=@vim9Continue,@vimExprList,vim9Comment482 \ transparent483else484 syn region vimImportFilename contained485 \ start="\S"486 \ skip=+\n\s*\%(\\\|"\\ \)+487 \ matchgroup=vimCommand488 \ end="\s\+\zsas\ze\s\+\h"489 \ matchgroup=NONE490 \ end="$"491 \ skipwhite nextgroup=vimImportName492 \ contains=@vimContinue,@vimExprList493 \ transparent494endif495syn match vimImportName contained "\%(\<as\s\+\)\@<=\h\w*\>" skipwhite nextgroup=@vimComment496syn match vimImport "\<imp\%[ort]\>" skipwhite nextgroup=vimImportAutoload,vimImportFilename497 498" Language {{{2499" ========500syn keyword vimLanguage lan[guage] skipwhite nextgroup=@vimLanguageName,vimLanguageCategory,vimSep,vimComment,vim9Comment501syn keyword vimLanguageCategory contained col[late] cty[pe] mes[sages] tim[e] skipwhite nextgroup=@vimLanguageName502 503" [language[_territory][.codeset][@modifier]] and the reserved "C" and "POSIX"504syn match vimLanguageName contained "[[:alnum:]][[:alnum:]._@-]*[[:alnum:]]" nextgroup=vimSep,vimComment,vim9Comment505syn keyword vimLanguageNameReserved contained C POSIX nextgroup=vimSep,vimComment,vim9Comment506syn cluster vimLanguageName contains=vimLanguageName,vimLanguageNameReserved507 508" Augroup : vimAugroupError removed because long augroups caused sync'ing problems. {{{2509" ======= : Trade-off: Increasing synclines with slower editing vs augroup END error checking.510syn cluster vimAugroupList contains=@vimCmdList,vimFilter,@vimFunc,vimLineComment,vimSpecFile,vimOper,vimNumber,vimOperParen,@vimComment,vimString,vimSubst,vimRegister,vimCmplxRepeat,vimNotation,vimCtrlChar,vimContinue511 512" define513VimFolda syn region vimAugroup514 \ start="\<aug\%[roup]\>\ze\s\+\%([eE][nN][dD]\%($\|[[:space:]|"#]\)\)\@!\S"515 \ matchgroup=vimAugroupKey516 \ end="\<aug\%[roup]\ze\s\+[eE][nN][dD]\s*\%($\|[|"#]\)"517 \ skipwhite nextgroup=vimAugroupEnd518 \ contains=vimAutocmd,@vimAugroupList,vimAugroupkey519if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noaugrouperror")520 syn match vimAugroupError "\<aug\%[roup]\s\+[eE][nN][dD]\ze\s*\%($\|[|"#]\)"521endif522 523" TODO: Vim9 comment524syn match vimAugroupName contained "\%(\\["|[:space:]]\|[^"|[:space:]]\)\+"525 \ skipwhite nextgroup=vimCmdSep,vimComment526syn match vimAugroupEnd contained "\c\<END\>" skipwhite nextgroup=vimCmdSep,vimComment527syn match vimAugroupBang contained "\a\@1<=!" skipwhite nextgroup=vimAugroupName528syn keyword vimAugroupKey contained aug[roup] skipwhite nextgroup=vimAugroupBang,vimAugroupName,vimAugroupEnd529 530" remove531syn match vimAugroup "\<aug\%[roup]!" skipwhite nextgroup=vimAugroupName contains=vimAugroupKey,vimAugroupBang532 533" list534VimL syn match vimAugroup "\<aug\%[roup]\>\ze\s*\%(["|]\|$\)" skipwhite nextgroup=vimCmdSep,vimComment contains=vimAugroupKey535Vim9 syn match vimAugroup "\<aug\%[roup]\>\ze\s*\%([#|]\|$\)" skipwhite nextgroup=vimCmdSep,vim9Comment contains=vimAugroupKey536 537" Operators: {{{2538" =========539syn cluster vimOperGroup contains=@vimContinue,@vimExprList,vim9Comment,vim9LineComment,vimContinueString540syn match vimOper "\a\@<!!" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimSpecFile541syn match vimOper "||\|&&\|[-+*/%.]" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimSpecFile542syn match vimOper "?" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimContinueString543" distinguish ternary : from ex-colon544syn match vimOper "\s\@1<=:\ze\s\|\s\@1<=:$" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimContinueString545syn match vimOper "??" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimContinueString546syn match vimOper "=" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimContinueString,vimSpecFile547syn match vimOper "\%#=1\%(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\)[?#]\=" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimContinueString,vimSpecFile548syn match vimOper "\<is\%(not\)\=\>" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimContinueString,vimSpecFile549syn match vimOper "\<is\%(not\)\=[?#]" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimContinueString,vimSpecFile550syn region vimOperParen matchgroup=vimParenSep start="(" end=")" contains=@vimOperGroup nextgroup=vimSubscript551syn region vimOperParen matchgroup=vimSep start="#\={" end="}" contains=@vimOperGroup nextgroup=vimSubscript,vimVar552syn region vimOperParen contained matchgroup=vimSep start="\[" end="]" contains=@vimOperGroup nextgroup=vimSubscript,vimVar553if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noopererror")554 syn match vimOperError ")"555endif556 557syn match vimOperContinue contained "^\s*\\" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList contains=vimWhitespace558syn match vimOperContinueComment contained '^\s*["#]\\ .*' skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList contains=vimWhitespace559syn cluster vimOperContinue contains=vimOperContinue,vimOperContinueComment560 561" Lambda Expressions: {{{2562" ==================563syn match vimLambdaOperator contained "->" skipwhite nextgroup=@vimExprList564syn region vimLambda contained565 \ matchgroup=vimLambdaBrace566 \ start=+{\ze[[:space:][:alnum:]_.,]*\%(\n\s*\%(\\[[:space:][:alnum:]_.,]*\|"\\ .*\)\)*->+567 \ skip=+\n\s*\%(\\\|"\\ \)+568 \ end="}" end="$"569 \ contains=@vimContinue,@vimExprList,vimLambdaParams570syn match vimLambdaParams contained "\%({\n\=\)\@1<=\_.\{-}\%(->\)\@=" nextgroup=vimLambdaOperator contains=@vimContinue,vimFunctionParam571 572syn match vim9LambdaOperator contained "=>" skipwhite skipempty nextgroup=@vimExprList,vim9LambdaBlock,vim9LambdaOperatorComment573syn match vim9LambdaParen contained "[()]"574syn match vim9LambdaParams contained575 \ "(\%(\<func(\|[^(]\)*\%(\n\s*\\\%(\<func(\|[^(]\)*\|\n\s*#\\ .*\)*\ze\s\+=>"576 \ skipwhite nextgroup=vim9LambdaOperator577 \ contains=@vim9Continue,vimDefParam,vim9LambdaParen,vim9LambdaReturnType578syn region vim9LambdaReturnType contained start=")\@<=:\s" end="\ze\s*#" end="\ze\s*=>" contains=@vim9Continue,@vimType transparent579syn region vim9LambdaBlock contained matchgroup=vimSep start="{" end="^\s*\zs}" contains=@vimDefBodyList580 581syn match vim9LambdaOperatorComment contained "#.*" skipwhite skipempty nextgroup=@vimExprList,vim9LambdaBlock,vim9LambdaOperatorComment582 583" Functions: Tag is provided for those who wish to highlight tagged functions {{{2584" =========585syn cluster vimFunctionBodyCommon contains=@vimCmdList,vimCmplxRepeat,vimContinue,vimCtrlChar,vimDef,vimFBVar,vimFunction,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegister,vimSpecFile,vimString,vimSubst,vimFunctionFold,vimDefFold,vimCmdSep586syn cluster vimFunctionBodyList contains=@vimFunctionBodyCommon,vimComment,vimLineComment,vimInsert,vimConst,vimLet,vimSearch587syn cluster vimDefBodyList contains=@vimFunctionBodyCommon,vim9Comment,vim9LineComment,vim9Block,vim9Const,vim9Final,vim9Var,vim9Null,vim9Boolean,vim9For,vim9LhsVariable,vim9LhsVariableList,vim9LhsRegister,vim9Search,@vimSpecialVar,@vim9Func588 589syn region vimFunctionPattern contained590 \ matchgroup=vimOper591 \ start="/"592 \ end="$"593 \ contains=@vimSubstList594 595syn match vimFunctionBang contained "\a\@1<=!" skipwhite nextgroup=vimFunctionName596syn match vimDefBang contained "\a\@1<=!" skipwhite nextgroup=vimDefName597syn match vimFunctionSID contained "\c<sid>"598syn match vimFunctionScope contained "\<[bwglstav]:"599syn match vimFunctionName contained600 \ "\%(<[sS][iI][dD]>\|[bwglstav]:\)\=\%([[:alnum:]_#.]\+\|{.\{-1,}}\)\+"601 \ skipwhite nextgroup=vimFunctionParams,vimCmdSep,vimComment,vim9Comment602 \ contains=vimFunctionError,vimFunctionScope,vimFunctionSID,Tag603syn match vimDefName contained604 \ "\%(<[sS][iI][dD]>\|[bwglstav]:\)\=\%([[:alnum:]_#.]\+\|{.\{-1,}}\)\+"605 \ nextgroup=vimDefTypeParams,vimDefParams,vimCmdSep,vimComment,vim9Comment606 \ contains=vimFunctionError,vimFunctionScope,vimFunctionSID,Tag607 608syn match vimFunction "\<fu\%[nction]\>" skipwhite nextgroup=vimFunctionBang,vimFunctionName,vimFunctionPattern,vimCmdSep,vimComment609syn match vimDef "\<def\>" skipwhite nextgroup=vimDefBang,vimDefName,vimFunctionPattern,vimCmdSep,vimComment610 611syn region vimFunctionComment contained612 \ start=+".*+613 \ skip=+\n\s*\%(\\\|"\\ \)+614 \ end="$"615 \ skipwhite skipempty nextgroup=vimFunctionBody,vimEndfunction616syn region vimDefComment contained617 \ start="#.*"618 \ skip=+\n\s*\%(\\\|#\\ \)+619 \ end="$"620 \ skipwhite skipempty nextgroup=vimDefBody,vimEnddef621 622syn region vimFunctionParams contained623 \ matchgroup=Delimiter624 \ start="("625 \ skip=+\n\s*\%(\\\|"\\ \)+626 \ end=")"627 \ skipwhite skipempty nextgroup=vimFunctionBody,vimFunctionComment,vimEndfunction,vimFunctionMod,vim9CommentError628 \ contains=vimFunctionParam,vimOperParen,@vimContinue629syn region vimDefParams contained630 \ matchgroup=Delimiter631 \ start="("632 \ end=")"633 \ skipwhite skipempty nextgroup=vimDefBody,vimDefComment,vimEnddef,vimReturnType,vimCommentError634 \ contains=vimDefParam,vim9Comment,vimFunctionParamEquals,vimOperParen635syn region vimDefTypeParams contained636 \ matchgroup=Delimiter637 \ start="<"638 \ end=">"639 \ nextgroup=vimDefParams640 \ contains=vim9DefTypeParam641syn match vimFunctionParam contained "\<\h\w*\>\|\.\.\." skipwhite nextgroup=vimFunctionParamEquals642syn match vimDefParam contained "\<\h\w*\>" skipwhite nextgroup=vimParamType,vimFunctionParamEquals643syn match vim9DefTypeParam contained "\<\u\w*\>"644 645syn match vimFunctionParamEquals contained "=" skipwhite nextgroup=@vimExprList646syn match vimFunctionMod contained "\<\%(abort\|closure\|dict\|range\)\>" skipwhite skipempty nextgroup=vimFunctionBody,vimFunctionComment,vimEndfunction,vimFunctionMod,vim9CommentError647 648syn region vimFunctionBody contained649 \ start="^."650 \ matchgroup=vimCommand651 \ end="\<endfu\%[nction]\>"652 \ skipwhite nextgroup=vimCmdSep,vimComment,vim9CommentError653 \ contains=@vimFunctionBodyList654syn region vimDefBody contained655 \ start="^."656 \ matchgroup=vimCommand657 \ end="\<enddef\>"658 \ skipwhite nextgroup=vimCmdSep,vim9Comment,vimCommentError659 \ contains=@vimDefBodyList660 661syn match vimEndfunction "\<endf\%[unction]\>" skipwhite nextgroup=vimCmdSep,vimComment,vim9CommentError662syn match vimEnddef "\<enddef\>" skipwhite nextgroup=vimCmdSep,vim9Comment,vimCommentError663 664if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f'665 syn region vimFunctionFold666 \ start="\<fu\%[nction]!"667 "\ assume no dict literal in curly-brace name expressions668 \ start="\<fu\%[nction]\>\s*\%([[:alnum:]_:<>.#]\+\|{.\{-1,}}\)\+\s*("669 \ end="^\s*:\=\s*endf\%[unction]\>"670 \ contains=vimFunction671 \ extend fold keepend transparent672 syn region vimDefFold673 \ start="\<def!"674 "\ assume no dict literal in curly-brace name expressions675 \ start="\<def\>\s*\%([[:alnum:]_:<>.#]\+\|{.\{-1,}}\)\+[<(]"676 \ end="^\s*:\=\s*enddef\>"677 \ contains=vimDef678 \ extend fold keepend transparent679endif680 681syn match vimDelfunctionBang contained "\a\@1<=!" skipwhite nextgroup=vimFunctionName682syn match vimDelfunction "\<delf\%[unction]\>" skipwhite nextgroup=vimDelfunctionBang,vimFunctionName683 684" Types: {{{2685" =====686 687syn region vimReturnType contained688 \ start=":\%(\s\|\n\)\@="689 \ skip=+\n\s*\%(\\\|#\\ \)\|^\s*#\\ +690 \ end="$"691 \ matchgroup=vim9Comment692 "\ allow for legacy script tail comment error693 \ end="\ze[#"]"694 \ skipwhite skipempty nextgroup=vimDefBody,vimDefComment,vimEnddef,vimCommentError695 \ contains=@vim9Continue,@vimType696 \ transparent697syn match vimParamType contained ":\s" skipwhite skipnl nextgroup=@vimType contains=vimTypeSep698 699syn match vimTypeSep contained ":\%(\s\|\n\)\@=" skipwhite nextgroup=@vimType700syn keyword vimType contained blob bool channel float job number string void701syn keyword vimTypeAny contained any702syn match vimTypeObject contained "\<object<\@=" nextgroup=vimTypeObjectArgs703syn region vimTypeObjectArgs contained704 \ matchgroup=vimTypeObjectBracket705 \ start="<"706 \ end=">"707 \ contains=vimTypeAny,vimTypeObject,vimUserType708 \ oneline709 \ transparent710syn match vimType contained "\<\%(func\)\>"711syn region vimCompoundType contained matchgroup=vimType start="\<func(" end=")" nextgroup=vimTypeSep contains=@vim9Continue,@vimType transparent712syn region vimCompoundType contained matchgroup=vimType start="\<tuple<" end=">" contains=@vim9Continue,@vimType transparent713syn region vimCompoundType contained matchgroup=vimType start="\<\%(list\|dict\)<" end=">" contains=@vimType oneline transparent714syn match vimUserType contained "\<\%(\h\w*\.\)*\u\w*\>"715 716syn cluster vimType contains=vimType,vimTypeAny,vimTypeObject,vimCompoundType,vimUserType717 718" Classes, Enums And Interfaces: {{{2719" =============================720 721if s:vim9script722 723 " Methods {{{3724 syn match vim9MethodDef contained "\<def\>" skipwhite nextgroup=vim9MethodDefName,vim9ConstructorDefName725 syn match vim9MethodDefName contained "\<\h\w*\>" nextgroup=vim9MethodDefParams,vim9MethodDefTypeParams contains=@vim9MethodName726 syn region vim9MethodDefParams contained727 \ matchgroup=Delimiter start="(" end=")"728 \ skipwhite skipnl nextgroup=vim9MethodDefBody,vim9MethodDefComment,vimEnddef,vim9MethodDefReturnType,vimCommentError729 \ contains=vimDefParam,vim9Comment,vimFunctionParamEquals730 syn region vim9MethodDefTypeParams contained731 \ matchgroup=Delimiter732 \ start="<"733 \ end=">"734 \ nextgroup=vim9MethodDefParams735 \ contains=vim9DefTypeParam736 737 syn match vim9ConstructorDefName contained "\<_\=new\w*\>"738 \ nextgroup=vim9ConstructorDefParams,vim9ConstuctorDefTypeParams739 \ contains=@vim9MethodName740 syn match vim9ConstructorDefParam contained "\<\%(this\.\)\=\h\w*\>"741 \ skipwhite nextgroup=vimParamType,vimFunctionParamEquals742 \ contains=vim9This,vimOper743 syn region vim9ConstructorDefParams contained744 \ matchgroup=Delimiter start="(" end=")"745 \ skipwhite skipnl nextgroup=vim9MethodDefBody,vim9MethodDefComment,vimEnddef,vimCommentError746 \ contains=vim9ConstructorDefParam,vim9Comment,vimFunctionParamEquals747 syn region vim9ConstuctorDefTypeParams contained748 \ matchgroup=Delimiter749 \ start="<"750 \ end=">"751 \ nextgroup=vim9ConstructorDefParams752 \ contains=vim9DefTypeParam753 754 syn region vim9MethodDefReturnType contained755 \ start=":\%(\s\|\n\)\@="756 \ skip=+\n\s*\%(\\\|#\\ \)\|^\s*#\\ +757 \ end="$"758 \ matchgroup=vim9Comment759 \ end="\ze#"760 \ skipwhite skipnl nextgroup=vim9MethodDefBody,vim9MethodDefComment,vimEnddef,vimCommentError761 \ contains=@vim9Continue,vimType,vimTypeSep762 \ transparent763 764 syn region vim9MethodDefComment contained765 \ start="#.*"766 \ skip=+\n\s*\%(\\\|#\\ \)+767 \ end="$"768 \ skipwhite skipempty nextgroup=vim9MethodDefBody,vimEnddef769 770 syn region vim9MethodDefBody contained771 \ start="^.\=" matchgroup=vimCommand end="\<enddef\>"772 \ skipwhite nextgroup=vimCmdSep,vim9Comment,vimCommentError773 \ contains=@vim9MethodDefBodyList774 775 syn cluster vim9MethodDefBodyList contains=@vimDefBodyList,vim9This,vim9Super776 777 if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimfunctionerror")778 syn match vim9MethodNameError contained "\<[a-z0-9]\i\>"779 endif780 syn match vim9MethodName contained "\<_\=new\w*\>"781 syn keyword vim9MethodName contained empty len string782 783 syn cluster vim9MethodName contains=vim9MethodName,vim9MethodNameError784 785 if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f'786 syn region vim9MethodDefFold contained787 \ start="\%(^\s*\%(:\=static\s\+\)\=\)\@16<=:\=def\s\+\h\w*[<(]"788 \ end="^\s*:\=enddef\>"789 \ contains=vim9MethodDef790 \ fold keepend extend transparent791 endif792 793 syn cluster vim9MethodDef contains=vim9MethodDef,vim9MethodDefFold794 795 " Classes {{{3796 syn cluster vim9ClassBodyList contains=vim9Abstract,vim9Class,vim9Comment,vim9LineComment,@vim9Continue,@vimExprList,vim9Extends,vim9Implements,@vim9MethodDef,vim9Public,vim9Static,vim9Const,vim9Final,vim9This,vim9Super,vim9Var797 798 syn match vim9Class contained "\<class\>" skipwhite nextgroup=vim9ClassName799 syn match vim9ClassName contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9Extends,vim9Implements800 syn match vim9SuperClass contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9Implements801 syn match vim9ImplementedInterface contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9InterfaceListComma,vim9Extends802 syn match vim9InterfaceListComma contained "," skipwhite skipnl nextgroup=vim9ImplementedInterface803 syn keyword vim9Abstract abstract skipwhite skipnl nextgroup=vim9ClassBody,vim9AbstractDef804 syn keyword vim9Extends contained extends skipwhite skipnl nextgroup=vim9SuperClass805 syn keyword vim9Implements contained implements skipwhite skipnl nextgroup=vim9ImplementedInterface806 syn keyword vim9Public contained public807 syn keyword vim9Static contained static808 " FIXME: don't match as dictionary keys, remove when operators are not809 " shared between Vim9 and legacy script810 syn match vim9This contained "\.\@1<!\<this\>:\@!"811 " super must be followed by '.'812 syn match vim9Super contained "\.\@1<!\<super\.\@="813 814 VimFoldc syn region vim9ClassBody start="\<class\>" matchgroup=vimCommand end="\<endclass\>" contains=@vim9ClassBodyList transparent815 816 " Enums {{{3817 syn cluster vim9EnumBodyList contains=vim9Comment,vim9LineComment,@vim9Continue,vim9Enum,@vimExprList,@vim9MethodDef,vim9Public,vim9Static,vim9Const,vim9Final,vim9This,vim9Var818 819 syn match vim9Enum contained "\<enum\>" skipwhite nextgroup=vim9EnumName820 821 syn match vim9EnumName contained "\<\u\w*\>" skipwhite skipempty nextgroup=vim9EnumNameTrailing,vim9EnumNameEmpty,vim9EnumNameComment,@vim9EnumNameContinue,vim9EnumImplements822 syn match vim9EnumNameTrailing contained "\S.*"823 syn region vim9EnumNameComment contained824 \ start="#" skip="\n\s*\%(\\\|#\\ \)" end="$"825 \ skipwhite skipempty nextgroup=vim9EnumNameComment,vim9EnumValue826 \ contains=@vimCommentGroup,vimCommentString827 " vim9EnumName's "skipempty" should only apply to comments and enum values and not implements clauses828 syn match vim9EnumNameEmpty contained "^" skipwhite skipempty nextgroup=vim9EnumNameComment,vim9EnumValue829 " allow line continuation between enum name and "implements"830 syn match vim9EnumNameContinue contained831 \ "^\s*\\"832 \ skipwhite skipnl nextgroup=vim9EnumNameTrailing,vim9EnumNameEmpty,vim9EnumNameComment,@vim9EnumNameContinue,vim9EnumImplements833 \ contains=vimWhitespace834 syn match vim9EnumNameContinueComment contained835 \ "^\s*#\\ .*"836 \ skipwhite skipnl nextgroup=vim9EnumNameEmpty,vim9EnumNameComment,@vim9EnumNameContinue837 \ contains=vimWhitespace838 syn cluster vim9EnumNameContinue contains=vim9EnumNameContinue,vim9EnumNameContinueComment839 840 " enforce enum value list location841 syn match vim9EnumValue contained "\<\a\w*\>" nextgroup=vim9EnumValueTypeArgs,vim9EnumValueArgList,vim9EnumValueListComma,vim9Comment842 syn match vim9EnumValueListComma contained "," skipwhite skipempty nextgroup=vim9EnumValue,vim9EnumValueListCommaComment843 syn region vim9EnumValueListCommaComment contained844 \ start="#" skip="\n\s*\%(\\\|#\\ \)" end="$"845 \ skipwhite skipempty nextgroup=vim9EnumValueListCommaComment,vim9EnumValue846 \ contains=@vimCommentGroup,vimCommentString847 syn region vim9EnumValueTypeArgs contained848 \ matchgroup=Delimiter849 \ start="<\ze\a"850 \ end=">"851 \ nextgroup=vim9EnumValueArgList852 \ contains=@vimType853 \ oneline854 syn region vim9EnumValueArgList contained855 \ matchgroup=vimParenSep start="(" end=")"856 \ nextgroup=vim9EnumValueListComma857 \ contains=@vimExprList,vimContinueString,vim9Comment858 859 syn keyword vim9EnumImplements contained implements skipwhite nextgroup=vim9EnumImplementedInterface860 syn match vim9EnumImplementedInterface contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9EnumInterfaceListComma,vim9EnumImplementedInterfaceComment,vim9EnumValue861 syn match vim9EnumInterfaceListComma contained "," skipwhite nextgroup=vim9EnumImplementedInterface862 syn region vim9EnumImplementedInterfaceComment contained863 \ start="#" skip="\n\s*\%(\\\|#\\ \)" end="$"864 \ skipwhite skipempty nextgroup=vim9EnumImplementedInterfaceComment,vim9EnumValue865 \ contains=@vimCommentGroup,vimCommentString866 867 VimFolde syn region vim9EnumBody start="\<enum\>" matchgroup=vimCommand end="\<endenum\>" contains=@vim9EnumBodyList transparent868 869 " Interfaces {{{3870 " TODO: limit to decl only - no init values871 syn cluster vim9InterfaceBodyList contains=vim9Comment,vim9LineComment,@vim9Continue,vim9Extends,vim9Interface,vim9AbstractDef,vim9Var872 873 syn match vim9Interface contained "\<interface\>" skipwhite nextgroup=vim9InterfaceName874 syn match vim9InterfaceName contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9Extends875 876 syn keyword vim9AbstractDef contained def skipwhite nextgroup=vim9AbstractDefName877 syn match vim9AbstractDefName contained "\<\h\w*\>" skipwhite nextgroup=vim9AbstractDefParams,vim9AbstractDefTypeParams contains=@vim9MethodName878 syn region vim9AbstractDefParams contained879 \ matchgroup=Delimiter start="(" end=")"880 \ skipwhite skipnl nextgroup=vimDefComment,vim9AbstractDefReturnType,vimCommentError881 \ contains=vimDefParam,vim9Comment,vimFunctionParamEquals882 syn region vim9AbstractDefReturnType contained883 \ start=":\s" end="$" matchgroup=vim9Comment end="\ze[#"]"884 \ skipwhite skipnl nextgroup=vimDefComment,vimCommentError885 \ contains=vimTypeSep886 \ transparent887 syn region vim9AbstractDefTypeParams contained888 \ matchgroup=Delimiter889 \ start="<"890 \ end=">"891 \ nextgroup=vim9AbstractDefParams892 \ contains=vim9DefTypeParam893 894 VimFoldi syn region vim9InterfaceBody start="\<interface\>" matchgroup=vimCommand end="\<endinterface\>" contains=@vim9InterfaceBodyList transparent895 896 " Type Aliases {{{3897 syn match vim9Type "\<ty\%[pe]\>" skipwhite nextgroup=vim9TypeAlias,vim9TypeAliasError898 syn match vim9TypeAlias contained "\<\u\w*\>" skipwhite nextgroup=vim9TypeEquals899 syn match vim9TypeEquals contained "=" skipwhite nextgroup=@vimType900 if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_notypealiaserror")901 syn match vim9TypeAliasError contained "\<\l\w*\>" skipwhite nextgroup=vim9TypeEquals902 endif903endif904 905" Blocks: {{{2906" ======907Vim9 syn region vim9Block908 \ matchgroup=vimSep909 \ start="{\ze\s*\%($\|[#|]\)"910 \ end="^\s*\zs}"911 \ skipwhite nextgroup=vim9Comment,vimCmdSep912 \ contains=@vimDefBodyList913 914" Keymaps: {{{2915" =======916 917syn match vimKeymapStart "^" contained skipwhite nextgroup=vimKeymapLhs,@vimKeymapLineComment918syn match vimKeymapLhs "\S\+" contained skipwhite nextgroup=vimKeymapRhs contains=vimNotation919syn match vimKeymapRhs "\S\+" contained skipwhite nextgroup=vimKeymapTailComment contains=vimNotation920syn match vimKeymapTailComment "\S.*" contained921 922" TODO: remove when :" comment is matched in parts as "ex-colon comment" --djk923if s:vim9script924 syn match vim9KeymapLineComment "#.*" contained contains=@vimCommentGroup,vimCommentString,vim9CommentTitle925else926 syn match vimKeymapLineComment +".*+ contained contains=@vimCommentGroup,vimCommentString,vimCommentTitle927endif928syn cluster vimKeymapLineComment contains=vim9\=KeymapLineComment929 930syn region vimLoadkeymap matchgroup=vimCommand start="\<loadk\%[eymap]\>" end="\%$" contains=vimKeymapStart931 932" Special Filenames, Modifiers, Extension Removal: {{{2933" ===============================================934syn match vimSpecFile "<c\(word\|WORD\)>" nextgroup=vimSpecFileMod,vimSubst1935syn match vimSpecFile "<\([acs]file\|amatch\|abuf\)>" nextgroup=vimSpecFileMod,vimSubst1936syn match vimSpecFile "\s%[ \t:]"ms=s+1,me=e-1 nextgroup=vimSpecFileMod,vimSubst1937syn match vimSpecFile "\s%$"ms=s+1 nextgroup=vimSpecFileMod,vimSubst1938syn match vimSpecFile "\s%<"ms=s+1,me=e-1 nextgroup=vimSpecFileMod,vimSubst1939syn match vimSpecFile "#\d\+\|[#%]<\>" nextgroup=vimSpecFileMod,vimSubst1940syn match vimSpecFileMod "\(:[phtre]\)\+" contained941 942syn match vimSpecFile contained "%[ \t:]"me=e-1 nextgroup=vimSpecFileMod943syn match vimSpecFile contained excludenl "%$" nextgroup=vimSpecFileMod944syn match vimSpecFile contained "%<"me=e-1 nextgroup=vimSpecFileMod945 946" User-Specified Commands: {{{2947" =======================948syn cluster vimUserCmdList contains=@vimCmdList,vimCmplxRepeat,@vimComment,vimCtrlChar,vimEscapeBrace,@vimFunc,vimNotation,vimNumber,vimOper,vimRegister,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange949 950syn match vimUserCmd "\<com\%[mand]\>!\=" skipwhite nextgroup=vimUserCmdAttrs,vimUserCmdName contains=vimBang951syn match vimUserCmd +\<com\%[mand]\>!\=\ze\s*\n\s*\%(\\\|["#]\\ \)+ skipwhite skipnl nextgroup=vimUserCmdAttrs,vimUserCmdName contains=vimBang952 953syn region vimUserCmdAttrs contained954 \ start="-\l"955 \ start=+^\s*\%(\\\|["#]\\ \)+956 \ end="\ze\s\u"957 \ skipwhite nextgroup=vimUserCmdName958 \ contains=@vimContinue,vimUserCmdAttr,vimUserCmdAttrError959 \ transparent960syn match vimUserCmdAttrError contained "-\a\+\ze\%(\s\|=\)"961syn match vimUserCmdAttr contained "-addr=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrAddr962syn match vimUserCmdAttr contained "-bang\>" contains=vimUserCmdAttrKey963syn match vimUserCmdAttr contained "-bar\>" contains=vimUserCmdAttrKey964syn match vimUserCmdAttr contained "-buffer\>" contains=vimUserCmdAttrKey965syn match vimUserCmdAttr contained "-complete=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrComplete,vimUserCmdError966syn match vimUserCmdAttr contained "-count\>" contains=vimUserCmdAttrKey967syn match vimUserCmdAttr contained "-count=" contains=vimUserCmdAttrKey nextgroup=vimNumber968syn match vimUserCmdAttr contained "-keepscript\>" contains=vimUserCmdAttrKey969syn match vimUserCmdAttr contained "-nargs=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrNargs970syn match vimUserCmdAttr contained "-range\>" contains=vimUserCmdAttrKey971syn match vimUserCmdAttr contained "-range=" contains=vimUserCmdAttrKey nextgroup=vimNumber,vimUserCmdAttrRange972syn match vimUserCmdAttr contained "-register\>" contains=vimUserCmdAttrKey973 974syn match vimUserCmdAttrNargs contained "[01*?+]"975syn match vimUserCmdAttrRange contained "%"976 977if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_nousercmderror")978 syn match vimUserCmdError contained "\S\+\>"979endif980 981syn case ignore982syn keyword vimUserCmdAttrKey contained a[ddr] ban[g] bar bu[ffer] com[plete] cou[nt] k[eepscript] n[args] ra[nge] re[gister]983 984" GEN_SYN_VIM: vimUserCmdAttrComplete, START_STR='syn keyword vimUserCmdAttrComplete contained', END_STR=''985syn keyword vimUserCmdAttrComplete contained arglist augroup behave breakpoint buffer color command compiler cscope diff_buffer dir dir_in_path environment event expression file file_in_path filetype filetypecmd function help highlight history keymap locale mapclear mapping menu messages option packadd retab runtime scriptnames shellcmd shellcmdline sign syntax syntime tag tag_listfiles user var986syn keyword vimUserCmdAttrComplete contained arglist augroup behave breakpoint buffer color command compiler cscope diff_buffer dir dir_in_path environment event expression file file_in_path filetype function help highlight history keymap locale mapclear mapping menu messages option packadd runtime scriptnames shellcmd shellcmdline sign syntax syntime tag tag_listfiles user var987syn keyword vimUserCmdAttrComplete contained custom customlist nextgroup=vimUserCmdAttrCompleteFunc,vimUserCmdError988syn match vimUserCmdAttrCompleteFunc contained ",\%([bwglstav]:\|<[sS][iI][dD]>\)\=\h\w*\%([.#]\h\w*\)*"hs=s+1 nextgroup=vimUserCmdError contains=vimVarScope,vimFunctionSID989 990" GEN_SYN_VIM: vimUserCmdAttrAddr, START_STR='syn keyword vimUserCmdAttrAddr contained', END_STR=''991syn keyword vimUserCmdAttrAddr contained arguments arg buffers buf lines line loaded_buffers load other quickfix qf tabs tab windows win992syn keyword vimUserCmdAttrAddr contained arguments arg buffers buf lines line loaded_buffers load other quickfix qf tabs tab windows win993syn match vimUserCmdAttrAddr contained "?"994syn case match995 996syn match vimUserCmdName contained "\<\u[[:alnum:]]*\>" skipwhite nextgroup=vimUserCmdBlock,vimUserCmdReplacement997syn match vimUserCmdName contained +\<\u[[:alnum:]]*\>\ze\s*\n\s*\%(\\\|["#]\\ \)+ skipwhite skipnl nextgroup=vimUserCmdBlock,vimUserCmdReplacement998syn region vimUserCmdReplacement contained999 \ start="\S"1000 \ start=+^\s*\%(\\\|["#]\\ \)+1001 \ skip=+\n\s*\%(\\\|["#]\\ \)+1002 \ end="$"1003 \ contains=@vimContinue,@vimUserCmdList,vimComFilter1004 \ keepend1005syn region vimUserCmdBlock contained1006 \ matchgroup=vimSep1007 \ start="{"1008 \ end="^\s*\zs}"1009 \ contains=@vimDefBodyList,@vimUserCmdList1010 1011syn match vimDelcommand "\<delc\%[ommand]\>" skipwhite nextgroup=vimDelcommandAttr,vimDelcommandName1012syn match vimDelcommandAttr contained "-buffer\>" skipwhite nextgroup=vimDelcommandName1013syn match vimDelcommandName contained "\<\u[[:alnum:]]*\>"1014 1015" Lower Priority Comments: after some vim commands... {{{21016" =======================1017if get(g:, "vimsyn_comment_strings", 1)1018 syn region vimCommentString contained oneline start='\S\s\+"'ms=e end='"' extend1019endif1020 1021if s:vim9script1022 syn cluster vimComment contains=vim9Comment1023else1024 syn cluster vimComment contains=vimComment1025endif1026 1027VimL syn region vimComment1028 \ excludenl1029 \ start=+"+1030 \ skip=+\n\s*\%(\\\|"\\ \)+1031 \ end="$"1032 \ contains=@vimCommentGroup,vimCommentString1033 \ extend1034Vim9 syn region vim9Comment1035 \ excludenl1036 \ start="\%#=1\s\@1<=#\%({\@!\|{{\)"1037 \ skip="\n\s*\%(\\\|#\\ \)"1038 \ end="$"1039 \ contains=@vimCommentGroup,vimCommentString1040 \ extend1041 1042syn match vim9CommentError contained "#.*"1043syn match vimCommentError contained +".*+1044 1045" Environment Variables: {{{21046" =====================1047syn match vimEnvvar "\$\I\i*"1048syn match vimEnvvar "\${\I\i*}"1049 1050" Strings {{{21051" =======1052 1053" In-String Specials:1054" Try to catch strings, if nothing else matches (therefore it must precede the others!)1055" vimEscapeBrace handles ["] []"] (ie. "s don't terminate string inside [])1056" syn region vimEscapeBrace oneline contained transparent start="[^\\]\(\\\\\)*\[\zs\^\=\]\=" skip="\\\\\|\\\]" end="]"me=e-11057syn match vimPatSepErr contained "\\)"1058syn match vimPatSep contained "\\|"1059syn region vimPatSepZone oneline contained matchgroup=vimPatSepZ start="\\%\=\ze(" skip="\\\\" end="\\)\|[^\\]['"]" contains=@vimStringGroup1060syn region vimPatRegion contained transparent matchgroup=vimPatSepR start="\\[z%]\=(" end="\\)" contains=@vimSubstList oneline1061syn match vimNotPatSep contained "\\\\"1062syn cluster vimStringGroup contains=vimEscape,vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone,@Spell1063syn region vimString oneline keepend matchgroup=vimString start=+[^a-zA-Z\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ nextgroup=vimSubscript contains=@vimStringGroup extend1064syn region vimString oneline matchgroup=vimString start=+[^a-zA-Z\\@]'+lc=1 end=+'+ nextgroup=vimSubscript contains=vimQuoteEscape extend1065"syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup " see tst45.vim1066 1067syn match vimEscape contained "\\."1068" syn match vimEscape contained +\\[befnrt\"]+1069syn match vimEscape contained "\\\o\{1,3}\|\\[xX]\x\{1,2}\|\\u\x\{1,4}\|\\U\x\{1,8}"1070syn match vimEscape contained "\\<" contains=vimNotation1071syn match vimEscape contained "\\<\*[^>]*>\=>"1072syn match vimQuoteEscape contained "''"1073 1074syn region vimString oneline matchgroup=vimString start=+$'+ end=+'+ nextgroup=vimSubscript contains=@vimStringInterpolation,vimQuoteEscape extend1075syn region vimString oneline matchgroup=vimString start=+$"+ end=+"+ nextgroup=vimSubscript contains=@vimStringInterpolation,@vimStringGroup extend1076syn region vimStringInterpolationExpr oneline contained matchgroup=vimSep start=+{+ end=+}+ contains=@vimExprList1077syn match vimStringInterpolationBrace contained "{{"1078syn match vimStringInterpolationBrace contained "}}"1079syn cluster vimStringInterpolation contains=vimStringInterpolationExpr,vimStringInterpolationBrace1080 1081syn region vimContinueString contained matchgroup=vimContinueString start=+"+ skip=+\n\s*\%(\\\|["#]\\ \)+ end=+"+ end="$" skipwhite nextgroup=vimSubscript,vimComment contains=@vimContinue,@vimStringGroup1082syn region vimContinueString contained matchgroup=vimContinueString start=+'+ skip=+\n\s*\%(\\\|["#]\\ \)+ end=+'+ end="$" skipwhite nextgroup=vimSubscript,vimComment contains=@vimContinue,vimQuoteEscape1083syn region vimContinueString contained matchgroup=vimContinueString start=+$"+ skip=+\n\s*\%(\\\|["#]\\ \)+ end=+"+ end="$" skipwhite nextgroup=vimSubscript,vimComment contains=@vimContinue,@vimStringInterpolation,@vimStringGroup1084syn region vimContinueString contained matchgroup=vimContinueString start=+$'+ skip=+\n\s*\%(\\\|["#]\\ \)+ end=+'+ end="$" skipwhite nextgroup=vimSubscript,vimComment contains=@vimContinue,@vimStringInterpolation,vimQuoteEscape1085 1086" Substitutions: {{{21087" =============1088syn cluster vimSubstList contains=vimPatSep,vimPatRegion,vimPatSepErr,vimSubstTwoBS,vimSubstRange,vimNotation1089syn cluster vimSubstRepList contains=vimSubstSubstr,vimSubstTwoBS,vimNotation1090syn cluster vimSubstList add=vimCollection1091syn match vimSubst "^\s*\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)\>" skipwhite nextgroup=vimSubstPat,vimSubstFlags,vimSubstCount1092syn match vimSubst "^\s*\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)[_#]\@=" skipwhite nextgroup=vimSubstPat1093syn match vimSubst "^\s*\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)\%(\d\+\)\@=" skipwhite nextgroup=vimSubstCount1094syn match vimSubst1 contained "\%(s\%[ubstitute]\|sm\%[agic]\>\|sno\%[magic]\)\>" skipwhite nextgroup=vimSubstPat,vimSubstFlags,vimSubstCount1095syn match vimSubst1 contained "\%(s\%[ubstitute]\|sm\%[agic]\>\|sno\%[magic]\)[_#]\@=" skipwhite nextgroup=vimSubstPat1096syn match vimSubst1 contained "\%(s\%[ubstitute]\|sm\%[agic]\>\|sno\%[magic]\)\%(\d\+\)\@=" skipwhite nextgroup=vimSubstCount1097syn match vimSubstFlagErr contained "[^< \t\r|]\+" contains=vimSubstFlags1098" & and # after :s are always pattern delimiters not flags1099syn match vimSubstFlags contained "[&cegiIlnpr#]\+" skipwhite nextgroup=vimSubstCount1100syn match vimSubstCount contained "\d\+\>"1101" TODO: Vim9 illegal separators for abbreviated :s form are [-.:], :su\%[...] required1102" : # is allowed but "not recommended" (see :h pattern-delimiter)1103syn region vimSubstPat contained matchgroup=vimSubstDelim start="\z([!#$%&'()*+,-./:;<=>?@[\]^_`{}~]\)"rs=s+1 skip="\\\\\|\\\z1" end="\z1"re=e-1,me=e-1 contains=@vimSubstList nextgroup=vimSubstRep4 oneline1104syn region vimSubstRep4 contained matchgroup=vimSubstDelim start="\z(.\)" skip="\\\\\|\\\z1" end="\z1" matchgroup=vimNotation end="<[cC][rR]>" contains=@vimSubstRepList nextgroup=vimSubstFlagErr oneline1105syn region vimCollection contained transparent start="\\\@<!\[" skip="\\\[" end="\]" contains=vimCollClass1106syn match vimCollClassErr contained "\[:.\{-\}:\]"1107syn match vimCollClass contained transparent "\%#=1\[:\(alnum\|alpha\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|xdigit\|retu\%[rn]\|tab\|escape\|backspace\):\]"1108syn match vimSubstSubstr contained "\\z\=\d"1109syn match vimSubstTwoBS contained "\\\\"1110 1111" TODO: flags, unlike count, must follow immediately1112" : distinguish from with Vim9 &var1113" syn match vimSubst "^\s*\zs&&\=" skipwhite nextgroup=vimSubstFlags,vimSubstCount1114" syn match vimSubst "^\s*\zs\~&\=" skipwhite nextgroup=vimSubstFlags,vimSubstCount1115" syn match vimSubst1 contained "&&\=" skipwhite nextgroup=vimSubstFlags,vimSubstCount1116" syn match vimSubst1 contained "\~&\=" skipwhite nextgroup=vimSubstFlags,vimSubstCount1117 1118" two and three letter variants (matched as :s + flags, count may follow immediately)1119syn match vimSubst "^\s*\zssc[egiIlnp]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags1120syn match vimSubst "^\s*\zssg[ceiIlnpr]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags1121syn match vimSubst "^\s*\zssi[ceInpr]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags1122syn match vimSubst "^\s*\zssI[ceginplr]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags1123syn match vimSubst "^\s*\zssr[cgiInplr]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags1124 1125syn match vimSubst1 contained "\<sc[egiIlnp]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags1126syn match vimSubst1 contained "\<sg[ceiIlnpr]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags1127syn match vimSubst1 contained "\<si[ceInpr]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags1128syn match vimSubst1 contained "\<sI[ceginplr]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags1129syn match vimSubst1 contained "\<sr[cgiInplr]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags1130 1131" Vi compatibility1132syn match vimSubstDelim contained "\\"1133syn match vimSubstPat contained "\\\ze[/?&]" contains=vimSubstDelim nextgroup=vimSubstRep41134 1135" Mark: {{{21136" ====1137VimL syn match vimExMark "\<k\%([a-zA-Z0-9]\>\|[[\]<>'`]\)\@=" nextgroup=@vimMarkArg1138VimL syn match vimExMark "\<k\>" skipwhite nextgroup=@vimMarkArg1139syn match vimExMark "\<mark\>" skipwhite nextgroup=@vimMarkArg1140 1141syn match vimMarkArg contained "[a-zA-Z]\>\|[[\]<>'`]" skipwhite nextgroup=vimCmdSep,vimComment1142syn match vimMarkArgError contained "["^.(){}0-9]"1143syn cluster vimMarkArg contains=vimMarkArg,vimMarkArgError1144 1145" Marks, Registers, Addresses, Filters: {{{21146syn match vimMark "'[a-zA-Z0-9]\ze\s*$"1147syn match vimMark "'[[\]{}()<>'`"^.]\ze\s*$"1148syn match vimMark "'[a-zA-Z0-9]\ze[-+,!]" nextgroup=vimFilter,vimMarkNumber,vimSubst11149syn match vimMark "'[[\]{}()<>'`"^.]\ze[-+,!]" nextgroup=vimFilter,vimMarkNumber,vimSubst11150syn match vimMark ",\zs'[[\]{}()<>'`"^.]" nextgroup=vimFilter,vimMarkNumber,vimSubst11151syn match vimMark "[!,:]\zs'[a-zA-Z0-9]" nextgroup=vimFilter,vimMarkNumber,vimSubst11152syn match vimMarkNumber "[-+]\d\+" contained contains=vimOper nextgroup=vimSubst11153syn match vimPlainMark contained "'[a-zA-Z0-9]"1154syn match vimRange "[`'][a-zA-Z0-9],[`'][a-zA-Z0-9]" contains=vimMark skipwhite nextgroup=vimFilter1155 1156syn match vimRegister '[^,;[{: \t]\zs"[a-zA-Z0-9.%#:_\-/]\ze[^a-zA-Z_":0-9]'1157syn match vimRegister '@"'1158syn match vimLetRegister contained '@["@0-9\-a-zA-Z:.%#=*+~_/]'1159 1160syn match vimAddress ",\zs[.$]" skipwhite nextgroup=vimSubst11161syn match vimAddress "%\ze\a" skipwhite nextgroup=vimString,vimSubst11162 1163syn match vimFilter "^!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile1164syn match vimFilter contained "!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile1165syn match vimComFilter contained "|!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile1166 1167" Complex Repeats: (:h complex-repeat) {{{21168" ===============1169syn match vimCmplxRepeat '[^a-zA-Z_/\\()]q[0-9a-zA-Z"]\>'lc=11170 1171" NOTE: :* as an alias for :@ is not supported, this is considered a :range,1172" see :help cpo-star1173syn match vimAtArg contained +@\@1<=[0-9a-z".=*+:@]+1174syn match vimAt +@[0-9a-z".=*+:@]\ze\s*\%($\|[|"#]\)+ skipwhite nextgroup=vimCmdSep,vimComment,vim9Comment contains=vimAtArg1175" Vim9: avoid LHS assignment mismatching of :@["#]1176syn match vimAt +@\ze\s*\%($\||\|\s["#]\)+ skipwhite nextgroup=vimCmdSep,vimComment,vim9Comment1177 1178" Set command and associated set-options (vimOptions) with comment {{{21179syn match vimSet "\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skipwhite nextgroup=vimSetBang,vimCmdSep,vimComment,vimSetArgs1180syn region vimSetComment contained start=+"+ skip=+\n\s*\%(\\\||"\\ \)+ end="$" contains=@vimCommentGroup,vimCommentString extend1181syn match vimSetCmdSep contained "|" skipwhite nextgroup=@vimCmdList,vimSubst1,@vimFunc1182syn match vimSetEscape contained "\\\%(\\[|"]\|.\)"1183syn match vimSetBarEscape contained "\\|"1184syn match vimSetQuoteEscape contained +\\"+1185syn region vimSetArgs contained1186 \ start="\l\|<"1187 \ skip=+\n\s*\%(\\\|["#]\\ \)\|^\s*"\\ +1188 \ end=+\ze\\\@1<![|"]+1189 "\ assume this isn't an escaped char with backslash on the previous line1190 \ end=+^\s*\\\ze[|"]+1191 \ end="\ze\s#"1192 \ end="$"1193 \ nextgroup=vimSetCmdSep,vimSetComment,vim9Comment1194 \ contains=@vimContinue,vimErrSetting,vimOption,vimSetAll,vimSetTermcap1195 \ keepend1196" TODO: restrict this to valid values?1197syn match vimOption contained "<[^>]\+>" contains=vimOption1198syn region vimSetEqual contained1199 \ matchgroup=vimOper1200 \ start="[=:]\|[-+^]="