blob: 6ab723106d36798151e27b16b7e21eecaf9e1689 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
dkearns982e1912024-03-28 20:06:03 +11002" Language: Vim script
3" Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com>
4" Doug Kearns <dougkearns@gmail.com>
Doug Kearns9b171bd2025-04-10 19:59:22 +02005" Last Change: 2025 Apr 10
Christian Brabandtf9ca1392024-02-19 20:37:11 +01006" Former Maintainer: Charles E. Campbell
h-east9b53c052024-02-13 21:09:22 +01007
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
Doug Kearns3dca5122025-03-09 16:30:28 +010012" Quit when a syntax file was already loaded {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +000013if exists("b:current_syntax")
14 finish
15endif
Bram Moolenaar113cb512021-11-07 20:27:04 +000016let s:keepcpo= &cpo
Bram Moolenaar6be7f872012-01-20 21:08:56 +010017set cpo&vim
Bram Moolenaar071d4272004-06-13 20:20:40 +000018
Doug Kearns3dca5122025-03-09 16:30:28 +010019" Feature testing {{{1
20
dkearns04e53632024-04-11 06:18:37 +100021let s:vim9script = "\n" .. getline(1, 32)->join("\n") =~# '\n\s*vim9\%[script]\>'
22
Doug Kearns3dca5122025-03-09 16:30:28 +010023function s:has(feature)
24 return has(a:feature) || index(get(g:, "vimsyn_vim_features", []), a:feature) != -1
25endfunction
26
27" Automatically generated keyword lists: {{{1
28
Bram Moolenaar071d4272004-06-13 20:20:40 +000029" vimTodo: contains common special-notices for comments {{{2
30" Use the vimCommentGroup cluster to add your own.
Bram Moolenaare2719092015-01-10 15:09:25 +010031syn keyword vimTodo contained COMBAK FIXME TODO XXX
Bram Moolenaar217ad922005-03-20 22:37:15 +000032syn cluster vimCommentGroup contains=vimTodo,@Spell
Bram Moolenaar071d4272004-06-13 20:20:40 +000033
34" regular vim commands {{{2
Doug Kearns1718e7d2025-01-08 18:20:47 +010035" GEN_SYN_VIM: vimCommand normal, START_STR='syn keyword vimCommand contained', END_STR='nextgroup=vimBang'
36syn keyword vimCommand contained abo[veleft] al[l] ar[gs] arga[dd] argd[elete] argdo argded[upe] arge[dit] argg[lobal] argl[ocal] argu[ment] as[cii] b[uffer] bN[ext] ba[ll] bad[d] balt bd[elete] bel[owright] bf[irst] bl[ast] bm[odified] bn[ext] bo[tright] bp[revious] br[ewind] brea[k] breaka[dd] breakd[el] breakl[ist] bro[wse] buffers bufd[o] bun[load] bw[ipeout] c[hange] 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] cd cdo ce[nter] cex[pr] cf[ile] cfd[o] cfir[st] cg[etfile] cgetb[uffer] cgete[xpr] chd[ir] changes che[ckpath] checkt[ime] chi[story] cl[ist] cla[st] clo[se] cle[arjumps] cn[ext] cnew[er] cnf[ile] co[py] col[der] colo[rscheme] com[mand] comc[lear] comp[iler] con[tinue] conf[irm] nextgroup=vimBang
Doug Kearns9b171bd2025-04-10 19:59:22 +020037syn keyword vimCommand contained cons[t] cope[n] cp[revious] cpf[ile] cq[uit] cr[ewind] cs[cope] cst[ag] cw[indow] d[elete] delm[arks] deb[ug] defc[ompile] defe[r] delf[unction] di[splay] dif[fupdate] diffg[et] diffo[ff] 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] el[se] em[enu] en[dif] endfo[r] endt[ry] endw[hile] ene[w] ev[al] ex exi[t] exu[sage] f[ile] files filet[ype] fin[d] fina[lly] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] foldd[oopen] folddoc[losed] foldo[pen] g[lobal] go[to] gu[i] gv[im] h[elp] helpc[lose] helpf[ind] helpt[ags] ha[rdcopy] hi[ghlight] hid[e] his[tory] hor[izontal] ij[ump] il[ist] imp[ort] int[ro] ip[ut] is[earch] isp[lit] j[oin] ju[mps] k kee[pmarks] nextgroup=vimBang
38syn keyword vimCommand contained keepj[umps] keepp[atterns] keepa[lt] l[ist] lN[ext] lNf[ile] la[st] lab[ove] lan[guage] lad[dexpr] laddb[uffer] laddf[ile] laf[ter] lat[er] lb[uffer] lbe[fore] lbel[ow] lbo[ttom] lc[d] lch[dir] lcl[ose] lcs[cope] ld[o] le[ft] lefta[bove] lex[pr] leg[acy] lf[ile] lfd[o] lfir[st] lg[etfile] lgetb[uffer] lgete[xpr] lgr[ep] lgrepa[dd] lhi[story] ll lla[st] lli[st] lmak[e] lne[xt] lnew[er] lnf[ile] lo[adview] loc[kmarks] lockv[ar] lol[der] lop[en] lp[revious] lpf[ile] lr[ewind] lt[ag] lua luad[o] luaf[ile] lw[indow] ls m[ove] ma[rk] marks menut[ranslate] mes[sages] mk[exrc] mks[ession] mksp[ell] mkv[imrc] mkvie[w] mod[e] mz[scheme] mzf[ile] n[ext] nb[key] nbc[lose] nbs[tart] noa[utocmd] noh[lsearch] nos[wapfile] nu[mber] o[pen] ol[dfiles] nextgroup=vimBang
39syn keyword vimCommand contained on[ly] opt[ions] ow[nsyntax] p[rint] pa[ckadd] packl[oadall] pb[uffer] pc[lose] pe[rl] perld[o] ped[it] po[p] pp[op] pre[serve] prev[ious] pro[mptfind] promptr[epl] prof[ile] profd[el] ps[earch] pt[ag] ptN[ext] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] py[thon] pyd[o] pyf[ile] py3 py3d[o] python3 py3f[ile] pyx pyxd[o] pythonx pyxf[ile] q[uit] quita[ll] qa[ll] r[ead] rec[over] red[o] redr[aw] redraws[tatus] redrawt[abline] reg[isters] res[ize] ret[ab] rew[ind] ri[ght] rightb[elow] ru[ntime] rub[y] rubyd[o] rubyf[ile] rund[o] rv[iminfo] sN[ext] sa[rgument] sal[l] san[dbox] sav[eas] sb[uffer] sbN[ext] sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbp[revious] sbr[ewind] scr[iptnames] scripte[ncoding] nextgroup=vimBang
40syn keyword vimCommand contained scriptv[ersion] scs[cope] setf[iletype] sf[ind] sfir[st] sh[ell] sim[alt] sig[n] sil[ent] sla[st] sn[ext] so[urce] sp[lit] 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] sw[apname] synti[me] sync[bind] smi[le] t tN[ext] ta[g] tags tab tabc[lose] tabd[o] tabe[dit] tabf[ind] tabfir[st] tabm[ove] tabl[ast] tabn[ext] tabnew tabo[nly] tabp[revious] tabN[ext] tabr[ewind] tabs tc[d] tch[dir] tcl tcld[o] tclf[ile] te[aroff] ter[minal] tf[irst] tj[ump] tl[ast] tn[ext] to[pleft] tp[revious] tr[ewind] try ts[elect] u[ndo] undoj[oin] undol[ist] unh[ide] unlo[ckvar] nextgroup=vimBang
41syn keyword vimCommand contained uns[ilent] up[date] v[global] ve[rsion] verb[ose] vert[ical] vi[sual] vie[w] vim9[cmd] viu[sage] vne[w] vs[plit] w[rite] wN[ext] wa[ll] wi[nsize] winc[md] wind[o] winp[os] 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=vimBang
h-east9b53c052024-02-13 21:09:22 +010042
Aliaksei Budaveidfcef892024-02-18 21:02:14 +030043" Lower priority for _new_ to distinguish constructors from the command.
44syn match vimCommand contained "\<new\>(\@!"
Bram Moolenaare2719092015-01-10 15:09:25 +010045syn match vimCommand contained "\<z[-+^.=]\=\>"
h-east9b53c052024-02-13 21:09:22 +010046syn 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 XMLns
Bram Moolenaar071d4272004-06-13 20:20:40 +000047
48" vimOptions are caught only when contained in a vimSet {{{2
Doug Kearnsddbb6fe2024-07-24 20:21:22 +020049" GEN_SYN_VIM: vimOption normal, START_STR='syn keyword vimOption contained', END_STR='skipwhite nextgroup=vimSetEqual,vimSetMod'
64-bitman88d41ab2025-04-06 17:20:39 +020050syn keyword vimOption contained al aleph ari allowrevins ambw ambiwidth arab arabic arshape arabicshape acd autochdir 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 ch cmdheight cwh cmdwinheight cc colorcolumn co columns com comments cms commentstring cp compatible cpt complete cfu completefunc skipwhite nextgroup=vimSetEqual,vimSetMod
glepnirf31cfa22025-03-06 21:59:13 +010051syn keyword vimOption contained cfc completefuzzycollect cia completeitemalign cot completeopt cpp completepopup csl completeslash 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 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 efm errorformat ek esckeys ei eventignore eiw eventignorewin et expandtab ex exrc fenc fileencoding skipwhite nextgroup=vimSetEqual,vimSetMod
52syn keyword vimOption contained 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 hi history hk hkmap hkp hkmapp hls hlsearch icon iconstring ic ignorecase imaf imactivatefunc imak imactivatekey skipwhite nextgroup=vimSetEqual,vimSetMod
64-bitman88d41ab2025-04-06 17:20:39 +020053syn keyword vimOption contained 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 mmd maxmapdepth mm maxmem mmp maxmempattern mmt maxmemtot mis menuitems mopt messagesopt msm mkspellmem skipwhite nextgroup=vimSetEqual,vimSetMod
54syn keyword vimOption contained ml modeline mle modelineexpr mls modelines 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 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 pmbfn printmbfont popt printoptions prompt ph pumheight pmw pummaxwidth pw pumwidth pythondll pythonhome pythonthreedll pythonthreehome pyx pyxversion skipwhite nextgroup=vimSetEqual,vimSetMod
55syn keyword vimOption contained 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 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 shm shortmess sn shortname sbr showbreak sc showcmd sloc showcmdloc sft showfulltag sm showmatch smd showmode stal showtabline ss sidescroll siso sidescrolloff scl signcolumn skipwhite nextgroup=vimSetEqual,vimSetMod
56syn keyword vimOption contained 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 su suffixes sua suffixesadd swf swapfile sws swapsync swb switchbuf smc synmaxcol syn syntax tcl tabclose tal tabline tpm tabpagemax ts tabstop tbs tagbsearch tc tagcase tfu tagfunc tl taglength tr tagrelative tag tags tgst tagstack tcldll term tbidi termbidi tenc termencoding tgc termguicolors 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 skipwhite nextgroup=vimSetEqual,vimSetMod
57syn keyword vimOption contained 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 wop wildoptions wak winaltkeys wcr wincolor wi window wfb winfixbuf wfh winfixheight wfw winfixwidth wh winheight wmh winminheight wmw winminwidth winptydll wiw winwidth wrap wm wrapmargin ws wrapscan write wa writeany wb writebackup wd writedelay xtermcodes skipwhite nextgroup=vimSetEqual,vimSetMod
Bram Moolenaar071d4272004-06-13 20:20:40 +000058
59" vimOptions: These are the turn-off setting variants {{{2
h-east9b53c052024-02-13 21:09:22 +010060" GEN_SYN_VIM: vimOption turn-off, START_STR='syn keyword vimOption contained', END_STR=''
61syn keyword vimOption contained noari noallowrevins noarab noarabic noarshape noarabicshape noacd noautochdir 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 nofileignorecase nofixeol nofixendofline
62syn keyword vimOption contained 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 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 norightleft noru noruler noscb noscrollbind noscf noscrollfocus
dkearns691aee82024-03-04 05:02:47 +110063syn keyword vimOption contained 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 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 nowinfixheight nowfw nowinfixwidth nowrap nows nowrapscan nowrite nowa nowriteany
64syn keyword vimOption contained nowb nowritebackup noxtermcodes
Bram Moolenaar071d4272004-06-13 20:20:40 +000065
66" vimOptions: These are the invertible variants {{{2
h-east9b53c052024-02-13 21:09:22 +010067" GEN_SYN_VIM: vimOption invertible, START_STR='syn keyword vimOption contained', END_STR=''
68syn keyword vimOption contained invari invallowrevins invarab invarabic invarshape invarabicshape invacd invautochdir 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 inverrorbells invek invesckeys
69syn keyword vimOption contained 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 invma invmodifiable invmod invmodified invmore invmousef invmousefocus invmh invmousehide invmousemev invmousemoveevent invnu invnumber invodev invopendevice invpaste invpi invpreserveindent invpvw invpreviewwindow
70syn keyword vimOption contained 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 invterse invta invtextauto invtx invtextmode invtop invtildeop invto invtimeout invtitle invttimeout invtbi invttybuiltin
dkearns691aee82024-03-04 05:02:47 +110071syn keyword vimOption contained invtf invttyfast invudf invundofile invvb invvisualbell invwarn invwiv invweirdinvert invwic invwildignorecase invwmnu invwildmenu invwfb invwinfixbuf invwfh invwinfixheight invwfw invwinfixwidth invwrap invws invwrapscan invwrite invwa invwriteany invwb invwritebackup invxtermcodes
Bram Moolenaar071d4272004-06-13 20:20:40 +000072" termcap codes (which can also be set) {{{2
Doug Kearnsddbb6fe2024-07-24 20:21:22 +020073" GEN_SYN_VIM: vimOption term output code, START_STR='syn keyword vimOption contained', END_STR='skipwhite nextgroup=vimSetEqual,vimSetMod'
74syn 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 skipwhite nextgroup=vimSetEqual,vimSetMod
h-east9b53c052024-02-13 21:09:22 +010075" term key codes
76syn 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_ku
Bram Moolenaarb0d45e72017-11-05 18:19:24 +010077syn match vimOption contained "t_%1"
Bram Moolenaar071d4272004-06-13 20:20:40 +000078syn match vimOption contained "t_#2"
79syn match vimOption contained "t_#4"
Bram Moolenaar6d5ad4c2016-10-27 17:00:16 +020080syn match vimOption contained "t_@7"
Bram Moolenaarb0d45e72017-11-05 18:19:24 +010081syn match vimOption contained "t_*7"
82syn match vimOption contained "t_&8"
83syn match vimOption contained "t_%i"
Bram Moolenaar071d4272004-06-13 20:20:40 +000084syn match vimOption contained "t_k;"
85
Doug Kearns3dca5122025-03-09 16:30:28 +010086" vimOptions: These are the variable names {{{2
87" GEN_SYN_VIM: vimOption normal variable, START_STR='syn keyword vimOptionVarName contained', END_STR=''
64-bitman88d41ab2025-04-06 17:20:39 +020088syn keyword vimOptionVarName contained al aleph ari allowrevins ambw ambiwidth arab arabic arshape arabicshape acd autochdir 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 ch cmdheight cwh cmdwinheight cc colorcolumn co columns com comments cms commentstring cp compatible cpt complete
89syn keyword vimOptionVarName contained cfu completefunc cfc completefuzzycollect cia completeitemalign cot completeopt cpp completepopup csl completeslash 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 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 efm errorformat ek esckeys ei eventignore eiw eventignorewin et expandtab
90syn keyword vimOptionVarName contained 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 hi history hk hkmap hkp hkmapp hls hlsearch icon iconstring ic ignorecase
91syn keyword vimOptionVarName contained 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 mmd maxmapdepth mm maxmem mmp maxmempattern mmt maxmemtot
92syn keyword vimOptionVarName contained mis menuitems mopt messagesopt msm mkspellmem ml modeline mle modelineexpr mls modelines 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 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 pmbfn printmbfont popt printoptions prompt ph pumheight pmw pummaxwidth pw pumwidth pythondll pythonhome
93syn keyword vimOptionVarName contained 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 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 shm shortmess sn shortname sbr showbreak sc showcmd sloc showcmdloc sft showfulltag sm showmatch smd showmode stal showtabline
94syn keyword vimOptionVarName contained 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 su suffixes sua suffixesadd swf swapfile sws swapsync swb switchbuf smc synmaxcol syn syntax tcl tabclose tal tabline tpm tabpagemax ts tabstop tbs tagbsearch tc tagcase tfu tagfunc tl taglength tr tagrelative tag tags tgst tagstack tcldll term tbidi termbidi tenc termencoding tgc termguicolors twk termwinkey twsl termwinscroll tws termwinsize twt termwintype terse ta textauto tx textmode tw textwidth tsr thesaurus tsrfu thesaurusfunc top tildeop
95syn keyword vimOptionVarName contained 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 wop wildoptions wak winaltkeys wcr wincolor wi window wfb winfixbuf wfh winfixheight wfw winfixwidth wh winheight wmh winminheight wmw winminwidth winptydll wiw winwidth wrap wm wrapmargin ws wrapscan
96syn keyword vimOptionVarName contained write wa writeany wb writebackup wd writedelay xtermcodes
Doug Kearns3dca5122025-03-09 16:30:28 +010097" GEN_SYN_VIM: vimOption term output code variable, START_STR='syn keyword vimOptionVarName contained', END_STR=''
98syn 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
99syn 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_ku
100syn match vimOptionVarName contained "t_%1"
101syn match vimOptionVarName contained "t_#2"
102syn match vimOptionVarName contained "t_#4"
103syn match vimOptionVarName contained "t_@7"
104syn match vimOptionVarName contained "t_*7"
105syn match vimOptionVarName contained "t_&8"
106syn match vimOptionVarName contained "t_%i"
107syn match vimOptionVarName contained "t_k;"
108
Bram Moolenaar03413f42016-04-12 21:07:15 +0200109" unsupported settings: some were supported by vi but don't do anything in vim {{{2
h-east9b53c052024-02-13 21:09:22 +0100110" GEN_SYN_VIM: Missing vimOption, START_STR='syn keyword vimErrSetting contained', END_STR=''
111syn 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 w9600
112syn 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 nosourceany
113syn 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 invsourceany
Bram Moolenaar071d4272004-06-13 20:20:40 +0000114
Bram Moolenaar80a94a52006-02-23 21:26:58 +0000115" AutoCmd Events {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000116syn case ignore
h-east9b53c052024-02-13 21:09:22 +0100117" GEN_SYN_VIM: vimAutoEvent, START_STR='syn keyword vimAutoEvent contained', END_STR=''
Doug Kearnse85fdc72024-07-07 20:45:37 +0200118syn 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 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 FilterWritePost
Jim Zhou5606ca52025-03-13 21:58:25 +0100119syn keyword vimAutoEvent contained FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave InsertLeavePre KeyInputPre MenuPopup ModeChanged OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SafeState SafeStateAgain SessionLoadPost 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 User VimEnter VimLeave VimLeavePre VimResized VimResume VimSuspend WinClosed WinEnter WinLeave WinNew WinNewPre WinResized WinScrolled
Bram Moolenaar071d4272004-06-13 20:20:40 +0000120
121" Highlight commonly used Groupnames {{{2
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200122syn keyword vimGroup contained Comment Constant String Character Number Boolean Float Identifier Function Statement Conditional Repeat Label Operator Keyword Exception PreProc Include Define Macro PreCondit Type StorageClass Structure Typedef Special SpecialChar Tag Delimiter SpecialComment Debug Underlined Ignore Error Todo
Bram Moolenaar071d4272004-06-13 20:20:40 +0000123
124" Default highlighting groups {{{2
h-east9b53c052024-02-13 21:09:22 +0100125" GEN_SYN_VIM: vimHLGroup, START_STR='syn keyword vimHLGroup contained', END_STR=''
Yee Cheng Chin9943d472025-03-26 19:41:02 +0100126syn keyword vimHLGroup contained ErrorMsg IncSearch ModeMsg NonText StatusLine StatusLineNC EndOfBuffer VertSplit VisualNOS DiffText DiffTextAdd PmenuSbar TabLineSel TabLineFill Cursor lCursor QuickFixLine CursorLineSign CursorLineFold CurSearch PmenuKind PmenuKindSel PmenuMatch PmenuMatchSel PmenuExtra PmenuExtraSel PopupSelected MessageWindow PopupNotification Normal Directory LineNr CursorLineNr MoreMsg Question Search SpellBad SpellCap SpellRare SpellLocal PmenuThumb Pmenu PmenuSel SpecialKey Title WarningMsg WildMenu Folded FoldColumn SignColumn Visual DiffAdd DiffChange DiffDelete TabLine CursorColumn CursorLine ColorColumn MatchParen StatusLineTerm StatusLineTermNC ToolbarLine ToolbarButton Menu Tooltip Scrollbar CursorIM LineNrAbove LineNrBelow
Christian Brabandt393708c2024-05-27 15:50:07 +0200127syn match vimHLGroup contained "\<Conceal\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000128syn case match
129
130" Function Names {{{2
h-east9b53c052024-02-13 21:09:22 +0100131" GEN_SYN_VIM: vimFuncName, START_STR='syn keyword vimFuncName contained', END_STR=''
Doug Kearns8dec6c22025-01-19 14:02:06 +0100132syn 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_log ch_logfile ch_open ch_read ch_readblob ch_readraw ch_sendexpr ch_sendraw ch_setoptions ch_status changenr
133syn keyword vimFuncName contained char2nr charclass charcol charidx chdir cindent clearmatches 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 getbufinfo getbufline getbufoneline
h-east61397662025-01-03 17:32:54 +0100134syn keyword vimFuncName contained getbufvar getcellpixels getcellwidths getchangelist getchar getcharmod getcharpos getcharsearch getcharstr getcmdcomplpat getcmdcompltype getcmdline getcmdpos getcmdprompt getcmdscreenpos getcmdtype getcmdwintype getcompletion 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 histdel histget histnr hlID hlexists hlget hlset hostname
Yegappan Lakshmanan038be272025-03-26 18:46:21 +0100135syn keyword vimFuncName contained 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 nextnonblank ngettext nr2char or pathshorten perleval popup_atcursor
Doug Kearns4a530a62025-02-03 18:59:09 +0100136syn keyword vimFuncName contained 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 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 reduce reg_executing reg_recording reltime reltimefloat reltimestr remote_expr remote_foreground
137syn keyword vimFuncName contained 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_unplacelist simplify sin sinh slice sort sound_clear sound_playevent sound_playfile sound_stop soundfold spellbadword
138syn keyword vimFuncName contained 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_scrape term_sendkeys term_setansicolors term_setapi term_setkill term_setrestore term_setsize term_start term_wait
Yegappan Lakshmanan038be272025-03-26 18:46:21 +0100139syn keyword vimFuncName contained 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 utf16idx values virtcol virtcol2col visualmode wildmenumode win_execute win_findbuf win_getid win_gettype win_gotoid win_id2tabwin win_id2win win_move_separator win_move_statusline
140syn keyword vimFuncName contained win_screenpos win_splitmove winbufnr wincol windowsversion winheight winlayout winline winnr winrestcmd winrestview winsaveview winwidth wordcount writefile xor
Doug Kearns3dca5122025-03-09 16:30:28 +0100141" Predefined variable names {{{2
142" GEN_SYN_VIM: vimVarName, START_STR='syn keyword vimVimVarName contained', END_STR=''
143syn 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 numbersize
Yegappan Lakshmanan038be272025-03-26 18:46:21 +0100144syn 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
Bram Moolenaar071d4272004-06-13 20:20:40 +0000145
Doug Kearns3dca5122025-03-09 16:30:28 +0100146"--- syntax here and above generated by runtime/syntax/generator/gen_syntax_vim.vim ---
147
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000148" Special Vim Highlighting (not automatic) {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000149
Doug Kearns3dca5122025-03-09 16:30:28 +0100150" Neovim keyword list additions {{{2
151
152if s:has("nvim")
153 syn keyword vimOptionVarName contained channel inccommand mousescroll pumblend redrawdebug scrollback shada shadafile statuscolumn termpastefilter termsync winbar winblend winhighlight
154 syn keyword vimVimVarName contained lua msgpack_types relnum stderr termrequest virtnum
155endif
156
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200157" Set up commands for this syntax highlighting file {{{2
158
159com! -nargs=* Vim9 execute <q-args> s:vim9script ? "" : "contained"
160com! -nargs=* VimL execute <q-args> s:vim9script ? "contained" : ""
161
Doug Kearns818c6412024-10-06 17:00:48 +0200162if exists("g:vimsyn_folding") && g:vimsyn_folding =~# '[acefhiHlmpPrt]'
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200163 if g:vimsyn_folding =~# 'a'
164 com! -nargs=* VimFolda <args> fold
165 else
166 com! -nargs=* VimFolda <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100167 endif
Doug Kearns818c6412024-10-06 17:00:48 +0200168 if g:vimsyn_folding =~# 'c'
169 com! -nargs=* VimFoldc <args> fold
170 else
171 com! -nargs=* VimFoldc <args>
172 endif
173 if g:vimsyn_folding =~# 'e'
174 com! -nargs=* VimFolde <args> fold
175 else
176 com! -nargs=* VimFolde <args>
177 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200178 if g:vimsyn_folding =~# 'f'
179 com! -nargs=* VimFoldf <args> fold
180 else
181 com! -nargs=* VimFoldf <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100182 endif
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100183 if g:vimsyn_folding =~# 'h'
184 com! -nargs=* VimFoldh <args> fold
185 else
186 com! -nargs=* VimFoldh <args>
187 endif
Doug Kearnsce064932024-04-13 18:24:01 +0200188 if g:vimsyn_folding =~# 'H'
189 com! -nargs=* VimFoldH <args> fold
190 else
191 com! -nargs=* VimFoldH <args>
192 endif
Doug Kearns818c6412024-10-06 17:00:48 +0200193 if g:vimsyn_folding =~# 'i'
194 com! -nargs=* VimFoldi <args> fold
195 else
196 com! -nargs=* VimFoldi <args>
197 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200198 if g:vimsyn_folding =~# 'l'
199 com! -nargs=* VimFoldl <args> fold
200 else
201 com! -nargs=* VimFoldl <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100202 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200203 if g:vimsyn_folding =~# 'm'
204 com! -nargs=* VimFoldm <args> fold
205 else
206 com! -nargs=* VimFoldm <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100207 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200208 if g:vimsyn_folding =~# 'p'
209 com! -nargs=* VimFoldp <args> fold
210 else
211 com! -nargs=* VimFoldp <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100212 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200213 if g:vimsyn_folding =~# 'P'
214 com! -nargs=* VimFoldP <args> fold
215 else
216 com! -nargs=* VimFoldP <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100217 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200218 if g:vimsyn_folding =~# 'r'
219 com! -nargs=* VimFoldr <args> fold
220 else
221 com! -nargs=* VimFoldr <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100222 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200223 if g:vimsyn_folding =~# 't'
224 com! -nargs=* VimFoldt <args> fold
225 else
226 com! -nargs=* VimFoldt <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100227 endif
228else
229 com! -nargs=* VimFolda <args>
Doug Kearns818c6412024-10-06 17:00:48 +0200230 com! -nargs=* VimFoldc <args>
231 com! -nargs=* VimFolde <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100232 com! -nargs=* VimFoldf <args>
Doug Kearns818c6412024-10-06 17:00:48 +0200233 com! -nargs=* VimFoldi <args>
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100234 com! -nargs=* VimFoldh <args>
Doug Kearnsce064932024-04-13 18:24:01 +0200235 com! -nargs=* VimFoldH <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100236 com! -nargs=* VimFoldl <args>
237 com! -nargs=* VimFoldm <args>
238 com! -nargs=* VimFoldp <args>
239 com! -nargs=* VimFoldP <args>
240 com! -nargs=* VimFoldr <args>
241 com! -nargs=* VimFoldt <args>
242endif
243
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000244" Deprecated variable options {{{2
245if exists("g:vim_minlines")
246 let g:vimsyn_minlines= g:vim_minlines
247endif
248if exists("g:vim_maxlines")
249 let g:vimsyn_maxlines= g:vim_maxlines
250endif
251if exists("g:vimsyntax_noerror")
252 let g:vimsyn_noerror= g:vimsyntax_noerror
253endif
254
Bram Moolenaar03413f42016-04-12 21:07:15 +0200255" Variable options {{{2
256if exists("g:vim_maxlines")
257 let s:vimsyn_maxlines= g:vim_maxlines
258else
259 let s:vimsyn_maxlines= 60
260endif
261
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200262" Nulls {{{2
263" =====
264Vim9 syn keyword vim9Null null null_blob null_channel null_class null_dict null_function null_job null_list null_object null_partial null_string
265
266" Booleans {{{2
267" ========
268Vim9 syn keyword vim9Boolean true false
269
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000270" Numbers {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000271" =======
dkearns5cd86c62024-03-12 07:40:58 +1100272syn case ignore
Doug Kearns1aa287e2025-02-10 22:00:27 +0100273syn match vimNumber '\<\d\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment,vimSubscript
274syn match vimNumber '\<\d\+\.\d\+\%(e[+-]\=\d\+\)\=' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment
275syn match vimNumber '\<0b[01]\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment,vimSubscript
276syn match vimNumber '\<0o\=\o\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment,vimSubscript
277syn match vimNumber '\<0x\x\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment,vimSubscript
Doug Kearns8dec6c22025-01-19 14:02:06 +0100278syn match vimNumber '\<0z\>' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment
Doug Kearns1aa287e2025-02-10 22:00:27 +0100279syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment,vimSubscript
dkearns5cd86c62024-03-12 07:40:58 +1100280syn case match
Bram Moolenaar071d4272004-06-13 20:20:40 +0000281
Bram Moolenaar6c1e1572019-06-22 02:13:00 +0200282" All vimCommands are contained by vimIsCommand. {{{2
Doug Kearns9b171bd2025-04-10 19:59:22 +0200283syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutoCmd,vimAugroup,vimBehave,vimCall,vimCatch,vimConst,vimDebuggreedy,vimDef,vimDefFold,vimDelcommand,@vimEcho,vimEnddef,vimEndfunction,vimExecute,vimIsCommand,vimExtCmd,vimExFilter,vimFor,vimFunction,vimFuncFold,vimGrep,vimGrepAdd,vimGlobal,vimHelpgrep,vimHighlight,vimLet,vimLoadkeymap,vimLockvar,vimMake,vimMap,vimMark,vimMatch,vimNotFunc,vimNormal,vimRedir,vimSet,vimSleep,vimSort,vimSyntax,vimThrow,vimUnlet,vimUnlockvar,vimUnmap,vimUserCmd,vimVimgrep,vimVimgrepadd,vimMenu,vimMenutranslate,@vim9CmdList,@vimExUserCmdList
h-east61397662025-01-03 17:32:54 +0100284syn cluster vim9CmdList contains=vim9Abstract,vim9Class,vim9Const,vim9Enum,vim9Export,vim9Final,vim9For,vim9Interface,vim9Type,vim9Var
Doug Kearns60bd1402025-02-27 19:15:20 +0100285syn match vimCmdSep "\\\@1<!|" skipwhite nextgroup=@vimCmdList,vimSubst1,vimFunc
286syn match vimCmdSep ":\+" skipwhite nextgroup=@vimCmdList,vimSubst1
Doug Kearns4a530a62025-02-03 18:59:09 +0100287syn match vimCount contained "\d\+"
Doug Kearns1718e7d2025-01-08 18:20:47 +0100288syn match vimIsCommand "\<\%(\h\w*\|[23]mat\%[ch]\)\>" nextgroup=vimBang contains=vimCommand
Doug Kearns3c07eb02024-09-02 10:03:37 +0200289syn match vimBang contained "!"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000290
Doug Kearns1aa287e2025-02-10 22:00:27 +0100291syn region vimSubscript contained matchgroup=vimSubscriptBracket start="\[" end="]" nextgroup=vimSubscript contains=@vimExprList
292
293syn match vimVar contained "\<\h[a-zA-Z0-9#_]*\>" nextgroup=vimSubscript contains=vim9Super,vim9This
Doug Kearns3dca5122025-03-09 16:30:28 +0100294syn match vimVar "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>" nextgroup=vimSubscript contains=vimVarScope
295syn match vimVar "\<a:\%(000\|1\=[0-9]\|20\)\>" nextgroup=vimSubscript contains=vimVarScope
296syn match vimFBVar contained "\<[bwglsta]:\h[a-zA-Z0-9#_]*\>" nextgroup=vimSubscript contains=vimVarScope
Doug Kearns1aa287e2025-02-10 22:00:27 +0100297
Doug Kearns3dca5122025-03-09 16:30:28 +0100298" match the scope prefix independently of the retrofitted scope dictionary
299syn match vimVarScope contained "\<[bwglstav]:"
300syn match vimVimVar contained "\<[bwglstav]:\%(\h\|\d\)\@!" nextgroup=vimSubscript
301
302syn match vimVarNameError contained "\<\h\w*\>"
303syn match vimVimVar "\<v:" nextgroup=vimSubscript,vimVimVarName,vimVarNameError
304syn match vimOptionVar "&\%([lg]:\)\=" nextgroup=vimSubscript,vimOptionVarName,vimVarNameError
Doug Kearns1aa287e2025-02-10 22:00:27 +0100305syn cluster vimSpecialVar contains=vimEnvvar,vimLetRegister,vimOptionVar,vimVimVar
306
307Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s\+[-+/*%]\=="
308Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s\+\.\.="
309Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s\+=<<"
310Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s*->" contains=vim9Super,vim9This
311Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\[" nextgroup=vimSubscript
312Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\." nextgroup=vimOper contains=vim9Super,vim9This
313
314Vim9 syn match vim9LhsVariableList "\[\_[^]]\+]\ze\s\+[-+/*%]\==" contains=vimVar,@vimSpecialVar
315Vim9 syn match vim9LhsVariableList "\[\_[^]]\+]\ze\s\+\.\.=" contains=vimVar,@vimSpecialVar
316
317Vim9 syn match vim9LhsRegister "@["0-9\-a-zA-Z#=*+_/]\ze\s\+\%(\.\.\)\=="
318
319syn cluster vimExprList contains=@vimSpecialVar,vimFunc,vimNumber,vimOper,vimOperParen,vimLambda,vimString,vimVar,@vim9ExprList
320syn cluster vim9ExprList contains=vim9Boolean,vim9LambdaParams,vim9Null
dkearnsb1427b42024-02-28 05:59:30 +1100321
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000322" Insertions And Appends: insert append {{{2
Bram Moolenaar519cc552021-11-16 19:18:26 +0000323" (buftype != nofile test avoids having append, change, insert show up in the command window)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000324" =======================
Bram Moolenaar519cc552021-11-16 19:18:26 +0000325if &buftype != 'nofile'
dkearns4ba70ca2024-04-15 04:32:56 +1000326 syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=a\%[ppend]$" matchgroup=vimCommand end="^\.$" extend
327 syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=c\%[hange]$" matchgroup=vimCommand end="^\.$" extend
328 syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=i\%[nsert]$" matchgroup=vimCommand end="^\.$" extend
Bram Moolenaar519cc552021-11-16 19:18:26 +0000329endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000330
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000331" Behave! {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000332" =======
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100333if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_nobehaveerror")
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000334 syn match vimBehaveError contained "[^ ]\+"
335endif
Doug Kearnsfe6d5b02024-02-14 21:17:43 +0100336syn match vimBehave "\<be\%[have]\>" nextgroup=vimBehaveBang,vimBehaveModel,vimBehaveError skipwhite
337syn match vimBehaveBang contained "\a\@1<=!" nextgroup=vimBehaveModel skipwhite
338syn keyword vimBehaveModel contained mswin xterm
Bram Moolenaar071d4272004-06-13 20:20:40 +0000339
Doug Kearns99984fc2024-07-18 20:45:19 +0200340" Call {{{2
341" ====
342syn match vimCall "\<call\=\>" skipwhite nextgroup=vimFunc
343
Doug Kearnsa9c06422025-02-12 20:44:17 +0100344" Debuggreedy {{{2
Doug Kearns4a530a62025-02-03 18:59:09 +0100345" ===========
346" TODO: special-cased until generalised range/count support is implemented
347syn match vimDebuggreedy "\<0\=debugg\%[reedy]\>" contains=vimCount
348
dkearnsa3bddb72024-06-14 01:48:10 +1000349" Exception Handling {{{2
350syn keyword vimThrow th[row] skipwhite nextgroup=@vimExprList
351syn keyword vimCatch cat[ch] skipwhite nextgroup=vimCatchPattern
352syn region vimCatchPattern contained matchgroup=Delimiter start="\z([!#$%&'()*+,-./:;<=>?@[\]^_`{}~]\)" skip="\\\\\|\\\z1" end="\z1" contains=@vimSubstList oneline
353
Doug Kearns818c6412024-10-06 17:00:48 +0200354" Export {{{2
355" ======
356if s:vim9script
357 syn keyword vim9Export export skipwhite nextgroup=vim9Abstract,vim9ClassBody,vim9Const,vim9Def,vim9EnumBody,vim9Final,vim9InterfaceBody,vim9Type,vim9Var
358endif
359
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000360" Filetypes {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000361" =========
Bram Moolenaar293ee4d2004-12-09 21:34:53 +0000362syn match vimFiletype "\<filet\%[ype]\(\s\+\I\i*\)*" skipwhite contains=vimFTCmd,vimFTOption,vimFTError
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100363if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_vimFTError")
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000364 syn match vimFTError contained "\I\i*"
365endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000366syn keyword vimFTCmd contained filet[ype]
367syn keyword vimFTOption contained detect indent off on plugin
368
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000369" Augroup : vimAugroupError removed because long augroups caused sync'ing problems. {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000370" ======= : Trade-off: Increasing synclines with slower editing vs augroup END error checking.
Doug Kearns1aa287e2025-02-10 22:00:27 +0100371syn cluster vimAugroupList contains=@vimCmdList,vimFilter,vimFunc,vimLineComment,vimSpecFile,vimOper,vimNumber,vimOperParen,@vimComment,vimString,vimSubst,vimRegister,vimCmplxRepeat,vimNotation,vimCtrlChar,vimContinue
dkearnsc4aef9a2024-03-04 02:42:47 +1100372syn match vimAugroup "\<aug\%[roup]\>" contains=vimAugroupKey,vimAugroupBang skipwhite nextgroup=vimAugroupBang,vimAutoCmdGroup
Bram Moolenaarf3913272016-02-25 00:00:01 +0100373if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'a'
dkearnsc4aef9a2024-03-04 02:42:47 +1100374 syn region vimAugroup fold start="\<aug\%[roup]\>\ze\s\+\%([eE][nN][dD]\)\@!\S\+" matchgroup=vimAugroupKey end="\<aug\%[roup]\>\ze\s\+[eE][nN][dD]\>" contains=vimAutoCmd,@vimAugroupList,vimAugroupkey skipwhite nextgroup=vimAugroupEnd
Bram Moolenaarb4ff5182015-11-10 21:15:48 +0100375else
dkearnsc4aef9a2024-03-04 02:42:47 +1100376 syn region vimAugroup start="\<aug\%[roup]\>\ze\s\+\%([eE][nN][dD]\)\@!\S\+" matchgroup=vimAugroupKey end="\<aug\%[roup]\>\ze\s\+[eE][nN][dD]\>" contains=vimAutoCmd,@vimAugroupList,vimAugroupkey skipwhite nextgroup=vimAugroupEnd
Bram Moolenaarb4ff5182015-11-10 21:15:48 +0100377endif
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100378if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noaugrouperror")
dkearnsc4aef9a2024-03-04 02:42:47 +1100379 syn match vimAugroupError "\<aug\%[roup]\>\s\+[eE][nN][dD]\>"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000380endif
dkearnsc4aef9a2024-03-04 02:42:47 +1100381
382syn match vimAutoCmdGroup contained "\S\+"
383syn match vimAugroupEnd contained "\c\<END\>"
384syn match vimAugroupBang contained "\a\@1<=!" skipwhite nextgroup=vimAutoCmdGroup
385syn keyword vimAugroupKey contained aug[roup] skipwhite nextgroup=vimAugroupBang,vimAutoCmdGroup,vimAugroupEnd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000386
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000387" Operators: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000388" =========
Doug Kearnsa9c06422025-02-12 20:44:17 +0100389syn cluster vimOperGroup contains=@vimContinue,@vimExprList,vim9Comment
Doug Kearns1aa287e2025-02-10 22:00:27 +0100390syn match vimOper "\a\@<!!" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimSpecFile
391syn match vimOper "||\|&&\|[-+*/%.]" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimSpecFile
392syn match vimOper "?" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList
Doug Kearnsc273f1a2025-01-20 21:53:01 +0100393" distinguish ternary : from ex-colon
Doug Kearns1aa287e2025-02-10 22:00:27 +0100394syn match vimOper "\s\@1<=:\ze\s\|\s\@1<=:$" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList
395syn match vimOper "??" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList
396syn match vimOper "=" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimSpecFile
397syn match vimOper "\%#=1\%(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\)[?#]\=" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimSpecFile
398syn match vimOper "\<is\%(not\)\=\>" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimSpecFile
399syn match vimOper "\<is\%(not\)\=[?#]" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimSpecFile
400syn region vimOperParen matchgroup=vimParenSep start="(" end=")" contains=@vimOperGroup nextgroup=vimSubscript
401syn region vimOperParen matchgroup=vimSep start="#\={" end="}" contains=@vimOperGroup nextgroup=vimSubscript,vimVar
402syn region vimOperParen contained matchgroup=vimSep start="\[" end="]" contains=@vimOperGroup nextgroup=vimSubscript,vimVar
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100403if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noopererror")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100404 syn match vimOperError ")"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000405endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000406
Doug Kearns1aa287e2025-02-10 22:00:27 +0100407syn match vimOperContinue contained "^\s*\zs\\" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList
408syn match vimOperContinueComment contained '^\s*\zs["#]\\ .*' skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList
409syn cluster vimOperContinue contains=vimOperContinue,vimOperContinueComment
410
411" Lambda Expressions: {{{2
412" ==================
413syn match vimLambdaOperator contained "->" skipwhite nextgroup=@vimExprList
Doug Kearns722fbd12025-03-28 19:36:37 +0100414syn region vimLambda contained
415 \ matchgroup=vimLambdaBrace
416 \ start=+{\ze[[:space:][:alnum:]_.,]*\%(\n\s*\%(\\[[:space:][:alnum:]_.,]*\|"\\ .*\)\)*->+
417 \ skip=+\n\s*\%(\\\|"\\ \)+
418 \ end="}" end="$"
419 \ contains=@vimContinue,@vimExprList,vimLambdaParams
420syn match vimLambdaParams contained "\%({\n\=\)\@1<=\_.\{-}\%(->\)\@=" nextgroup=vimLambdaOperator contains=@vimContinue,vimFuncParam
Doug Kearns1aa287e2025-02-10 22:00:27 +0100421
Doug Kearns722fbd12025-03-28 19:36:37 +0100422syn match vim9LambdaOperator contained "=>" skipwhite skipempty nextgroup=@vimExprList,vim9LambdaBlock,vim9LambdaOperatorComment
423syn match vim9LambdaParen contained "[()]"
424syn match vim9LambdaParams contained
425 \ "(\%(\<func(\|[^(]\)*\%(\n\s*\\\%(\<func(\|[^(]\)*\|\n\s*#\\ .*\)*\ze\s\+=>"
426 \ skipwhite nextgroup=vim9LambdaOperator
427 \ contains=@vim9Continue,vimDefParam,vim9LambdaParen,vim9LambdaReturnType
428syn region vim9LambdaReturnType contained start=")\@<=:\s" end="\ze\s*#" end="\ze\s*=>" contains=@vim9Continue,@vimType transparent
429syn region vim9LambdaBlock contained matchgroup=vimSep start="{" end="^\s*\zs}" contains=@vimDefBodyList
Doug Kearns1aa287e2025-02-10 22:00:27 +0100430
431syn match vim9LambdaOperatorComment contained "#.*" skipwhite skipempty nextgroup=@vimExprList,vim9LambdaBlock,vim9LambdaOperatorComment
432
dkearns4ba70ca2024-04-15 04:32:56 +1000433" Functions: Tag is provided for those who wish to highlight tagged functions {{{2
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000434" =========
Doug Kearns1aa287e2025-02-10 22:00:27 +0100435syn cluster vimFuncList contains=vimFuncBang,vimFunctionError,vimFuncKey,vimFuncScope,vimFuncSID,Tag
436syn cluster vimDefList contains=vimFuncBang,vimFunctionError,vimDefKey,vimFuncScope,vimFuncSID,Tag
dkearns4ba70ca2024-04-15 04:32:56 +1000437
Doug Kearns68ba6c22025-02-16 16:40:12 +0100438syn cluster vimFuncBodyCommon contains=@vimCmdList,vimCmplxRepeat,vimContinue,vimCtrlChar,vimDef,vimFBVar,vimFunc,vimFunction,vimLetHereDoc,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegister,vimSpecFile,vimString,vimSubst,vimFuncFold,vimDefFold
Doug Kearns1aa287e2025-02-10 22:00:27 +0100439syn cluster vimFuncBodyList contains=@vimFuncBodyCommon,vimComment,vimLineComment,vimInsert,vimConst,vimLet,vimSearch
440syn cluster vimDefBodyList contains=@vimFuncBodyCommon,vim9Comment,vim9LineComment,vim9Block,vim9Const,vim9Final,vim9Var,vim9Null,vim9Boolean,vim9For,vim9LhsVariable,vim9LhsVariableList,vim9LhsRegister,vim9Search,@vimSpecialVar
dkearns35e6f4c2024-03-22 06:41:10 +1100441
442syn region vimFuncPattern contained matchgroup=vimOper start="/" end="$" contains=@vimSubstList
443syn match vimFunction "\<fu\%[nction]\>" skipwhite nextgroup=vimCmdSep,vimComment,vimFuncPattern contains=vimFuncKey
444syn match vimDef "\<def\>" skipwhite nextgroup=vimCmdSep,vimComment,vimFuncPattern contains=vimDefKey
445
446syn match vimFunction "\<fu\%[nction]\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+" contains=@vimFuncList skipwhite nextgroup=vimFuncParams
Doug Kearns818c6412024-10-06 17:00:48 +0200447syn match vimDef "\<def\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+" contains=@vimDefList nextgroup=vimDefParams
dkearns35e6f4c2024-03-22 06:41:10 +1100448
Doug Kearnsdd3f1c02025-03-17 20:27:13 +0100449syn region vimFuncComment contained
450 \ start=+".*+
451 \ skip=+\n\s*\\\|\n\s*"\\ +
452 \ end="$"
453 \ skipwhite skipempty nextgroup=vimFuncBody,vimEndfunction
454syn region vimDefComment contained
455 \ start="#.*"
456 \ skip=+\n\s*\\\|\n\s*#\\ +
457 \ end="$"
458 \ skipwhite skipempty nextgroup=vimDefBody,vimEnddef
dkearns35e6f4c2024-03-22 06:41:10 +1100459
460syn match vimFuncBang contained "!"
461syn match vimFuncSID contained "\c<sid>"
Doug Kearns1aa287e2025-02-10 22:00:27 +0100462syn match vimFuncScope contained "\<[sg]:"
dkearns35e6f4c2024-03-22 06:41:10 +1100463syn keyword vimFuncKey contained fu[nction]
464syn keyword vimDefKey contained def
465
Doug Kearns9b67a2e2024-12-26 10:13:45 +0100466syn region vimFuncParams contained matchgroup=Delimiter start="(" skip=+\n\s*\\\|\n\s*"\\ + end=")" skipwhite skipempty nextgroup=vimFuncBody,vimFuncComment,vimEndfunction,vimFuncMod,vim9CommentError contains=vimFuncParam,vimOperParen,@vimContinue
467syn region vimDefParams contained matchgroup=Delimiter start="(" end=")" skipwhite skipempty nextgroup=vimDefBody,vimDefComment,vimEnddef,vimReturnType,vimCommentError contains=vimDefParam,vim9Comment,vimFuncParamEquals,vimOperParen
dkearns35e6f4c2024-03-22 06:41:10 +1100468syn match vimFuncParam contained "\<\h\w*\>\|\.\.\." skipwhite nextgroup=vimFuncParamEquals
469syn match vimDefParam contained "\<\h\w*\>" skipwhite nextgroup=vimParamType,vimFuncParamEquals
470
Doug Kearns35699f12024-09-19 19:51:59 +0200471syn match vimFuncParamEquals contained "=" skipwhite nextgroup=@vimExprList
472syn match vimFuncMod contained "\<\%(abort\|closure\|dict\|range\)\>" skipwhite skipempty nextgroup=vimFuncBody,vimFuncComment,vimEndfunction,vimFuncMod,vim9CommentError
dkearns35e6f4c2024-03-22 06:41:10 +1100473
Doug Kearns35699f12024-09-19 19:51:59 +0200474syn region vimFuncBody contained start="^." matchgroup=vimCmdSep start="|" matchgroup=vimCommand end="\<endfu\%[nction]\>" contains=@vimFuncBodyList skipwhite nextgroup=vimCmdSep,vimComment,vim9CommentError
475syn region vimDefBody contained start="^." matchgroup=vimCmdSep start="|" matchgroup=vimCommand end="\<enddef\>" contains=@vimDefBodyList skipwhite nextgroup=vimCmdSep,vim9Comment,vimCommentError
dkearns35e6f4c2024-03-22 06:41:10 +1100476
Doug Kearnsfc64ac02024-06-22 11:20:36 +0200477syn match vimEndfunction "\<endf\%[unction]\>" skipwhite nextgroup=vimCmdSep,vimComment,vim9CommentError
478syn match vimEnddef "\<enddef\>" skipwhite nextgroup=vimCmdSep,vim9Comment,vimCommentError
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000479
Bram Moolenaarf3913272016-02-25 00:00:01 +0100480if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f'
Doug Kearns818c6412024-10-06 17:00:48 +0200481 syn region vimFuncFold start="\<fu\%[nction]\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+\s*(" end="\<endf\%[unction]\>" contains=vimFunction fold keepend extend transparent
482 syn region vimDefFold start="\<def\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\)\+(" end="\<enddef\>" contains=vimDef fold keepend extend transparent
Bram Moolenaarb4ff5182015-11-10 21:15:48 +0100483endif
dkearns35e6f4c2024-03-22 06:41:10 +1100484
Bram Moolenaar5c736222010-01-06 20:54:52 +0100485syn match vimFuncBlank contained "\s\+"
486
dkearns35e6f4c2024-03-22 06:41:10 +1100487" Types: {{{2
488" =====
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200489
Doug Kearnsdd3f1c02025-03-17 20:27:13 +0100490syn region vimReturnType contained
491 \ start=":\%(\s\|\n\)\@="
492 \ skip=+\n\s*\\\|\n\s*#\\ \|^\s*#\\ +
493 \ end="$"
494 \ matchgroup=vim9Comment
495 "\ allow for legacy script tail comment error
496 \ end="\ze[#"]"
497 \ skipwhite skipempty nextgroup=vimDefBody,vimDefComment,vimEnddef,vimCommentError
498 \ contains=@vim9Continue,@vimType
499 \ transparent
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200500syn match vimParamType contained ":\s" skipwhite skipnl nextgroup=@vimType contains=vimTypeSep
dkearns35e6f4c2024-03-22 06:41:10 +1100501
Doug Kearnsdd3f1c02025-03-17 20:27:13 +0100502syn match vimTypeSep contained ":\%(\s\|\n\)\@=" skipwhite nextgroup=@vimType
dkearns35e6f4c2024-03-22 06:41:10 +1100503syn keyword vimType contained any blob bool channel float job number string void
Doug Kearns722fbd12025-03-28 19:36:37 +0100504syn match vimType contained "\<\%(func\)\>"
505syn region vimCompoundType contained matchgroup=vimType start="\<func(" end=")" nextgroup=vimTypeSep contains=@vim9Continue,@vimType transparent
506syn region vimCompoundType contained matchgroup=vimType start="\<tuple<" end=">" contains=@vim9Continue,@vimType transparent
507syn region vimCompoundType contained matchgroup=vimType start="\<\%(list\|dict\)<" end=">" contains=@vimType oneline transparent
Doug Kearnsdd3f1c02025-03-17 20:27:13 +0100508syn match vimUserType contained "\<\%(\h\w*\.\)*\u\w*\>"
dkearns35e6f4c2024-03-22 06:41:10 +1100509
510syn cluster vimType contains=vimType,vimCompoundType,vimUserType
Bram Moolenaar4d8f4762021-06-27 15:18:56 +0200511
Doug Kearns818c6412024-10-06 17:00:48 +0200512" Classes, Enums And Interfaces: {{{2
513" =============================
514
515if s:vim9script
516 " Methods {{{3
Doug Kearns1aa287e2025-02-10 22:00:27 +0100517 syn match vim9MethodDef contained "\<def\>" skipwhite nextgroup=vim9MethodDefName,vim9ConstructorDefName
Doug Kearns818c6412024-10-06 17:00:48 +0200518 syn match vim9MethodDefName contained "\<\h\w*\>" nextgroup=vim9MethodDefParams contains=@vim9MethodName
519 syn region vim9MethodDefParams contained
520 \ matchgroup=Delimiter start="(" end=")"
Doug Kearnsdd3f1c02025-03-17 20:27:13 +0100521 \ skipwhite skipnl nextgroup=vim9MethodDefBody,vim9MethodDefComment,vimEnddef,vim9MethodDefReturnType,vimCommentError
Doug Kearns818c6412024-10-06 17:00:48 +0200522 \ contains=vimDefParam,vim9Comment,vimFuncParamEquals
Doug Kearns1aa287e2025-02-10 22:00:27 +0100523
Doug Kearnsadb703e2025-03-23 16:14:20 +0100524 syn match vim9ConstructorDefName contained "\<_\=new\w*\>"
Doug Kearns1aa287e2025-02-10 22:00:27 +0100525 \ nextgroup=vim9ConstructorDefParams
526 \ contains=@vim9MethodName
527 syn match vim9ConstructorDefParam contained "\<\%(this\.\)\=\h\w*\>"
528 \ skipwhite nextgroup=vimParamType,vimFuncParamEquals
529 \ contains=vim9This,vimOper
530 syn region vim9ConstructorDefParams contained
531 \ matchgroup=Delimiter start="(" end=")"
Doug Kearnsdd3f1c02025-03-17 20:27:13 +0100532 \ skipwhite skipnl nextgroup=vim9MethodDefBody,vim9MethodDefComment,vimEnddef,vimCommentError
Doug Kearns1aa287e2025-02-10 22:00:27 +0100533 \ contains=vim9ConstructorDefParam,vim9Comment,vimFuncParamEquals
534
Doug Kearns818c6412024-10-06 17:00:48 +0200535 syn region vim9MethodDefReturnType contained
Doug Kearnsdd3f1c02025-03-17 20:27:13 +0100536 \ start=":\%(\s\|\n\)\@="
537 \ skip=+\n\s*\\\|\n\s*#\\ \|^\s*#\\ +
538 \ end="$"
539 \ matchgroup=vim9Comment
540 \ end="\ze#"
541 \ skipwhite skipnl nextgroup=vim9MethodDefBody,vim9MethodDefComment,vimEnddef,vimCommentError
542 \ contains=@vim9Continue,vimType,vimTypeSep
Doug Kearns818c6412024-10-06 17:00:48 +0200543 \ transparent
Doug Kearnsdd3f1c02025-03-17 20:27:13 +0100544
545 syn region vim9MethodDefComment contained
546 \ start="#.*"
547 \ skip=+\n\s*\\\|\n\s*#\\ +
548 \ end="$"
549 \ skipwhite skipempty nextgroup=vim9MethodDefBody,vimEnddef
550
Doug Kearns818c6412024-10-06 17:00:48 +0200551 syn region vim9MethodDefBody contained
552 \ start="^.\=" matchgroup=vimCommand end="\<enddef\>"
553 \ skipwhite nextgroup=vimCmdSep,vim9Comment,vimCommentError
554 \ contains=@vim9MethodDefBodyList
555
556 syn cluster vim9MethodDefBodyList contains=@vimDefBodyList,vim9This,vim9Super
557
558 if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimfunctionerror")
559 syn match vim9MethodNameError contained "\<[a-z0-9]\i\>"
560 endif
Doug Kearnsadb703e2025-03-23 16:14:20 +0100561 syn match vim9MethodName contained "\<_\=new\w*\>"
Doug Kearns818c6412024-10-06 17:00:48 +0200562 syn keyword vim9MethodName contained empty len string
563
564 syn cluster vim9MethodName contains=vim9MethodName,vim9MethodNameError
565
566 if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f'
567 syn region vim9MethodDefFold contained start="\%(^\s*\%(:\=static\s\+\)\=\)\@16<=:\=def\s\+\h\i*(" end="^\s*:\=enddef\>" contains=vim9MethodDef fold keepend extend transparent
Doug Kearnsadb703e2025-03-23 16:14:20 +0100568 syn region vim9MethodDefFold contained start="^\s*:\=def\s\+_\=new\i*(" end="^\s*:\=enddef\>" contains=vim9MethodDef fold keepend extend transparent
Doug Kearns818c6412024-10-06 17:00:48 +0200569 endif
570
571 syn cluster vim9MethodDef contains=vim9MethodDef,vim9MethodDefFold
572
573 " Classes {{{3
574 syn cluster vim9ClassBodyList contains=vim9Abstract,vim9Class,vim9Comment,vim9LineComment,@vim9Continue,@vimExprList,vim9Extends,vim9Implements,@vim9MethodDef,vim9Public,vim9Static,vim9Const,vim9Final,vim9This,vim9Super,vim9Var
575
576 syn match vim9Class contained "\<class\>" skipwhite nextgroup=vim9ClassName
577 syn match vim9ClassName contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9Extends,vim9Implements
578 syn match vim9SuperClass contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9Implements
579 syn match vim9ImplementedInterface contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9InterfaceListComma,vim9Extends
580 syn match vim9InterfaceListComma contained "," skipwhite skipnl nextgroup=vim9ImplementedInterface
581 syn keyword vim9Abstract abstract skipwhite skipnl nextgroup=vim9ClassBody,vim9AbstractDef
582 syn keyword vim9Extends contained extends skipwhite skipnl nextgroup=vim9SuperClass
583 syn keyword vim9Implements contained implements skipwhite skipnl nextgroup=vim9ImplementedInterface
584 syn keyword vim9Public contained public
585 syn keyword vim9Static contained static
Doug Kearns1aa287e2025-02-10 22:00:27 +0100586 " FIXME: don't match as dictionary keys, remove when operators are not
587 " shared between Vim9 and legacy script
588 syn match vim9This contained "\.\@1<!\<this\>:\@!"
589 " super must be folowed by '.'
590 syn match vim9Super contained "\.\@1<!\<super\.\@="
Doug Kearns818c6412024-10-06 17:00:48 +0200591
592 VimFoldc syn region vim9ClassBody start="\<class\>" matchgroup=vimCommand end="\<endclass\>" contains=@vim9ClassBodyList transparent
593
594 " Enums {{{3
595 syn cluster vim9EnumBodyList contains=vim9Comment,vim9LineComment,@vim9Continue,vim9Enum,vim9Implements,@vim9MethodDef,vim9Const,vim9Final,vim9Var
596
597 syn match vim9Enum contained "\<enum\>" skipwhite nextgroup=vim9EnumName
598 syn match vim9EnumName contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9Implements
599
600 VimFolde syn region vim9EnumBody start="\<enum\>" matchgroup=vimCommand end="\<endenum\>" contains=@vim9EnumBodyList transparent
601
602 " Interfaces {{{3
603 " TODO: limit to decl only - no init values
604 syn cluster vim9InterfaceBodyList contains=vim9Comment,vim9LineComment,@vim9Continue,vim9Extends,vim9Interface,vim9AbstractDef,vim9Var
605
606 syn match vim9Interface contained "\<interface\>" skipwhite nextgroup=vim9InterfaceName
607 syn match vim9InterfaceName contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9Extends
608
609 syn keyword vim9AbstractDef contained def skipwhite nextgroup=vim9AbstractDefName
610 syn match vim9AbstractDefName contained "\<\h\w*\>" skipwhite nextgroup=vim9AbstractDefParams contains=@vim9MethodName
611 syn region vim9AbstractDefParams contained
612 \ matchgroup=Delimiter start="(" end=")"
613 \ skipwhite skipnl nextgroup=vimDefComment,vim9AbstractDefReturnType,vimCommentError
614 \ contains=vimDefParam,vim9Comment,vimFuncParamEquals
615 syn region vim9AbstractDefReturnType contained
616 \ start=":\s" end="$" matchgroup=vim9Comment end="\ze[#"]"
617 \ skipwhite skipnl nextgroup=vimDefComment,vimCommentError
618 \ contains=vimTypeSep
619 \ transparent
620
621 VimFoldi syn region vim9InterfaceBody start="\<interface\>" matchgroup=vimCommand end="\<endinterface\>" contains=@vim9InterfaceBodyList transparent
622
Doug Kearns1aa287e2025-02-10 22:00:27 +0100623 " Type Aliases {{{3
Doug Kearns818c6412024-10-06 17:00:48 +0200624 syn match vim9Type "\<ty\%[pe]\>" skipwhite nextgroup=vim9TypeAlias,vim9TypeAliasError
625 syn match vim9TypeAlias contained "\<\u\w*\>" skipwhite nextgroup=vim9TypeEquals
626 syn match vim9TypeEquals contained "=" skipwhite nextgroup=@vimType
627 if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_notypealiaserror")
Doug Kearns1aa287e2025-02-10 22:00:27 +0100628 syn match vim9TypeAliasError contained "\<\l\w*\>" skipwhite nextgroup=vim9TypeEquals
Doug Kearns818c6412024-10-06 17:00:48 +0200629 endif
630endif
631
Doug Kearns1aa287e2025-02-10 22:00:27 +0100632" Blocks: {{{2
633" ======
634Vim9 syn region vim9Block matchgroup=vimSep start="{" end="^\s*\zs}" contains=@vimDefBodyList
635
dkearns04e53632024-04-11 06:18:37 +1000636" Keymaps: {{{2
dkearns69866442023-11-22 05:43:40 +1100637" =======
638
dkearns04e53632024-04-11 06:18:37 +1000639syn match vimKeymapStart "^" contained skipwhite nextgroup=vimKeymapLhs,@vimKeymapLineComment
dkearns69866442023-11-22 05:43:40 +1100640syn match vimKeymapLhs "\S\+" contained skipwhite nextgroup=vimKeymapRhs contains=vimNotation
641syn match vimKeymapRhs "\S\+" contained skipwhite nextgroup=vimKeymapTailComment contains=vimNotation
642syn match vimKeymapTailComment "\S.*" contained
dkearns04e53632024-04-11 06:18:37 +1000643
644" TODO: remove when :" comment is matched in parts as "ex-colon comment" --djk
645if s:vim9script
646 syn match vim9KeymapLineComment "#.*" contained contains=@vimCommentGroup,vimCommentString,vim9CommentTitle
647else
648 syn match vimKeymapLineComment +".*+ contained contains=@vimCommentGroup,vimCommentString,vimCommentTitle
649endif
650syn cluster vimKeymapLineComment contains=vim9\=KeymapLineComment
dkearns69866442023-11-22 05:43:40 +1100651
Doug Kearns7866d542024-08-23 18:37:55 +0200652syn region vimLoadkeymap matchgroup=vimCommand start="\<loadk\%[eymap]\>" end="\%$" contains=vimKeymapStart
dkearns69866442023-11-22 05:43:40 +1100653
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000654" Special Filenames, Modifiers, Extension Removal: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000655" ===============================================
dkearns2c51e152024-02-27 07:10:18 +1100656syn match vimSpecFile "<c\(word\|WORD\)>" nextgroup=vimSpecFileMod,vimSubst1
657syn match vimSpecFile "<\([acs]file\|amatch\|abuf\)>" nextgroup=vimSpecFileMod,vimSubst1
658syn match vimSpecFile "\s%[ \t:]"ms=s+1,me=e-1 nextgroup=vimSpecFileMod,vimSubst1
659syn match vimSpecFile "\s%$"ms=s+1 nextgroup=vimSpecFileMod,vimSubst1
660syn match vimSpecFile "\s%<"ms=s+1,me=e-1 nextgroup=vimSpecFileMod,vimSubst1
661syn match vimSpecFile "#\d\+\|[#%]<\>" nextgroup=vimSpecFileMod,vimSubst1
Bram Moolenaar5c736222010-01-06 20:54:52 +0100662syn match vimSpecFileMod "\(:[phtre]\)\+" contained
Bram Moolenaar071d4272004-06-13 20:20:40 +0000663
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000664" User-Specified Commands: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000665" =======================
dkearns04e53632024-04-11 06:18:37 +1000666syn cluster vimUserCmdList contains=@vimCmdList,vimCmplxRepeat,@vimComment,vimCtrlChar,vimEscapeBrace,vimFunc,vimNotation,vimNumber,vimOper,vimRegister,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange
Doug Kearns520a2c72025-04-08 20:50:00 +0200667
668syn match vimUserCmd "\<com\%[mand]\>!\=" skipwhite nextgroup=vimUserCmdAttrs,vimUserCmdName contains=vimBang
669syn match vimUserCmd +\<com\%[mand]\>!\=\ze\s*\n\s*\%(\\\|["#]\\ \)+ skipwhite skipnl nextgroup=vimUserCmdAttrs,vimUserCmdName contains=vimBang
670
671syn region vimUserCmdAttrs contained
672 \ start="-\l"
673 \ start=+^\s*\%(\\\|["#]\\ \)+
674 \ end="\ze\s\u"
675 \ skipwhite nextgroup=vimUserCmdName
676 \ contains=@vimContinue,vimUserCmdAttr,vimUserCmdAttrError
677 \ transparent
678syn match vimUserCmdAttrError contained "-\a\+\ze\%(\s\|=\)"
679syn match vimUserCmdAttr contained "-addr=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrAddr
680syn match vimUserCmdAttr contained "-bang\>" contains=vimUserCmdAttrKey
681syn match vimUserCmdAttr contained "-bar\>" contains=vimUserCmdAttrKey
682syn match vimUserCmdAttr contained "-buffer\>" contains=vimUserCmdAttrKey
683syn match vimUserCmdAttr contained "-complete=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrComplete,vimUserCmdError
684syn match vimUserCmdAttr contained "-count\>" contains=vimUserCmdAttrKey
685syn match vimUserCmdAttr contained "-count=" contains=vimUserCmdAttrKey nextgroup=vimNumber
686syn match vimUserCmdAttr contained "-keepscript\>" contains=vimUserCmdAttrKey
687syn match vimUserCmdAttr contained "-nargs=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrNargs
688syn match vimUserCmdAttr contained "-range\>" contains=vimUserCmdAttrKey
689syn match vimUserCmdAttr contained "-range=" contains=vimUserCmdAttrKey nextgroup=vimNumber,vimUserCmdAttrRange
690syn match vimUserCmdAttr contained "-register\>" contains=vimUserCmdAttrKey
Doug Kearns3c07eb02024-09-02 10:03:37 +0200691
692syn match vimUserCmdAttrNargs contained "[01*?+]"
693syn match vimUserCmdAttrRange contained "%"
694
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100695if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_nousercmderror")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100696 syn match vimUserCmdError contained "\S\+\>"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000697endif
Bram Moolenaara93fa7e2006-04-17 22:14:47 +0000698
Doug Kearns3c07eb02024-09-02 10:03:37 +0200699syn case ignore
700syn keyword vimUserCmdAttrKey contained a[ddr] ban[g] bar bu[ffer] com[plete] cou[nt] k[eepscript] n[args] ra[nge] re[gister]
Doug Kearns520a2c72025-04-08 20:50:00 +0200701
702" GEN_SYN_VIM: vimUserCmdAttrComplete, START_STR='syn keyword vimUserCmdAttrComplete contained', END_STR=''
703syn 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 var
704syn 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 var
705syn keyword vimUserCmdAttrComplete contained custom customlist nextgroup=vimUserCmdAttrCompleteFunc,vimUserCmdError
706syn match vimUserCmdAttrCompleteFunc contained ",\%([bwglstav]:\|<[sS][iI][dD]>\)\=\h\w*\%([.#]\h\w*\)*"hs=s+1 nextgroup=vimUserCmdError contains=vimVarScope,vimFuncSID
707
Doug Kearns3c07eb02024-09-02 10:03:37 +0200708" GEN_SYN_VIM: vimUserCmdAttrAddr, START_STR='syn keyword vimUserCmdAttrAddr contained', END_STR=''
709syn keyword vimUserCmdAttrAddr contained arguments arg buffers buf lines line loaded_buffers load other quickfix qf tabs tab windows win
Doug Kearns520a2c72025-04-08 20:50:00 +0200710syn keyword vimUserCmdAttrAddr contained arguments arg buffers buf lines line loaded_buffers load other quickfix qf tabs tab windows win
711syn match vimUserCmdAttrAddr contained "?"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000712syn case match
Bram Moolenaar071d4272004-06-13 20:20:40 +0000713
Doug Kearns520a2c72025-04-08 20:50:00 +0200714syn match vimUserCmdName contained "\<\u[[:alnum:]]*\>" skipwhite nextgroup=vimUserCmdBlock,vimUserCmdReplacement
715syn match vimUserCmdName contained +\<\u[[:alnum:]]*\>\ze\s*\n\s*\%(\\\|["#]\\ \)+ skipwhite skipnl nextgroup=vimUserCmdBlock,vimUserCmdReplacement
716syn region vimUserCmdReplacement contained
717 \ start="\S"
718 \ start=+^\s*\%(\\\|["#]\\ \)+
719 \ skip=+\n\s*\%(\\\|["#]\\ \)+
720 \ end="$"
721 \ contains=@vimContinue,@vimUserCmdList,vimComFilter
722syn region vimUserCmdBlock contained
723 \ matchgroup=vimSep
724 \ start="{"
725 \ end="^\s*\zs}"
726 \ contains=@vimDefBodyList
dkearns04e53632024-04-11 06:18:37 +1000727
Doug Kearns520a2c72025-04-08 20:50:00 +0200728syn match vimDelcommand "\<delc\%[ommand]\>" skipwhite nextgroup=vimDelcommandAttr,vimDelcommandName
729syn match vimDelcommandAttr contained "-buffer\>" skipwhite nextgroup=vimDelcommandName
730syn match vimDelcommandName contained "\<\u[[:alnum:]]*\>"
Doug Kearns3c07eb02024-09-02 10:03:37 +0200731
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000732" Lower Priority Comments: after some vim commands... {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000733" =======================
dkearns959c3c82024-06-12 04:18:08 +1000734if get(g:, "vimsyn_comment_strings", 1)
Doug Kearns35699f12024-09-19 19:51:59 +0200735 syn region vimCommentString contained oneline start='\S\s\+"'ms=e end='"' extend
dkearns959c3c82024-06-12 04:18:08 +1000736endif
dkearns04e53632024-04-11 06:18:37 +1000737
738if s:vim9script
dkearns04e53632024-04-11 06:18:37 +1000739 syn cluster vimComment contains=vim9Comment
740else
dkearns04e53632024-04-11 06:18:37 +1000741 syn cluster vimComment contains=vimComment
742endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000743
Doug Kearns35699f12024-09-19 19:51:59 +0200744VimL syn match vimComment excludenl +\s"[^\-:.%#=*].*$+lc=1 contains=@vimCommentGroup,vimCommentString extend
745VimL syn match vimComment +\<endif\s\+".*$+lc=5 contains=@vimCommentGroup,vimCommentString extend
746VimL syn match vimComment +\<else\s\+".*$+lc=4 contains=@vimCommentGroup,vimCommentString extend
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200747" Vim9 comments - TODO: might be highlighted while they don't work
Doug Kearns35699f12024-09-19 19:51:59 +0200748Vim9 syn match vim9Comment excludenl +\s#[^{].*$+lc=1 contains=@vimCommentGroup,vimCommentString extend
749Vim9 syn match vim9Comment +\<endif\s\+#[^{].*$+lc=5 contains=@vimCommentGroup,vimCommentString extend
750Vim9 syn match vim9Comment +\<else\s\+#[^{].*$+lc=4 contains=@vimCommentGroup,vimCommentString extend
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200751" Vim9 comment inside expression
Doug Kearns35699f12024-09-19 19:51:59 +0200752Vim9 syn match vim9Comment +\s\zs#[^{].*$+ms=s+1 contains=@vimCommentGroup,vimCommentString contained extend
753Vim9 syn match vim9Comment +^\s*#[^{].*$+ contains=@vimCommentGroup,vimCommentString contained extend
754Vim9 syn match vim9Comment +^\s*#$+ contains=@vimCommentGroup,vimCommentString contained extend
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200755
Doug Kearnsfc64ac02024-06-22 11:20:36 +0200756syn match vim9CommentError contained "#.*"
757syn match vimCommentError contained +".*+
758
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000759" Environment Variables: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000760" =====================
Bram Moolenaar5c736222010-01-06 20:54:52 +0100761syn match vimEnvvar "\$\I\i*"
762syn match vimEnvvar "\${\I\i*}"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000763
Doug Kearns68ba6c22025-02-16 16:40:12 +0100764" Strings {{{2
765" =======
766
767" In-String Specials:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000768" Try to catch strings, if nothing else matches (therefore it must precede the others!)
769" vimEscapeBrace handles ["] []"] (ie. "s don't terminate string inside [])
Bram Moolenaar5c736222010-01-06 20:54:52 +0100770syn region vimEscapeBrace oneline contained transparent start="[^\\]\(\\\\\)*\[\zs\^\=\]\=" skip="\\\\\|\\\]" end="]"me=e-1
771syn match vimPatSepErr contained "\\)"
772syn match vimPatSep contained "\\|"
Bram Moolenaarb730f0c2018-11-25 03:56:26 +0100773syn region vimPatSepZone oneline contained matchgroup=vimPatSepZ start="\\%\=\ze(" skip="\\\\" end="\\)\|[^\\]['"]" contains=@vimStringGroup
Bram Moolenaar5c736222010-01-06 20:54:52 +0100774syn region vimPatRegion contained transparent matchgroup=vimPatSepR start="\\[z%]\=(" end="\\)" contains=@vimSubstList oneline
775syn match vimNotPatSep contained "\\\\"
Bram Moolenaar6ba83ba2022-06-12 22:15:57 +0100776syn cluster vimStringGroup contains=vimEscape,vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone,@Spell
Doug Kearns1aa287e2025-02-10 22:00:27 +0100777syn region vimString oneline keepend matchgroup=vimString start=+[^a-zA-Z>\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ nextgroup=vimSubscript contains=@vimStringGroup extend
778syn region vimString oneline matchgroup=vimString start=+[^a-zA-Z>\\@]'+lc=1 end=+'+ nextgroup=vimSubscript contains=vimQuoteEscape extend
Bram Moolenaaracc22402020-06-07 21:07:18 +0200779"syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup " see tst45.vim
Doug Kearns695522d2025-01-10 20:02:17 +0100780
Bram Moolenaar6ba83ba2022-06-12 22:15:57 +0100781syn match vimEscape contained "\\."
dkearnse3e39342024-02-02 07:44:26 +1100782" syn match vimEscape contained +\\[befnrt\"]+
783syn match vimEscape contained "\\\o\{1,3}\|\\[xX]\x\{1,2}\|\\u\x\{1,4}\|\\U\x\{1,8}"
784syn match vimEscape contained "\\<" contains=vimNotation
785syn match vimEscape contained "\\<\*[^>]*>\=>"
Doug Kearns695522d2025-01-10 20:02:17 +0100786syn match vimQuoteEscape contained "''"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000787
Doug Kearns1aa287e2025-02-10 22:00:27 +0100788syn region vimString oneline matchgroup=vimString start=+$'+ skip=+''+ end=+'+ nextgroup=vimSubscript contains=vimQuoteEscape,@vimStringInterpolation extend
789syn region vimString oneline matchgroup=vimString start=+$"+ end=+"+ nextgroup=vimSubscript contains=@vimStringGroup,@vimStringInterpolation extend
dkearnsb1427b42024-02-28 05:59:30 +1100790syn region vimStringInterpolationExpr oneline contained matchgroup=vimSep start=+{+ end=+}+ contains=@vimExprList
791syn match vimStringInterpolationBrace contained "{{"
792syn match vimStringInterpolationBrace contained "}}"
Doug Kearnsd164f2a2024-08-16 21:07:15 +0200793syn cluster vimStringInterpolation contains=vimStringInterpolationExpr,vimStringInterpolationBrace
thincacf8695d2024-01-28 18:57:23 +0100794
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000795" Substitutions: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000796" =============
Bram Moolenaar5c736222010-01-06 20:54:52 +0100797syn cluster vimSubstList contains=vimPatSep,vimPatRegion,vimPatSepErr,vimSubstTwoBS,vimSubstRange,vimNotation
798syn cluster vimSubstRepList contains=vimSubstSubstr,vimSubstTwoBS,vimNotation
799syn cluster vimSubstList add=vimCollection
Doug Kearns92f4e912024-06-05 19:45:43 +0200800syn match vimSubst "^\s*\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)\>" skipwhite nextgroup=vimSubstPat
801syn match vimSubst "^\s*\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)[_#]\@=" skipwhite nextgroup=vimSubstPat
802syn match vimSubst1 contained "\%(s\%[ubstitute]\|sm\%[agic]\>\|sno\%[magic]\)\>" skipwhite nextgroup=vimSubstPat
803syn match vimSubst1 contained "\%(s\%[ubstitute]\|sm\%[agic]\>\|sno\%[magic]\)[_#]\@=" skipwhite nextgroup=vimSubstPat
dkearns2c51e152024-02-27 07:10:18 +1100804" TODO: Vim9 illegal separators for abbreviated :s form are [-.:], :su\%[...] required
805" : # is allowed but "not recommended" (see :h pattern-delimiter)
806syn region vimSubstPat contained matchgroup=vimSubstDelim start="\z([!#$%&'()*+,-./:;<=>?@[\]^_`{}~]\)"rs=s+1 skip="\\\\\|\\\z1" end="\z1"re=e-1,me=e-1 contains=@vimSubstList nextgroup=vimSubstRep4 oneline
807syn region vimSubstRep4 contained matchgroup=vimSubstDelim start="\z(.\)" skip="\\\\\|\\\z1" end="\z1" matchgroup=vimNotation end="<[cC][rR]>" contains=@vimSubstRepList nextgroup=vimSubstFlagErr oneline
808syn region vimCollection contained transparent start="\\\@<!\[" skip="\\\[" end="\]" contains=vimCollClass
809syn match vimCollClassErr contained "\[:.\{-\}:\]"
810syn match vimCollClass contained transparent "\%#=1\[:\(alnum\|alpha\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|xdigit\|retu\%[rn]\|tab\|escape\|backspace\):\]"
811syn match vimSubstSubstr contained "\\z\=\d"
812syn match vimSubstTwoBS contained "\\\\"
813syn match vimSubstFlagErr contained "[^< \t\r|]\+" contains=vimSubstFlags
814syn match vimSubstFlags contained "[&cegiIlnpr#]\+"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000815
Doug Kearns92f4e912024-06-05 19:45:43 +0200816" Vi compatibility
817syn match vimSubstDelim contained "\\"
818syn match vimSubstPat contained "\\\ze[/?&]" contains=vimSubstDelim nextgroup=vimSubstRep4
819
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000820" Marks, Registers, Addresses, Filters: {{{2
dkearns2c51e152024-02-27 07:10:18 +1100821syn match vimMark "'[a-zA-Z0-9]\ze[-+,!]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
Doug Kearnsd8176092024-08-31 16:57:32 +0200822syn match vimMark "'[[\]{}()<>]\ze[-+,!]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
823syn match vimMark ",\zs'[[\]{}()<>]\ze" nextgroup=vimFilter,vimMarkNumber,vimSubst1
dkearns2c51e152024-02-27 07:10:18 +1100824syn match vimMark "[!,:]\zs'[a-zA-Z0-9]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
825syn match vimMark "\<norm\%[al]\s\zs'[a-zA-Z0-9]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
826syn match vimMarkNumber "[-+]\d\+" contained contains=vimOper nextgroup=vimSubst1
Bram Moolenaar5c736222010-01-06 20:54:52 +0100827syn match vimPlainMark contained "'[a-zA-Z0-9]"
Bram Moolenaar6c1e1572019-06-22 02:13:00 +0200828syn match vimRange "[`'][a-zA-Z0-9],[`'][a-zA-Z0-9]" contains=vimMark skipwhite nextgroup=vimFilter
Bram Moolenaar071d4272004-06-13 20:20:40 +0000829
Bram Moolenaarb4ff5182015-11-10 21:15:48 +0100830syn match vimRegister '[^,;[{: \t]\zs"[a-zA-Z0-9.%#:_\-/]\ze[^a-zA-Z_":0-9]'
Bram Moolenaar5c736222010-01-06 20:54:52 +0100831syn match vimRegister '\<norm\s\+\zs"[a-zA-Z0-9]'
832syn match vimRegister '\<normal\s\+\zs"[a-zA-Z0-9]'
833syn match vimRegister '@"'
834syn match vimPlainRegister contained '"[a-zA-Z0-9\-:.%#*+=]'
Doug Kearnsa9c06422025-02-12 20:44:17 +0100835syn match vimLetRegister contained '@["0-9\-a-zA-Z:.%#=*+~_/]'
Bram Moolenaar071d4272004-06-13 20:20:40 +0000836
Bram Moolenaar5c736222010-01-06 20:54:52 +0100837syn match vimAddress ",\zs[.$]" skipwhite nextgroup=vimSubst1
838syn match vimAddress "%\ze\a" skipwhite nextgroup=vimString,vimSubst1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000839
Bram Moolenaar6c1e1572019-06-22 02:13:00 +0200840syn match vimFilter "^!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile
Bram Moolenaard58a3bf2020-09-28 21:48:16 +0200841syn match vimFilter contained "!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile
842syn match vimComFilter contained "|!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile
Bram Moolenaar071d4272004-06-13 20:20:40 +0000843
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100844" Complex Repeats: (:h complex-repeat) {{{2
845" ===============
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100846syn match vimCmplxRepeat '[^a-zA-Z_/\\()]q[0-9a-zA-Z"]\>'lc=1
847syn match vimCmplxRepeat '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\>\)'
Bram Moolenaar071d4272004-06-13 20:20:40 +0000848
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000849" Set command and associated set-options (vimOptions) with comment {{{2
Doug Kearns6bdfeb02025-03-07 18:49:11 +0100850syn match vimSet "\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skipwhite nextgroup=vimSetBang,vimSetArgs
Doug Kearns2a6be832025-04-03 21:39:24 +0200851syn region vimSetComment contained start=+"+ skip=+\n\s*\%(\\\||"\\ \)+ end="$" contains=@vimCommentGroup,vimCommentString extend
852syn match vimSetCmdSep contained "|" skipwhite nextgroup=@vimCmdList,vimSubst1,vimFunc
853syn match vimSetEscape contained "\\\%(\\[|"]\|.\)"
854syn match vimSetBarEscape contained "\\|"
855syn match vimSetQuoteEscape contained +\\"+
856syn region vimSetArgs contained
857 \ start="\S"
858 \ skip=+\n\s*\%(\\\|["#]\\ \)\|^\s*"\\ +
859 \ end=+\ze\\\@1<![|"]+
860 "\ assume this isn't an escaped char with backslash on the previous line
861 \ end=+^\s*\\\ze[|"]+
862 \ end="\ze\s#"
863 \ end="$"
864 \ nextgroup=vimSetCmdSep,vimSetComment,vim9Comment
865 \ contains=@vimContinue,vimErrSetting,vimOption,vimSetAll,vimSetTermcap
866 \ keepend
867syn region vimSetEqual contained
868 \ matchgroup=vimOper
869 \ start="[=:]\|[-+^]="
870 \ skip=+\\\s\|^\s*\%(\\\|["#]\\ \)+
871 \ end="\ze\s"
872 \ contains=@vimContinue,vimCtrlChar,vimEnvvar,vimNotation,vimSetSep,vimSetEscape,vimSetBarEscape,vimSetQuoteEscape
Doug Kearnsddbb6fe2024-07-24 20:21:22 +0200873syn match vimSetBang contained "\a\@1<=!" skipwhite nextgroup=vimSetAll,vimSetTermcap
874syn keyword vimSetAll contained all nextgroup=vimSetMod
875syn keyword vimSetTermcap contained termcap
Bram Moolenaar4072ba52020-12-23 13:56:35 +0100876syn match vimSetSep contained "[,:]"
Doug Kearnsddbb6fe2024-07-24 20:21:22 +0200877syn match vimSetMod contained "\a\@1<=\%(&vim\=\|[!&?<]\)"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000878
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200879" Variable Declarations: {{{2
880" =====================
Doug Kearns1aa287e2025-02-10 22:00:27 +0100881VimL syn keyword vimLet let skipwhite nextgroup=@vimSpecialVar,vimVar,vimVarList
882VimL syn keyword vimConst cons[t] skipwhite nextgroup=@vimSpecialVar,vimVar,vimVarList
883syn region vimVarList contained
884 \ start="\[" end="]"
885 \ contains=@vimContinue,@vimSpecialVar,vimVar
dkearnsf6869212023-12-11 01:53:24 +1100886
Doug Kearns1aa287e2025-02-10 22:00:27 +0100887VimL syn keyword vimUnlet unl[et] skipwhite nextgroup=vimUnletBang,vimUnletVars
888syn match vimUnletBang contained "\a\@1<=!" skipwhite nextgroup=vimUnletVars
889syn region vimUnletVars contained
890 \ start="$\I\|\h" skip=+\n\s*\\\|\n\s*"\\ \|^\s*"\\ + end="$" end="\ze[|"]"
891 \ nextgroup=vimCmdSep,vimComment
Doug Kearns3dca5122025-03-09 16:30:28 +0100892 \ contains=@vimContinue,vimEnvvar,vimVar,vimVimVar
dkearnsf6869212023-12-11 01:53:24 +1100893
Doug Kearns7884cc72024-08-23 18:01:35 +0200894VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='\%(^\z(\s*\)\S.*\)\@<==<<\s*trim\%(\s\+\)\@>\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\z1\=\z2$' extend
Ken Takata95e90782024-08-22 21:29:39 +0200895VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='=<<\%(\s*\)\@>\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\z1$' extend
Doug Kearns7884cc72024-08-23 18:01:35 +0200896VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='\%(^\z(\s*\)\S.*\)\@<==<<\s*\%(trim\s\+eval\|eval\s\+trim\)\%(\s\+\)\@>\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\z1\=\z2$' contains=@vimStringInterpolation extend
Ken Takata95e90782024-08-22 21:29:39 +0200897VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='=<<\s*eval\%(\s\+\)\@>\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\z1$' contains=@vimStringInterpolation extend
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200898
899Vim9 syn keyword vim9Const const skipwhite nextgroup=vim9Variable,vim9VariableList
900Vim9 syn keyword vim9Final final skipwhite nextgroup=vim9Variable,vim9VariableList
901Vim9 syn keyword vim9Var var skipwhite nextgroup=vim9Variable,vim9VariableList
902
Doug Kearns818c6412024-10-06 17:00:48 +0200903syn match vim9Variable contained "\<\h\w*\>" skipwhite nextgroup=vimTypeSep,vimLetHereDoc,vimOper
Doug Kearns1aa287e2025-02-10 22:00:27 +0100904syn region vim9VariableList contained start="\[" end="]" contains=@vimContinue,@vimSpecialVar,vim9Variable
905
906" Lockvar and Unlockvar: {{{2
907" =====================
908syn keyword vimLockvar lockv[ar] skipwhite nextgroup=vimLockvarBang,vimLockvarDepth,vimLockvarVars
909syn keyword vimUnlockvar unlo[ckvar] skipwhite nextgroup=vimLockvarBang,vimLockvarDepth,vimLockvarVars
910syn match vimLockvarBang contained "\a\@1<=!" skipwhite nextgroup=vimLockvarVars
911syn match vimLockvarDepth contained "\<[0-3]\>" skipwhite nextgroup=vimLockvarVars
912syn region vimLockvarVars contained
913 \ start="\h" skip=+\n\s*\\\|\n\s*"\\ \|^\s*"\\ + end="$" end="\ze[|"]"
914 \ nextgroup=vimCmdSep,vimComment
915 \ contains=@vimContinue,vimVar
916
917hi def link vimLockvar vimCommand
918hi def link vimUnlockvar vimCommand
919hi def link vimLockvarBang vimBang
920hi def link vimLockvarDepth vimNumber
Bram Moolenaar071d4272004-06-13 20:20:40 +0000921
dkearnsf6869212023-12-11 01:53:24 +1100922" For: {{{2
923" ===
Doug Kearns1aa287e2025-02-10 22:00:27 +0100924" handles Vim9 and legacy for now
925syn region vimFor
926 \ matchgroup=vimCommand
927 \ start="\<for\>" end="\<in\>"
928 \ skipwhite skipnl nextgroup=@vimForInContinue,vim9ForInComment,@vimExprList
929 \ contains=@vimContinue,vimVar,vimVarList,vim9VariableList
930 \ transparent
931
932syn match vim9ForInComment contained "#.*" skipwhite skipempty nextgroup=vimForInComment,@vimExprList
933
934syn match vimForInContinue contained "^\s*\zs\\" skipwhite skipnl nextgroup=@vimForInContinue,@vimExprList
935syn match vimForInContinueComment contained '^\s*\zs["#]\\ .*' skipwhite skipnl nextgroup=@vimForInContinue,@vimExprList
936syn cluster vimForInContinue contains=vimForInContinue,vimForInContinueComment
dkearns76d62982024-03-23 05:55:25 +1100937
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100938" Abbreviations: {{{2
Bram Moolenaare37d50a2008-08-06 17:06:04 +0000939" =============
h-east9b53c052024-02-13 21:09:22 +0100940" GEN_SYN_VIM: vimCommand abbrev, START_STR='syn keyword vimAbb', END_STR='skipwhite nextgroup=vimMapMod,vimMapLhs'
dkearns16249702024-02-23 05:45:05 +1100941syn keyword vimAbb ab[breviate] ca[bbrev] cnorea[bbrev] cuna[bbrev] ia[bbrev] inorea[bbrev] iuna[bbrev] norea[bbrev] una[bbreviate] skipwhite nextgroup=vimMapMod,vimMapLhs
dkearns982e1912024-03-28 20:06:03 +1100942" GEN_SYN_VIM: vimCommand abclear, START_STR='syn keyword vimAbb', END_STR='skipwhite nextgroup=vimMapMod'
943syn keyword vimAbb abc[lear] cabc[lear] iabc[lear] skipwhite nextgroup=vimMapMod
Bram Moolenaare37d50a2008-08-06 17:06:04 +0000944
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100945" Autocmd: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000946" =======
Doug Kearns1718e7d2025-01-08 18:20:47 +0100947syn match vimAutoCmdBang contained "\a\@1<=!" skipwhite nextgroup=vimAutoEventList
948syn match vimAutoEventList contained "\%(\a\+,\)*\a\+" contains=vimAutoEvent nextgroup=vimAutoCmdSpace
Bram Moolenaar5c736222010-01-06 20:54:52 +0100949syn match vimAutoCmdSpace contained "\s\+" nextgroup=vimAutoCmdSfxList
dkearns04e53632024-04-11 06:18:37 +1000950syn match vimAutoCmdSfxList contained "\S*" skipwhite nextgroup=vimAutoCmdMod,vimAutoCmdBlock
Doug Kearns1718e7d2025-01-08 18:20:47 +0100951syn keyword vimAutoCmd au[tocmd] skipwhite nextgroup=vimAutoCmdBang,vimAutoEventList
952syn keyword vimAutoCmd do[autocmd] doautoa[ll] skipwhite nextgroup=vimAutoEventList
dkearns04e53632024-04-11 06:18:37 +1000953syn match vimAutoCmdMod "\(++\)\=\(once\|nested\)" skipwhite nextgroup=vimAutoCmdBlock
Doug Kearns1aa287e2025-02-10 22:00:27 +0100954syn region vimAutoCmdBlock contained matchgroup=vimSep start="{" end="^\s*\zs}" contains=@vimDefBodyList
Bram Moolenaar071d4272004-06-13 20:20:40 +0000955
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100956" Echo And Execute: -- prefer strings! {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000957" ================
dkearns61887b32024-03-15 23:45:48 +1100958" NOTE: No trailing comments
dkearnsb1427b42024-02-28 05:59:30 +1100959
dkearns61887b32024-03-15 23:45:48 +1100960syn region vimEcho
961 \ matchgroup=vimCommand
962 \ start="\<ec\%[ho]\>"
963 \ start="\<echoe\%[rr]\>"
964 \ start="\<echom\%[sg]\>"
965 \ start="\<echoc\%[onsole]\>"
966 \ start="\<echon\>"
967 \ start="\<echow\%[indow]\>"
968 \ skip=+\\|\|\n\s*\\\|\n\s*"\\ +
969 \ matchgroup=vimCmdSep end="|" excludenl end="$" contains=@vimContinue,@vimExprList transparent
970
971syn match vimEchohl "\<echohl\=\>" skipwhite nextgroup=vimGroup,vimHLGroup,vimEchohlNone
Bram Moolenaar071d4272004-06-13 20:20:40 +0000972syn case ignore
dkearns61887b32024-03-15 23:45:48 +1100973syn keyword vimEchohlNone contained none
Bram Moolenaar071d4272004-06-13 20:20:40 +0000974syn case match
975
dkearns35e6f4c2024-03-22 06:41:10 +1100976syn cluster vimEcho contains=vimEcho,vimEchohl
dkearns61887b32024-03-15 23:45:48 +1100977
978syn region vimExecute matchgroup=vimCommand start="\<exe\%[cute]\>" skip=+\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|" excludenl end="$" contains=@vimContinue,@vimExprList transparent
dkearnsb1427b42024-02-28 05:59:30 +1100979
Doug Kearns9b171bd2025-04-10 19:59:22 +0200980" Filter: {{{2
981" ======
982syn match vimExFilter "\<filt\%[er]\>" skipwhite nextgroup=vimExFilterBang,vimExFilterPattern
983syn match vimExFilterBang contained "\a\@1<=!" skipwhite nextgroup=vimExFilterPattern
984syn region vimExFilterPattern contained
985 \ start="[[:ident:]]"
986 \ end="\ze[[:space:]\n]"
987 \ skipwhite nextgroup=@vimCmdList
988 \ contains=@vimSubstList
989 \ oneline
990syn region vimExFilterPattern contained
991 \ matchgroup=Delimiter
992 \ start="\z([^[:space:][:ident:]|"]\)"
993 \ skip="\\\\\|\\\z1"
994 \ end="\z1"
995 \ skipwhite nextgroup=@vimCmdList
996 \ contains=@vimSubstList
997 \ oneline
998
999" Grep and Make: {{{2
1000" =============
1001" | is the command separator, escaped with \| all other backslashes are passed through literally, no tail comments
1002syn match vimGrep "\<l\=gr\%[ep]\>" skipwhite nextgroup=vimGrepBang,vimGrepArgs,vimCmdSep
1003syn match vimGrepadd "\<l\=grepa\%[dd]\>" skipwhite nextgroup=vimGrepBang,vimGrepArgs,vimCmdSep
1004syn region vimGrepArgs contained
1005 \ start="|\@!\S"
1006 \ skip=+\n\s*\%(\\\|[#"]\\ \)+
1007 \ matchgroup=vimCmdSep
1008 \ end="|"
1009 \ end="$"
1010 "\ TODO: include vimSpecFile
1011 \ contains=vimGrepBarEscape
1012syn match vimGrepBarEscape contained "\\|"
1013syn match vimGrepBang contained "\a\@1<=!" skipwhite nextgroup=vimGrepArgs,vimCmdSep
1014
1015syn match vimMake "\<l\=make\=\>" skipwhite nextgroup=vimMakeBang,vimMakeArgs,vimCmdSep
1016syn region vimMakeArgs contained
1017 \ start="|\@!\S"
1018 \ skip=+\n\s*\%(\\\|[#"]\\ \)+
1019 \ matchgroup=vimCmdSep
1020 \ end="|"
1021 \ end="$"
1022 "\ TODO: include vimSpecFile
1023 \ contains=vimMakeBarEscape
1024syn match vimMakeBarEscape contained "\\|"
1025syn match vimMakeBang contained "\a\@1<=!" skipwhite nextgroup=vimMakeArgs,vimCmdSep
1026
1027syn match vimHelpgrep "\<l\=helpg\%[rep]\>" skipwhite nextgroup=vimHelpgrepBang,vimHelpgrepPattern
1028syn region vimHelpgrepPattern contained
1029 \ start="\S"
1030 \ matchgroup=Special
1031 \ end="@\w\w\>"
1032 \ end="$"
1033 \ contains=@vimSubstList
1034 \ oneline
1035
1036" Vimgrep: {{{2
1037" =======
1038syn match vimVimgrep "\<l\=vim\%[grep]\>" skipwhite nextgroup=vimVimgrepBang,vimVimgrepPattern
1039syn match vimVimgrepadd "\<l\=vimgrepa\%[dd]\>" skipwhite nextgroup=vimVimgrepBang,vimVimgrepPattern
1040syn match vimVimgrepBang contained "\a\@1<=!" skipwhite nextgroup=vimVimgrepPattern
1041syn region vimVimgrepPattern contained
1042 \ start="[[:ident:]]"
1043 \ end="\ze[[:space:]\n]"
1044 \ skipwhite nextgroup=vimVimgrepFile,vimCmdSep
1045 \ contains=@vimSubstList
1046 \ oneline
1047syn region vimVimgrepPattern contained
1048 \ matchgroup=Delimiter
1049 \ start="\z([^[:space:][:ident:]|"]\)"
1050 \ skip="\\\\\|\\\z1"
1051 \ end="\z1"
1052 \ skipwhite nextgroup=vimVimgrepFlags,vimVimgrepFile,vimCmdSep
1053 \ contains=@vimSubstList
1054 \ oneline
1055syn match vimVimgrepEscape contained "\\\%(\\|\|.\)"
1056syn match vimVimgrepBarEscape contained "\\|"
1057syn region vimVimgrepFile contained
1058 \ start="|\@!\S"
1059 \ matchgroup=vimCmdSep
1060 \ end="|"
1061 \ end="\ze\s"
1062 \ end="$"
1063 \ skipwhite nextgroup=vimVimgrepFile
1064 \ contains=vimSpecFile,vimVimgrepEscape,vimVimgrepBarEscape
1065syn match vimVimgrepFlags contained "\<[gjf]\{,3\}\>" skipwhite nextgroup=vimVimgrepfile
1066
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001067" Maps: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001068" ====
Doug Kearns99984fc2024-07-18 20:45:19 +02001069" GEN_SYN_VIM: vimCommand map, START_STR='syn keyword vimMap', END_STR='skipwhite nextgroup=vimMapMod,vimMapLhs'
1070syn keyword vimMap cm[ap] cno[remap] im[ap] ino[remap] lm[ap] ln[oremap] nm[ap] nn[oremap] om[ap] ono[remap] smap snor[emap] tma[p] tno[remap] vm[ap] vn[oremap] xm[ap] xn[oremap] skipwhite nextgroup=vimMapMod,vimMapLhs
1071syn match vimMap "\<map\>" skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
1072syn keyword vimMap no[remap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
dkearns16249702024-02-23 05:45:05 +11001073" GEN_SYN_VIM: vimCommand mapclear, START_STR='syn keyword vimMap', END_STR='skipwhite nextgroup=vimMapMod'
1074syn keyword vimMap cmapc[lear] imapc[lear] lmapc[lear] nmapc[lear] omapc[lear] smapc[lear] tmapc[lear] vmapc[lear] xmapc[lear] skipwhite nextgroup=vimMapMod
Doug Kearns99984fc2024-07-18 20:45:19 +02001075syn keyword vimMap mapc[lear] skipwhite nextgroup=vimMapBang,vimMapMod
1076" GEN_SYN_VIM: vimCommand unmap, START_STR='syn keyword vimUnmap', END_STR='skipwhite nextgroup=vimMapMod,vimMapLhs'
1077syn keyword vimUnmap cu[nmap] iu[nmap] lu[nmap] nun[map] ou[nmap] sunm[ap] tunma[p] vu[nmap] xu[nmap] skipwhite nextgroup=vimMapMod,vimMapLhs
1078syn keyword vimUnmap unm[ap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
1079
Doug Kearns6bdfeb02025-03-07 18:49:11 +01001080syn match vimMapLhs contained "\%(.\|\S\)\+" contains=vimCtrlChar,vimNotation,vimMapLeader skipwhite nextgroup=vimMapRhs
1081syn match vimMapLhs contained "\%(.\|\S\)\+\ze\s*$" contains=vimCtrlChar,vimNotation,vimMapLeader skipwhite skipnl nextgroup=vimMapRhsContinue
dkearns5d67aef2024-03-10 04:01:22 +11001082syn match vimMapBang contained "\a\@1<=!" skipwhite nextgroup=vimMapMod,vimMapLhs
Doug Kearns6bdfeb02025-03-07 18:49:11 +01001083syn match vimMapMod contained "\%#=1<\%(buffer\|expr\|nowait\|script\|silent\|special\|unique\)\+>" contains=vimMapModKey,vimMapModErr skipwhite nextgroup=vimMapMod,vimMapLhs
1084syn region vimMapRhs contained start="\S" skip=+\\|\|\@1<=|\|\n\s*\\\|\n\s*"\\ + end="|" end="$" contains=@vimContinue,vimCtrlChar,vimNotation,vimMapLeader skipnl nextgroup=vimMapRhsContinue
dkearns5d67aef2024-03-10 04:01:22 +11001085" assume a continuation comment introduces the RHS
Doug Kearns6bdfeb02025-03-07 18:49:11 +01001086syn region vimMapRhsContinue contained start=+^\s*\%(\\\|"\\ \)+ skip=+\\|\|\@1<=|\|\n\s*\\\|\n\s*"\\ + end="|" end="$" contains=@vimContinue,vimCtrlChar,vimNotation,vimMapLeader
1087syn match vimMapLeader contained "\%#=1\c<\%(local\)\=leader>" contains=vimMapLeaderKey
1088syn keyword vimMapModKey contained buffer expr nowait script silent special unique
Bram Moolenaar071d4272004-06-13 20:20:40 +00001089syn case ignore
Doug Kearns6bdfeb02025-03-07 18:49:11 +01001090syn keyword vimMapLeaderKey contained leader localleader
Bram Moolenaar071d4272004-06-13 20:20:40 +00001091syn case match
1092
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001093" Menus: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001094" =====
dkearns62b26042024-03-10 03:43:28 +11001095" NOTE: tail comments disallowed
1096" GEN_SYN_VIM: vimCommand menu, START_STR='syn keyword vimMenu', END_STR='skipwhite nextgroup=vimMenuBang,vimMenuMod,vimMenuName,vimMenuPriority,vimMenuStatus'
1097syn keyword vimMenu am[enu] an[oremenu] aun[menu] cme[nu] cnoreme[nu] cunme[nu] ime[nu] inoreme[nu] iunme[nu] me[nu] nme[nu] nnoreme[nu] noreme[nu] nunme[nu] ome[nu] onoreme[nu] ounme[nu] sme[nu] snoreme[nu] sunme[nu] tlm[enu] tln[oremenu] tlu[nmenu] tm[enu] tu[nmenu] unme[nu] vme[nu] vnoreme[nu] vunme[nu] xme[nu] xnoreme[nu] xunme[nu] skipwhite nextgroup=vimMenuBang,vimMenuMod,vimMenuName,vimMenuPriority,vimMenuStatus
1098syn keyword vimMenu popu[p] skipwhite nextgroup=vimMenuBang,vimMenuName
1099syn region vimMenuRhs contained contains=@vimContinue,vimNotation start="|\@!\S" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + end="$" matchgroup=vimSep end="|"
1100syn region vimMenuRhsContinue contained contains=@vimContinue,vimNotation start=+^\s*\%(\\\|"\\ \)+ skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + end="$" matchgroup=vimSep end="|"
dkearnsec21baf2024-03-20 04:04:42 +11001101syn match vimMenuName "\.\@!\%(\\\s\|\S\)\+" contained contains=vimMenuNotation,vimNotation skipwhite nextgroup=vimCmdSep,vimMenuRhs
1102syn match vimMenuName "\.\@!\%(\\\s\|\S\)\+\ze\s*$" contained contains=vimMenuNotation,vimNotation skipwhite skipnl nextgroup=vimCmdSep,vimMenuRhsContinue
dkearns62b26042024-03-10 03:43:28 +11001103syn match vimMenuNotation "&\a\|&&\|\\\s\|\\\." contained
1104syn match vimMenuPriority "\<\d\+\%(\.\d\+\)*\>" contained skipwhite nextgroup=vimMenuName
1105syn match vimMenuMod "\c<\%(script\|silent\|special\)>" contained skipwhite nextgroup=vimMenuName,vimMenuPriority,vimMenuMod contains=vimMapModKey,vimMapModErr
1106syn keyword vimMenuStatus enable disable nextgroup=vimMenuName skipwhite
1107syn match vimMenuBang "\a\@1<=!" contained skipwhite nextgroup=vimMenuName,vimMenuMod
1108
1109syn region vimMenutranslate
1110 \ matchgroup=vimCommand start="\<menut\%[ranslate]\>"
1111 \ skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ +
1112 \ end="$" matchgroup=vimCmdSep end="|" matchgroup=vimMenuClear end="\<clear\ze\s*\%(["#|]\|$\)"
1113 \ contains=@vimContinue,vimMenutranslateName keepend transparent
1114" oneline is sufficient to match the current formatting in runtime/lang/*.vim
1115syn match vimMenutranslateName "\%(\\\s\|\S\)\+" contained contains=vimMenuNotation,vimNotation
1116syn match vimMenutranslateComment +".*+ contained containedin=vimMenutranslate
Bram Moolenaar071d4272004-06-13 20:20:40 +00001117
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001118" Angle-Bracket Notation: (tnx to Michael Geddes) {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001119" ======================
1120syn case ignore
Doug Kearns68ba6c22025-02-16 16:40:12 +01001121syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd]-\)\{0,4}x\=\%(f\d\{1,2}\|[^ \t:]\|space\|bar\|bslash\|nl\|newline\|lf\|linefeed\|cr\|retu\%[rn]\|enter\|k\=del\%[ete]\|bs\|backspace\|tab\|esc\|csi\|right\|paste\%(start\|end\)\|left\|help\|undo\|k\=insert\|ins\|mouse\|[kz]\=home\|[kz]\=end\|kplus\|kminus\|kdivide\|kmultiply\|kenter\|kpoint\|space\|k\=\%(page\)\=\%(\|down\|up\|k\d\>\)\)>" contains=vimBracket
dkearnse3e39342024-02-02 07:44:26 +11001122
Doug Kearns68ba6c22025-02-16 16:40:12 +01001123syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}\%(net\|dec\|jsb\|pterm\|urxvt\|sgr\)mouse>" contains=vimBracket
1124syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}\%(left\|middle\|right\)\%(mouse\|drag\|release\)>" contains=vimBracket
1125syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}left\%(mouse\|release\)nm>" contains=vimBracket
1126syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}x[12]\%(mouse\|drag\|release\)>" contains=vimBracket
1127syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}sgrmouserelease>" contains=vimBracket
1128syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}mouse\%(up\|down\|move\)>" contains=vimBracket
1129syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}scrollwheel\%(up\|down\|right\|left\)>" contains=vimBracket
dkearnse3e39342024-02-02 07:44:26 +11001130
Doug Kearns68ba6c22025-02-16 16:40:12 +01001131syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%(sid\|nop\|nul\|lt\|drop\)>" contains=vimBracket
1132syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%(snr\|plug\|cursorhold\|ignore\|cmd\|scriptcmd\|focus\%(gained\|lost\)\)>" contains=vimBracket
1133syn match vimNotation contained '\%(\\\|<lt>\)\=<C-R>[0-9a-z"%#:.\-=]'he=e-1 contains=vimBracket
1134syn match vimNotation contained '\%#=1\%(\\\|<lt>\)\=<\%(q-\)\=\%(line[12]\|count\|bang\|reg\|args\|mods\|f-args\|f-mods\|lt\)>' contains=vimBracket
1135syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([cas]file\|abuf\|amatch\|cexpr\|cword\|cWORD\|client\|stack\|script\|sf\=lnum\)>" contains=vimBracket
1136syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd]-\)\{0,4}char-\%(\d\+\|0\o\+\|0x\x\+\)>" contains=vimBracket
dkearnse3e39342024-02-02 07:44:26 +11001137
Bram Moolenaar5c736222010-01-06 20:54:52 +01001138syn match vimBracket contained "[\\<>]"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001139syn case match
1140
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001141" User Function Highlighting: {{{2
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00001142" (following Gautam Iyer's suggestion)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001143" ==========================
Doug Kearns1aa287e2025-02-10 22:00:27 +01001144syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" skipwhite nextgroup=vimOperParen contains=vimFuncEcho,vimFuncName,vimUserFunc,vimExecute
1145syn match vimUserFunc contained "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\<if\>" contains=vimNotation,vim9MethodName,vim9Super,vim9This
dkearnsb4b3d7d2024-03-16 04:53:53 +11001146syn keyword vimFuncEcho contained ec ech echo
1147
Doug Kearns99984fc2024-07-18 20:45:19 +02001148syn match vimMap "\<map\%(\s\+(\)\@=" skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
1149
Bram Moolenaar2547aa92020-07-26 17:00:44 +02001150" User Command Highlighting: {{{2
Bram Moolenaard2ea7cf2021-05-30 20:54:13 +02001151syn match vimUsrCmd '^\s*\zs\u\%(\w*\)\@>\%([(#[]\|\s\+\%([-+*/%]\=\|\.\.\)=\)\@!'
Bram Moolenaar2547aa92020-07-26 17:00:44 +02001152
Doug Kearns025dc482025-02-23 15:48:52 +01001153" Vim user commands
1154
1155" Compiler plugins
Doug Kearns6bdfeb02025-03-07 18:49:11 +01001156syn match vimCompilerSet "\<CompilerSet\>" skipwhite nextgroup=vimSetArgs
Doug Kearns025dc482025-02-23 15:48:52 +01001157
1158" runtime/makemenu.vim
1159syn match vimSynMenu "\<SynMenu\>" skipwhite nextgroup=vimSynMenuPath
1160syn match vimSynMenuPath contained ".*\ze:" nextgroup=vimSynMenuColon contains=vimMenuNotation
1161syn match vimSynMenuColon contained ":" nextgroup=vimSynMenuName
1162syn match vimSynMenuName contained "\w\+"
1163
1164syn cluster vimExUserCmdList contains=vimCompilerSet,vimSynMenu
1165
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00001166" Errors And Warnings: {{{2
1167" ====================
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001168if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimfunctionerror")
Doug Kearns818c6412024-10-06 17:00:48 +02001169 syn match vimFunctionError "\s\zs[a-z0-9]\i\{-}\ze\s*(" contained contains=vimFuncKey,vimFuncBlank
Bram Moolenaar6c1e1572019-06-22 02:13:00 +02001170 syn match vimFunctionError "\s\zs\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\d\i\{-}\ze\s*(" contained contains=vimFuncKey,vimFuncBlank
Bram Moolenaar5c736222010-01-06 20:54:52 +01001171 syn match vimElseIfErr "\<else\s\+if\>"
1172 syn match vimBufnrWarn /\<bufnr\s*(\s*["']\.['"]\s*)/
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00001173endif
1174
Doug Kearns68ba6c22025-02-16 16:40:12 +01001175syn match vimNotFunc "\%#=1\<\%(if\|el\%[seif]\|retu\%[rn]\|while\)\>" skipwhite nextgroup=@vimExprList,vimNotation
Bram Moolenaar6c1e1572019-06-22 02:13:00 +02001176
Doug Kearnse85fdc72024-07-07 20:45:37 +02001177" Match: {{{2
1178" =====
1179syn match vimMatch "\<[23]\=mat\%[ch]\>" skipwhite nextgroup=vimMatchGroup,vimMatchNone
1180syn match vimMatchGroup contained "[[:alnum:]._-]\+" skipwhite nextgroup=vimMatchPattern
1181syn case ignore
1182syn keyword vimMatchNone contained none
1183syn case match
1184syn region vimMatchPattern contained matchgroup=Delimiter start="\z([!#$%&'()*+,-./:;<=>?@[\]^_`{}~]\)" skip="\\\\\|\\\z1" end="\z1" contains=@vimSubstList oneline
1185
Doug Kearnsbbe52522024-11-09 19:11:25 +01001186" Normal: {{{2
1187" ======
1188syn match vimNormal "\<norm\%[al]\>!\=" skipwhite nextgroup=vimNormalArg contains=vimBang
1189syn region vimNormalArg contained start="\S" skip=+\n\s*\\\|\n\s*["#]\\ + end="$" contains=@vimContinue
Bram Moolenaar05159a02005-02-26 23:04:13 +00001190
Doug Kearns2f5a8c02025-04-05 15:55:36 +02001191" Redir: {{{2
1192" =====
1193syn match vimRedir "\<redir\=\>" skipwhite nextgroup=vimRedirBang,vimRedirFileOperator,vimRedirVariableOperator,vimRedirRegister,vimRedirEnd
1194syn match vimRedirBang contained "\a\@1<=!" skipwhite nextgroup=vimRedirFileOperator
1195
1196syn match vimRedirFileOperator contained ">>\=" skipwhite nextgroup=vimRedirFile
1197syn region vimRedirFile contained
1198 \ start="\S"
1199 \ matchgroup=Normal
1200 \ end="\s*$"
1201 \ end="\s*\ze[|"]"
1202 \ nextgroup=vimCmdSep,vimComment
1203 \ contains=vimSpecFile
1204syn match vimRedirRegisterOperator contained ">>\="
1205syn match vimRedirRegister contained "@[a-zA-Z*+"]" nextgroup=vimRedirRegisterOperator
1206syn match vimRedirVariableOperator contained "=>>\=" skipwhite nextgroup=vimVar
1207syn keyword vimRedirEnd contained END
1208
Doug Kearns262e25e2024-06-14 20:16:35 +02001209" Sleep: {{{2
1210" =====
1211syn keyword vimSleep sl[eep] skipwhite nextgroup=vimSleepBang,vimSleepArg
1212syn match vimSleepBang contained "\a\@1<=!" skipwhite nextgroup=vimSleepArg
1213syn match vimSleepArg contained "\<\%(\d\+\)\=m\=\>"
1214
Doug Kearns9b171bd2025-04-10 19:59:22 +02001215" Sort: {{{2
1216" ====
1217syn match vimSort "\<sort\=\>" skipwhite nextgroup=vimSortBang,@vimSortOptions,vimSortPattern,vimCmdSep
1218syn match vimSortBang contained "\a\@1<=!" skipwhite nextgroup=@vimSortOptions,vimSortPattern,vimCmdSep
1219syn match vimSortOptionsError contained "\a\+"
1220syn match vimSortOptions contained "\<[ilur]*[nfxob]\=[ilur]*\>" skipwhite nextgroup=vimSortPattern,vimCmdSep
1221syn region vimSortPattern contained
1222 \ matchgroup=Delimiter
1223 \ start="\z([^[:space:][:alpha:]|]\)"
1224 \ skip="\\\\\|\\\z1"
1225 \ end="\z1"
1226 \ skipwhite nextgroup=@vimSortOptions,vimCmdSep
1227 \ contains=@vimSubstList
1228 \ oneline
1229
1230syn cluster vimSortOptions contains=vimSortOptions,vimSortOptionsError
1231
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001232" Syntax: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001233"=======
dkearns21ce1592024-01-29 04:54:08 +11001234syn match vimGroupList contained "[^[:space:],]\+\%(\s*,\s*[^[:space:],]\+\)*" contains=vimGroupSpecial
1235syn region vimGroupList contained start=/^\s*["#]\\ \|^\s*\\\|[^[:space:],]\+\s*,/ skip=/\s*\n\s*\\\|\s*\n\s*["#]\\ \|^\s*\\\|^\s*["#]\\ / end=/[^[:space:],]\s*$\|[^[:space:],]\ze\s\+\w/ contains=@vimContinue,vimGroupSpecial
1236syn keyword vimGroupSpecial contained ALL ALLBUT CONTAINED TOP
1237
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001238if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsynerror")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001239 syn match vimSynError contained "\i\+"
1240 syn match vimSynError contained "\i\+=" nextgroup=vimGroupList
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001241endif
dkearns21ce1592024-01-29 04:54:08 +11001242syn match vimSynContains contained "\<contain\%(s\|edin\)=" skipwhite skipnl nextgroup=vimGroupList
1243syn match vimSynKeyContainedin contained "\<containedin=" skipwhite skipnl nextgroup=vimGroupList
1244syn match vimSynNextgroup contained "\<nextgroup=" skipwhite skipnl nextgroup=vimGroupList
dkearnsc79646d2024-01-05 08:58:48 +11001245if has("conceal")
dkearns21ce1592024-01-29 04:54:08 +11001246 " no whitespace allowed after '='
dkearnsc79646d2024-01-05 08:58:48 +11001247 syn match vimSynCchar contained "\<cchar=" nextgroup=vimSynCcharValue
1248 syn match vimSynCcharValue contained "\S"
1249endif
1250
dkearns04e53632024-04-11 06:18:37 +10001251syn match vimSyntax "\<sy\%[ntax]\>" contains=vimCommand skipwhite nextgroup=vimSynType,@vimComment
Bram Moolenaard960d762011-09-21 19:22:10 +02001252syn cluster vimFuncBodyList add=vimSyntax
Bram Moolenaar071d4272004-06-13 20:20:40 +00001253
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001254" Syntax: case {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +01001255syn keyword vimSynType contained case skipwhite nextgroup=vimSynCase,vimSynCaseError
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001256if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsyncaseerror")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001257 syn match vimSynCaseError contained "\i\+"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001258endif
Bram Moolenaar5c736222010-01-06 20:54:52 +01001259syn keyword vimSynCase contained ignore match
Bram Moolenaar071d4272004-06-13 20:20:40 +00001260
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001261" Syntax: clear {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +01001262syn keyword vimSynType contained clear skipwhite nextgroup=vimGroupList
Bram Moolenaar071d4272004-06-13 20:20:40 +00001263
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001264" Syntax: cluster {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +01001265syn keyword vimSynType contained cluster skipwhite nextgroup=vimClusterName
dkearns21ce1592024-01-29 04:54:08 +11001266syn region vimClusterName contained keepend matchgroup=vimGroupName start="\h\w*\>" skip=+\\\\\|\\\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="$\||" contains=@vimContinue,vimGroupAdd,vimGroupRem,vimSynContains,vimSynError
1267syn match vimGroupAdd contained keepend "\<add=" skipwhite skipnl nextgroup=vimGroupList
1268syn match vimGroupRem contained keepend "\<remove=" skipwhite skipnl nextgroup=vimGroupList
Bram Moolenaar071d4272004-06-13 20:20:40 +00001269
Doug Kearns0fab8912025-03-10 21:04:53 +01001270" Syntax: conceal {{{2
1271syn match vimSynType contained "\<conceal\>" skipwhite nextgroup=vimSynConceal,vimSynConcealError
1272if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsynconcealerror")
1273 syn match vimSynConcealError contained "\i\+"
Brad Kingd4634a22024-01-03 10:17:24 -05001274endif
Doug Kearns0fab8912025-03-10 21:04:53 +01001275syn keyword vimSynConceal contained on off
1276
1277" Syntax: foldlevel {{{2
1278syn keyword vimSynType contained foldlevel skipwhite nextgroup=vimSynFoldlevel,vimSynFoldlevelError
1279if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsynfoldlevelerror")
1280 syn match vimSynFoldlevelError contained "\i\+"
1281endif
1282syn keyword vimSynFoldlevel contained start minimum
Brad Kingd4634a22024-01-03 10:17:24 -05001283
Bram Moolenaar13d5aee2016-01-21 23:36:05 +01001284" Syntax: iskeyword {{{2
Doug Kearns0fab8912025-03-10 21:04:53 +01001285syn keyword vimSynType contained iskeyword skipwhite nextgroup=vimSynIskeyword
1286syn keyword vimSynIskeyword contained clear
1287syn match vimSynIskeyword contained "\S\+" contains=vimSynIskeywordSep
1288syn match vimSynIskeywordSep contained ","
Bram Moolenaar13d5aee2016-01-21 23:36:05 +01001289
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001290" Syntax: include {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +01001291syn keyword vimSynType contained include skipwhite nextgroup=vimGroupList
Bram Moolenaar071d4272004-06-13 20:20:40 +00001292
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001293" Syntax: keyword {{{2
dkearns21ce1592024-01-29 04:54:08 +11001294syn cluster vimSynKeyGroup contains=@vimContinue,vimSynCchar,vimSynNextgroup,vimSynKeyOpt,vimSynKeyContainedin
Bram Moolenaar5c736222010-01-06 20:54:52 +01001295syn keyword vimSynType contained keyword skipwhite nextgroup=vimSynKeyRegion
dkearns21ce1592024-01-29 04:54:08 +11001296syn region vimSynKeyRegion contained keepend matchgroup=vimGroupName start="\h\w*\>" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|\|$" contains=@vimSynKeyGroup
Doug Kearns0fab8912025-03-10 21:04:53 +01001297syn match vimSynKeyOpt contained "\%#=1\<\%(conceal\|contained\|transparent\|skipempty\|skipwhite\|skipnl\)\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001298
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001299" Syntax: match {{{2
dkearns21ce1592024-01-29 04:54:08 +11001300syn cluster vimSynMtchGroup contains=@vimContinue,vimSynCchar,vimSynContains,vimSynError,vimSynMtchOpt,vimSynNextgroup,vimSynRegPat,vimNotation,vimMtchComment
Bram Moolenaar5c736222010-01-06 20:54:52 +01001301syn keyword vimSynType contained match skipwhite nextgroup=vimSynMatchRegion
dkearns21ce1592024-01-29 04:54:08 +11001302syn region vimSynMatchRegion contained keepend matchgroup=vimGroupName start="\h\w*\>" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|\|$" contains=@vimSynMtchGroup
Doug Kearns0fab8912025-03-10 21:04:53 +01001303syn match vimSynMtchOpt contained "\%#=1\<\%(conceal\|transparent\|contained\|excludenl\|keepend\|skipempty\|skipwhite\|display\|extend\|skipnl\|fold\)\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001304
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001305" Syntax: off and on {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +01001306syn keyword vimSynType contained enable list manual off on reset
Bram Moolenaar071d4272004-06-13 20:20:40 +00001307
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001308" Syntax: region {{{2
dkearns21ce1592024-01-29 04:54:08 +11001309syn cluster vimSynRegPatGroup contains=@vimContinue,vimPatSep,vimNotPatSep,vimSynPatRange,vimSynNotPatRange,vimSubstSubstr,vimPatRegion,vimPatSepErr,vimNotation
1310syn cluster vimSynRegGroup contains=@vimContinue,vimSynCchar,vimSynContains,vimSynNextgroup,vimSynRegOpt,vimSynReg,vimSynMtchGrp
Bram Moolenaar5c736222010-01-06 20:54:52 +01001311syn keyword vimSynType contained region skipwhite nextgroup=vimSynRegion
Doug Kearns0fab8912025-03-10 21:04:53 +01001312syn region vimSynRegion contained keepend matchgroup=vimGroupName start="\h\w*" skip=+\\\\\|\\\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|\|$" contains=@vimSynRegGroup
1313syn match vimSynRegOpt contained "\%#=1\<\%(conceal\%(ends\)\=\|transparent\|contained\|excludenl\|skipempty\|skipwhite\|display\|keepend\|oneline\|extend\|skipnl\|fold\)\>"
dkearns21ce1592024-01-29 04:54:08 +11001314syn match vimSynReg contained "\<\%(start\|skip\|end\)=" nextgroup=vimSynRegPat
Bram Moolenaar5c736222010-01-06 20:54:52 +01001315syn match vimSynMtchGrp contained "matchgroup=" nextgroup=vimGroup,vimHLGroup
dkearns21ce1592024-01-29 04:54:08 +11001316syn region vimSynRegPat contained extend start="\z([-`~!@#$%^&*_=+;:'",./?]\)" skip=/\\\\\|\\\z1\|\n\s*\\\|\n\s*"\\ / end="\z1" contains=@vimSynRegPatGroup skipwhite nextgroup=vimSynPatMod,vimSynReg
Doug Kearns0fab8912025-03-10 21:04:53 +01001317syn match vimSynPatMod contained "\%#=1\%(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\%([-+]\d\+\)\="
1318syn match vimSynPatMod contained "\%#=1\%(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\%([-+]\d\+\)\=," nextgroup=vimSynPatMod
Bram Moolenaar5c736222010-01-06 20:54:52 +01001319syn match vimSynPatMod contained "lc=\d\+"
1320syn match vimSynPatMod contained "lc=\d\+," nextgroup=vimSynPatMod
1321syn region vimSynPatRange contained start="\[" skip="\\\\\|\\]" end="]"
1322syn match vimSynNotPatRange contained "\\\\\|\\\["
1323syn match vimMtchComment contained '"[^"]\+$'
Bram Moolenaar071d4272004-06-13 20:20:40 +00001324
Doug Kearns0fab8912025-03-10 21:04:53 +01001325" Syntax: spell {{{2
1326syn keyword vimSynType contained spell skipwhite nextgroup=vimSynSpell,vimSynSpellError
1327if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsynspellerror")
1328 syn match vimSynSpellError contained "\i\+"
1329endif
1330syn keyword vimSynSpell contained default notoplevel toplevel
1331
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001332" Syntax: sync {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001333" ============
Doug Kearns0fab8912025-03-10 21:04:53 +01001334syn keyword vimSynType contained sync skipwhite nextgroup=vimSyncClear,vimSyncMatch,vimSyncError,vimSyncRegion,vimSyncArgs
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001335if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsyncerror")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001336 syn match vimSyncError contained "\i\+"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001337endif
Doug Kearns0fab8912025-03-10 21:04:53 +01001338
1339syn region vimSyncArgs contained start="\S" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|\|$" contains=vimSyncLines,vimSyncLinebreak,vimSyncLinecont,vimSyncFromstart,vimSyncCcomment
1340
1341syn keyword vimSyncCcomment contained ccomment skipwhite nextgroup=vimGroupName
1342syn keyword vimSyncClear contained clear skipwhite nextgroup=vimSyncGroupName
1343syn keyword vimSyncFromstart contained fromstart
Bram Moolenaar5c736222010-01-06 20:54:52 +01001344syn keyword vimSyncMatch contained match skipwhite nextgroup=vimSyncGroupName
Doug Kearnsb55f0222025-03-15 09:29:31 +01001345syn keyword vimSyncRegion contained region skipwhite nextgroup=vimSynRegion
Doug Kearns0fab8912025-03-10 21:04:53 +01001346syn match vimSyncLinebreak contained "\<linebreaks=" nextgroup=vimNumber
Bram Moolenaar5c736222010-01-06 20:54:52 +01001347syn keyword vimSyncLinecont contained linecont skipwhite nextgroup=vimSynRegPat
Doug Kearns0fab8912025-03-10 21:04:53 +01001348syn match vimSyncLines contained "\<lines=" nextgroup=vimNumber
1349syn match vimSyncLines contained "\<minlines=" nextgroup=vimNumber
1350syn match vimSyncLines contained "\<maxlines=" nextgroup=vimNumber
1351syn match vimSyncGroupName contained "\<\h\w*\>" skipwhite nextgroup=vimSyncKey
1352syn match vimSyncKey contained "\<grouphere\>" skipwhite nextgroup=vimSyncGroup
1353syn match vimSyncKey contained "\<groupthere\>" skipwhite nextgroup=vimSyncGroup
1354syn match vimSyncGroup contained "\<\h\w*\>" skipwhite nextgroup=vimSynRegPat,vimSyncNone
Bram Moolenaar5c736222010-01-06 20:54:52 +01001355syn keyword vimSyncNone contained NONE
Bram Moolenaar071d4272004-06-13 20:20:40 +00001356
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001357" Additional IsCommand: here by reasons of precedence {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001358" ====================
Bram Moolenaar5c736222010-01-06 20:54:52 +01001359syn match vimIsCommand "<Bar>\s*\a\+" transparent contains=vimCommand,vimNotation
Bram Moolenaar071d4272004-06-13 20:20:40 +00001360
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001361" Highlighting: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001362" ============
dkearns04e53632024-04-11 06:18:37 +10001363syn cluster vimHighlightCluster contains=vimHiLink,vimHiClear,vimHiKeyList,@vimComment
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001364if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimhictermerror")
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001365 syn match vimHiCtermError contained "\D\i*"
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001366endif
Bram Moolenaar5c736222010-01-06 20:54:52 +01001367syn match vimHighlight "\<hi\%[ghlight]\>" skipwhite nextgroup=vimHiBang,@vimHighlightCluster
dkearns9530fe42024-03-19 05:19:51 +11001368syn match vimHiBang contained "\a\@1<=!" skipwhite nextgroup=@vimHighlightCluster
Bram Moolenaard960d762011-09-21 19:22:10 +02001369
Bram Moolenaar5c736222010-01-06 20:54:52 +01001370syn match vimHiGroup contained "\i\+"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001371syn case ignore
Doug Kearns0fab8912025-03-10 21:04:53 +01001372syn keyword vimHiNone contained NONE
dkearnsb614b282024-02-12 03:13:34 +11001373syn keyword vimHiAttrib contained none bold inverse italic nocombine reverse standout strikethrough underline undercurl underdashed underdotted underdouble
Bram Moolenaar5c736222010-01-06 20:54:52 +01001374syn keyword vimFgBgAttrib contained none bg background fg foreground
Bram Moolenaar071d4272004-06-13 20:20:40 +00001375syn case match
Bram Moolenaar5c736222010-01-06 20:54:52 +01001376syn match vimHiAttribList contained "\i\+" contains=vimHiAttrib
1377syn match vimHiAttribList contained "\i\+,"he=e-1 contains=vimHiAttrib nextgroup=vimHiAttribList
Bram Moolenaar071d4272004-06-13 20:20:40 +00001378syn case ignore
Bram Moolenaard2ea7cf2021-05-30 20:54:13 +02001379syn keyword vimHiCtermColor contained black blue brown cyan darkblue darkcyan darkgray darkgreen darkgrey darkmagenta darkred darkyellow gray green grey grey40 grey50 grey90 lightblue lightcyan lightgray lightgreen lightgrey lightmagenta lightred lightyellow magenta red seagreen white yellow
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001380syn match vimHiCtermColor contained "\<color\d\{1,3}\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001381syn case match
Doug Kearns0fab8912025-03-10 21:04:53 +01001382
Bram Moolenaar5c736222010-01-06 20:54:52 +01001383syn match vimHiFontname contained "[a-zA-Z\-*]\+"
1384syn match vimHiGuiFontname contained "'[a-zA-Z\-* ]\+'"
1385syn match vimHiGuiRgb contained "#\x\{6}"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001386
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001387" Highlighting: hi group key=arg ... {{{2
Doug Kearns0fab8912025-03-10 21:04:53 +01001388syn cluster vimHiCluster contains=vimGroup,vimHiGroup,vimHiNone,vimHiTerm,vimHiCTerm,vimHiStartStop,vimHiCtermFgBg,vimHiCtermul,vimHiCtermfont,vimHiGui,vimHiGuiFont,vimHiGuiFgBg,vimHiKeyError,vimNotation,vimComment,vim9comment
dkearns9530fe42024-03-19 05:19:51 +11001389syn region vimHiKeyList contained start="\i\+" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|" excludenl end="$" contains=@vimContinue,@vimHiCluster
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001390if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_vimhikeyerror")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001391 syn match vimHiKeyError contained "\i\+="he=e-1
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001392endif
Bram Moolenaar5c736222010-01-06 20:54:52 +01001393syn match vimHiTerm contained "\cterm="he=e-1 nextgroup=vimHiAttribList
dkearns9530fe42024-03-19 05:19:51 +11001394syn match vimHiStartStop contained "\c\%(start\|stop\)="he=e-1 nextgroup=vimHiTermcap,vimOption
Bram Moolenaar5c736222010-01-06 20:54:52 +01001395syn match vimHiCTerm contained "\ccterm="he=e-1 nextgroup=vimHiAttribList
Bram Moolenaar83d1b192015-04-13 14:22:40 +02001396syn match vimHiCtermFgBg contained "\ccterm[fb]g="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
Bram Moolenaar2547aa92020-07-26 17:00:44 +02001397syn match vimHiCtermul contained "\cctermul="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
PMuncha606f3a2023-11-15 15:35:49 +01001398syn match vimHiCtermfont contained "\cctermfont="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
Bram Moolenaar5c736222010-01-06 20:54:52 +01001399syn match vimHiGui contained "\cgui="he=e-1 nextgroup=vimHiAttribList
1400syn match vimHiGuiFont contained "\cfont="he=e-1 nextgroup=vimHiFontname
1401syn match vimHiGuiFgBg contained "\cgui\%([fb]g\|sp\)="he=e-1 nextgroup=vimHiGroup,vimHiGuiFontname,vimHiGuiRgb,vimFgBgAttrib
1402syn match vimHiTermcap contained "\S\+" contains=vimNotation
Bram Moolenaar83d1b192015-04-13 14:22:40 +02001403syn match vimHiNmbr contained '\d\+'
Bram Moolenaar071d4272004-06-13 20:20:40 +00001404
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001405" Highlight: clear {{{2
dkearns9530fe42024-03-19 05:19:51 +11001406syn keyword vimHiClear contained clear skipwhite nextgroup=vimGroup,vimHiGroup
Bram Moolenaar071d4272004-06-13 20:20:40 +00001407
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001408" Highlight: link {{{2
Bram Moolenaard2855f52018-07-31 22:23:58 +02001409" see tst24 (hi def vs hi) (Jul 06, 2018)
1410"syn region vimHiLink contained oneline matchgroup=vimCommand start="\(\<hi\%[ghlight]\s\+\)\@<=\(\(def\%[ault]\s\+\)\=link\>\|\<def\>\)" end="$" contains=vimHiGroup,vimGroup,vimHLGroup,vimNotation
dkearns9530fe42024-03-19 05:19:51 +11001411" TODO: simplify and allow line continuations --djk
1412syn region vimHiLink contained matchgroup=Type start="\%(\<hi\%[ghlight]!\=\s\+\)\@<=\%(\%(def\%[ault]\s\+\)\=link\>\|\<def\%[ault]\>\)" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|" excludenl end="$" contains=@vimContinue,@vimHiCluster
Bram Moolenaar071d4272004-06-13 20:20:40 +00001413
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001414" Control Characters: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001415" ==================
Bram Moolenaar5c736222010-01-06 20:54:52 +01001416syn match vimCtrlChar "[- -]"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001417
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001418" Beginners - Patterns that involve ^ {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001419" =========
Doug Kearns35699f12024-09-19 19:51:59 +02001420Vim9 syn region vim9LineComment start=+^[ \t:]*\zs#.*$+ skip=+\n\s*\\\|\n\s*#\\ + end="$" contains=@vimCommentGroup,vimCommentString,vim9CommentTitle extend
1421VimL syn region vimLineComment start=+^[ \t:]*\zs".*$+ skip=+\n\s*\\\|\n\s*"\\ + end="$" contains=@vimCommentGroup,vimCommentString,vimCommentTitle extend
Doug Kearnsd65e58f2024-07-17 19:34:14 +02001422
Bram Moolenaar5c736222010-01-06 20:54:52 +01001423syn match vimCommentTitle '"\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vimCommentTitleLeader,vimTodo,@vimCommentGroup
dkearns04e53632024-04-11 06:18:37 +10001424syn match vim9CommentTitle '#\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vim9CommentTitleLeader,vimTodo,@vimCommentGroup
dkearns059cbe82024-06-12 03:27:53 +10001425
dkearnsae321b52024-06-15 23:06:17 +10001426" allowed anywhere in the file
1427if !s:vim9script
1428 syn match vimShebangError "^\s*\zs#!.*" display
1429endif
1430syn match vimShebang "\%^#!.*" display
1431
dkearns21ce1592024-01-29 04:54:08 +11001432syn match vimContinue "^\s*\zs\\"
Doug Kearns4f010c92025-02-13 20:24:42 +01001433syn match vimContinueComment '^\s*\zs["#]\\ .*' extend
1434syn match vim9ContinueComment "^\s*\zs#\\ .*" extend
Doug Kearns818c6412024-10-06 17:00:48 +02001435syn cluster vimContinue contains=vimContinue,vimContinueComment
1436syn cluster vim9Continue contains=vimContinue,vim9ContinueComment
1437
Bram Moolenaar5c736222010-01-06 20:54:52 +01001438syn region vimString start="^\s*\\\z(['"]\)" skip='\\\\\|\\\z1' end="\z1" oneline keepend contains=@vimStringGroup,vimContinue
1439syn match vimCommentTitleLeader '"\s\+'ms=s+1 contained
dkearns04e53632024-04-11 06:18:37 +10001440syn match vim9CommentTitleLeader '#\s\+'ms=s+1 contained
Bram Moolenaar071d4272004-06-13 20:20:40 +00001441
Bram Moolenaar18144c82006-04-12 21:52:12 +00001442" Searches And Globals: {{{2
1443" ====================
Doug Kearnsc273f1a2025-01-20 21:53:01 +01001444VimL syn match vimSearch '^\s*[/?].*' contains=vimSearchDelim
Bram Moolenaar5c736222010-01-06 20:54:52 +01001445syn match vimSearchDelim '^\s*\zs[/?]\|[/?]$' contained
Doug Kearnsc273f1a2025-01-20 21:53:01 +01001446Vim9 syn match vim9Search '^\s*:[/?].*' contains=vim9SearchDelim
1447syn match vim9SearchDelim '^\s*\zs:[/?]\|[/?]$' contained contains=vimCmdSep
dkearns2c51e152024-02-27 07:10:18 +11001448syn region vimGlobal matchgroup=Statement start='\<g\%[lobal]!\=/' skip='\\.' end='/' skipwhite nextgroup=vimSubst1
1449syn region vimGlobal matchgroup=Statement start='\<v\%[global]!\=/' skip='\\.' end='/' skipwhite nextgroup=vimSubst1
Bram Moolenaare2f98b92006-03-29 21:18:24 +00001450
dkearns04e53632024-04-11 06:18:37 +10001451" Vim9 Script Regions: {{{2
1452" ==================
1453
1454if s:vim9script
Doug Kearnsce064932024-04-13 18:24:01 +02001455 syn cluster vimLegacyTop contains=TOP,vim9LegacyHeader,vim9Comment,vim9LineComment
1456 VimFoldH syn region vim9LegacyHeader start="\%^" end="^\ze\s*vim9s\%[cript]\>" contains=@vimLegacyTop,vimComment,vimLineComment
dkearns04e53632024-04-11 06:18:37 +10001457
Doug Kearnsce064932024-04-13 18:24:01 +02001458 syn keyword vim9Vim9ScriptArg noclear contained
1459 syn keyword vim9Vim9Script vim9s[cript] nextgroup=vim9Vim9ScriptArg skipwhite
dkearns04e53632024-04-11 06:18:37 +10001460endif
1461
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001462" Embedded Scripts: {{{2
1463" ================
1464" perl,ruby : Benoit Cerrina
1465" python,tcl : Johannes Zellner
1466" mzscheme, lua : Charles Campbell
Bram Moolenaar071d4272004-06-13 20:20:40 +00001467
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00001468" Allows users to specify the type of embedded script highlighting
1469" they want: (perl/python/ruby/tcl support)
1470" g:vimsyn_embed == 0 : don't embed any scripts
Doug Kearnsfc64ac02024-06-22 11:20:36 +02001471" g:vimsyn_embed =~# 'l' : embed Lua (but only if vim supports it)
1472" g:vimsyn_embed =~# 'm' : embed MzScheme (but only if vim supports it)
1473" g:vimsyn_embed =~# 'p' : embed Perl (but only if vim supports it)
1474" g:vimsyn_embed =~# 'P' : embed Python (but only if vim supports it)
1475" g:vimsyn_embed =~# 'r' : embed Ruby (but only if vim supports it)
1476" g:vimsyn_embed =~# 't' : embed Tcl (but only if vim supports it)
Bram Moolenaar7cba6c02013-09-05 22:13:31 +02001477if !exists("g:vimsyn_embed")
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001478 let g:vimsyn_embed= "lmpPr"
Bram Moolenaar7cba6c02013-09-05 22:13:31 +02001479endif
Bram Moolenaar071d4272004-06-13 20:20:40 +00001480
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +02001481" [-- lua --] {{{3
Bram Moolenaaradc21822011-04-01 18:03:16 +02001482let s:luapath= fnameescape(expand("<sfile>:p:h")."/lua.vim")
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +02001483if !filereadable(s:luapath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001484 for s:luapath in split(globpath(&rtp,"syntax/lua.vim"),"\n")
1485 if filereadable(fnameescape(s:luapath))
1486 let s:luapath= fnameescape(s:luapath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +01001487 break
1488 endif
1489 endfor
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +02001490endif
Bram Moolenaarf3913272016-02-25 00:00:01 +01001491if (g:vimsyn_embed =~# 'l' && has("lua")) && filereadable(s:luapath)
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +02001492 unlet! b:current_syntax
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001493 syn cluster vimFuncBodyList add=vimLuaRegion
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +02001494 exe "syn include @vimLuaScript ".s:luapath
Ken Takata95e90782024-08-22 21:29:39 +02001495 VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+^\z(\s*\)lua\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ contains=@vimLuaScript
1496 VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+lua\s*<<\s*\z(\S*\)+ end=+^\z1$+ contains=@vimLuaScript
1497 VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+^\z(\s*\)lua\s*<<\s*trim\s*$+ end=+^\z1\.$+ contains=@vimLuaScript
1498 VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+lua\s*<<\s*$+ end=+^\.$+ contains=@vimLuaScript
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +02001499 syn cluster vimFuncBodyList add=vimLuaRegion
1500else
Ken Takata95e90782024-08-22 21:29:39 +02001501 syn region vimEmbedError start=+^\z(\s*\)lua\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+
1502 syn region vimEmbedError start=+lua\s*<<\s*\z(\S*\)+ end=+^\z1$+
1503 syn region vimEmbedError start=+^\z(\s*\)lua\s*<<\s*trim\s\*$+ end=+^\z1\.$+
1504 syn region vimEmbedError start=+lua\s*<<\s*$+ end=+^\.$+
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +02001505endif
1506unlet s:luapath
1507
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001508" [-- perl --] {{{3
Bram Moolenaaradc21822011-04-01 18:03:16 +02001509let s:perlpath= fnameescape(expand("<sfile>:p:h")."/perl.vim")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001510if !filereadable(s:perlpath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001511 for s:perlpath in split(globpath(&rtp,"syntax/perl.vim"),"\n")
1512 if filereadable(fnameescape(s:perlpath))
1513 let s:perlpath= fnameescape(s:perlpath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +01001514 break
1515 endif
1516 endfor
Bram Moolenaar5c736222010-01-06 20:54:52 +01001517endif
Bram Moolenaarf3913272016-02-25 00:00:01 +01001518if (g:vimsyn_embed =~# 'p' && has("perl")) && filereadable(s:perlpath)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001519 unlet! b:current_syntax
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001520 syn cluster vimFuncBodyList add=vimPerlRegion
Bram Moolenaar5c736222010-01-06 20:54:52 +01001521 exe "syn include @vimPerlScript ".s:perlpath
Ken Takata95e90782024-08-22 21:29:39 +02001522 VimFoldp syn region vimPerlRegion matchgroup=vimScriptDelim start=+^\z(\s*\)pe\%[rl]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ contains=@vimPerlScript
1523 VimFoldp syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*\z(\S*\)+ end=+^\z1$+ contains=@vimPerlScript
1524 VimFoldp syn region vimPerlRegion matchgroup=vimScriptDelim start=+^\z(\s*\)pe\%[rl]\s*<<\s*trim\s*$+ end=+^\z1\.$+ contains=@vimPerlScript
1525 VimFoldp syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*$+ end=+\.$+ contains=@vimPerlScript
Bram Moolenaar5c736222010-01-06 20:54:52 +01001526 syn cluster vimFuncBodyList add=vimPerlRegion
Bram Moolenaarc236c162008-07-13 17:41:49 +00001527else
Ken Takata95e90782024-08-22 21:29:39 +02001528 syn region vimEmbedError start=+^\z(\s*\)pe\%[rl]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+
1529 syn region vimEmbedError start=+pe\%[rl]\s*<<\s*\z(\S*\)+ end=+^\z1$+
1530 syn region vimEmbedError start=+^\z(\s*\)pe\%[rl]\s*<<\s*trim\s\*$+ end=+^\z1\.$+
1531 syn region vimEmbedError start=+pe\%[rl]\s*<<\s*$+ end=+^\.$+
Bram Moolenaar071d4272004-06-13 20:20:40 +00001532endif
Bram Moolenaar5c736222010-01-06 20:54:52 +01001533unlet s:perlpath
Bram Moolenaar071d4272004-06-13 20:20:40 +00001534
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001535" [-- ruby --] {{{3
Bram Moolenaaradc21822011-04-01 18:03:16 +02001536let s:rubypath= fnameescape(expand("<sfile>:p:h")."/ruby.vim")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001537if !filereadable(s:rubypath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001538 for s:rubypath in split(globpath(&rtp,"syntax/ruby.vim"),"\n")
1539 if filereadable(fnameescape(s:rubypath))
1540 let s:rubypath= fnameescape(s:rubypath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +01001541 break
1542 endif
1543 endfor
Bram Moolenaar5c736222010-01-06 20:54:52 +01001544endif
Bram Moolenaarf3913272016-02-25 00:00:01 +01001545if (g:vimsyn_embed =~# 'r' && has("ruby")) && filereadable(s:rubypath)
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001546 syn cluster vimFuncBodyList add=vimRubyRegion
Bram Moolenaar071d4272004-06-13 20:20:40 +00001547 unlet! b:current_syntax
Bram Moolenaar5c736222010-01-06 20:54:52 +01001548 exe "syn include @vimRubyScript ".s:rubypath
Ken Takata95e90782024-08-22 21:29:39 +02001549 VimFoldr syn region vimRubyRegion matchgroup=vimScriptDelim start=+^\z(\s*\)rub\%[y]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ contains=@vimRubyScript
1550 VimFoldr syn region vimRubyRegion matchgroup=vimScriptDelim start=+rub\%[y]\s*<<\s*\z(\S*\)+ end=+^\z1$+ contains=@vimRubyScript
1551 VimFoldr syn region vimRubyRegion matchgroup=vimScriptDelim start=+^\z(\s*\)rub\%[y]\s*<<\s*trim\s*$+ end=+^\z1\.$+ contains=@vimRubyScript
1552 VimFoldr syn region vimRubyRegion matchgroup=vimScriptDelim start=+rub\%[y]\s*<<\s*$+ end=+\.$+ contains=@vimRubyScript
Bram Moolenaar5c736222010-01-06 20:54:52 +01001553 syn cluster vimFuncBodyList add=vimRubyRegion
Bram Moolenaarc236c162008-07-13 17:41:49 +00001554else
Ken Takata95e90782024-08-22 21:29:39 +02001555 syn region vimEmbedError start=+^\z(\s*\)rub\%[y]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+
1556 syn region vimEmbedError start=+rub\%[y]\s*<<\s*\z(\S.*\)+ end=+^\z1$+
1557 syn region vimEmbedError start=+^\z(\s*\)rub\%[y]\s*<<\s*trim\s\*$+ end=+^\z1\.$+
1558 syn region vimEmbedError start=+rub\%[y]\s*<<\s*$+ end=+^\.$+
Bram Moolenaar071d4272004-06-13 20:20:40 +00001559endif
Bram Moolenaar5c736222010-01-06 20:54:52 +01001560unlet s:rubypath
Bram Moolenaar071d4272004-06-13 20:20:40 +00001561
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001562" [-- python --] {{{3
Bram Moolenaaradc21822011-04-01 18:03:16 +02001563let s:pythonpath= fnameescape(expand("<sfile>:p:h")."/python.vim")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001564if !filereadable(s:pythonpath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001565 for s:pythonpath in split(globpath(&rtp,"syntax/python.vim"),"\n")
1566 if filereadable(fnameescape(s:pythonpath))
1567 let s:pythonpath= fnameescape(s:pythonpath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +01001568 break
1569 endif
1570 endfor
Bram Moolenaar5c736222010-01-06 20:54:52 +01001571endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001572if g:vimsyn_embed =~# 'P' && has("pythonx") && filereadable(s:pythonpath)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001573 unlet! b:current_syntax
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001574 syn cluster vimFuncBodyList add=vimPythonRegion
Bram Moolenaar5c736222010-01-06 20:54:52 +01001575 exe "syn include @vimPythonScript ".s:pythonpath
Ken Takata95e90782024-08-22 21:29:39 +02001576 VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+^\z(\s*\)py\%[thon][3x]\=\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ contains=@vimPythonScript
1577 VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon][3x]\=\s*<<\s*\z(\S\+\)+ end=+^\z1$+ contains=@vimPythonScript
1578 VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+^\z(\s*\)py\%[thon][3x]\=\s*<<\s*trim\s*$+ end=+^\z1\.$+ contains=@vimPythonScript
1579 VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon][3x]\=\s*<<\s*$+ end=+^\.$+ contains=@vimPythonScript
1580 VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+Py\%[thon]2or3\s*<<\s*\%(trim\s*\)\=\z(\S\+\)+ end=+^\z1$+ contains=@vimPythonScript
1581 VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+Py\%[thon]2or3\s*<<\s*\%(trim\s*\)\=$+ end=+^\.$+ contains=@vimPythonScript
Bram Moolenaar5c736222010-01-06 20:54:52 +01001582 syn cluster vimFuncBodyList add=vimPythonRegion
Bram Moolenaarc236c162008-07-13 17:41:49 +00001583else
Ken Takata95e90782024-08-22 21:29:39 +02001584 syn region vimEmbedError start=+^\z(\s*\)py\%[thon][3x]\=\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+
1585 syn region vimEmbedError start=+py\%[thon][3x]\=\s*<<\s*\z(\S\+\)+ end=+^\z1$+
1586 syn region vimEmbedError start=+^\z(\s*\)py\%[thon][3x]\=\s*<<\s*trim\s*$+ end=+^\z1\.$+
1587 syn region vimEmbedError start=+py\%[thon][3x]\=\s*<<\s*$+ end=+^\.$+
Bram Moolenaar071d4272004-06-13 20:20:40 +00001588endif
Bram Moolenaar5c736222010-01-06 20:54:52 +01001589unlet s:pythonpath
Bram Moolenaar071d4272004-06-13 20:20:40 +00001590
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001591" [-- tcl --] {{{3
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001592if has("win32") || has("win95") || has("win64") || has("win16")
1593 " apparently has("tcl") has been hanging vim on some windows systems with cygwin
1594 let s:trytcl= (&shell !~ '\<\%(bash\>\|4[nN][tT]\|\<zsh\)\>\%(\.exe\)\=$')
1595else
1596 let s:trytcl= 1
1597endif
Bram Moolenaara6878372014-03-22 21:02:50 +01001598if s:trytcl
1599 let s:tclpath= fnameescape(expand("<sfile>:p:h")."/tcl.vim")
1600 if !filereadable(s:tclpath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001601 for s:tclpath in split(globpath(&rtp,"syntax/tcl.vim"),"\n")
1602 if filereadable(fnameescape(s:tclpath))
1603 let s:tclpath= fnameescape(s:tclpath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +01001604 break
1605 endif
1606 endfor
Bram Moolenaar5c736222010-01-06 20:54:52 +01001607 endif
Bram Moolenaarf3913272016-02-25 00:00:01 +01001608 if (g:vimsyn_embed =~# 't' && has("tcl")) && filereadable(s:tclpath)
Bram Moolenaara6878372014-03-22 21:02:50 +01001609 unlet! b:current_syntax
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001610 syn cluster vimFuncBodyList add=vimTclRegion
Bram Moolenaara6878372014-03-22 21:02:50 +01001611 exe "syn include @vimTclScript ".s:tclpath
Ken Takata95e90782024-08-22 21:29:39 +02001612 VimFoldt syn region vimTclRegion matchgroup=vimScriptDelim start=+^\z(\s*\)tc\%[l]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ contains=@vimTclScript
1613 VimFoldt syn region vimTclRegion matchgroup=vimScriptDelim start=+tc\%[l]\=\s*<<\s*\z(\S*\)+ end=+^\z1$+ contains=@vimTclScript
1614 VimFoldt syn region vimTclRegion matchgroup=vimScriptDelim start=+^\z(\s*\)tc\%[l]\s*<<\s*trim\s*$+ end=+^\z1\.$+ contains=@vimTclScript
1615 VimFoldt syn region vimTclRegion matchgroup=vimScriptDelim start=+tc\%[l]\=\s*<<\s*$+ end=+^\.$+ contains=@vimTclScript
Bram Moolenaara6878372014-03-22 21:02:50 +01001616 syn cluster vimFuncBodyList add=vimTclScript
1617 else
Ken Takata95e90782024-08-22 21:29:39 +02001618 syn region vimEmbedError start=+^\z(\s*\)tc\%[l]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+
1619 syn region vimEmbedError start=+tc\%[l]\=\s*<<\s*\z(\S*\)+ end=+^\z1$+
1620 syn region vimEmbedError start=+^\z(\s*\)tc\%[l]\s*<<\s*trim\s\*$+ end=+^\z1\.$+
1621 syn region vimEmbedError start=+tc\%[l]\=\s*<<\s*$+ end=+^\.$+
Bram Moolenaara6878372014-03-22 21:02:50 +01001622 endif
1623 unlet s:tclpath
Bram Moolenaarc236c162008-07-13 17:41:49 +00001624else
Ken Takata95e90782024-08-22 21:29:39 +02001625 syn region vimEmbedError start=+^\z(\s*\)tc\%[l]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+
1626 syn region vimEmbedError start=+tc\%[l]\=\s*<<\s*\z(\S*\)+ end=+^\z1$+
1627 syn region vimEmbedError start=+^\z(\s*\)tc\%[l]\s*<<\s*trim\s\*$+ end=+^\z1\.$+
1628 syn region vimEmbedError start=+tc\%[l]\=\s*<<\s*$+ end=+^\.$+
Bram Moolenaar9964e462007-05-05 17:54:07 +00001629endif
Bram Moolenaara6878372014-03-22 21:02:50 +01001630unlet s:trytcl
Bram Moolenaar071d4272004-06-13 20:20:40 +00001631
Bram Moolenaar8299df92004-07-10 09:47:34 +00001632" [-- mzscheme --] {{{3
Bram Moolenaaradc21822011-04-01 18:03:16 +02001633let s:mzschemepath= fnameescape(expand("<sfile>:p:h")."/scheme.vim")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001634if !filereadable(s:mzschemepath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001635 for s:mzschemepath in split(globpath(&rtp,"syntax/mzscheme.vim"),"\n")
1636 if filereadable(fnameescape(s:mzschemepath))
1637 let s:mzschemepath= fnameescape(s:mzschemepath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +01001638 break
1639 endif
1640 endfor
Bram Moolenaar5c736222010-01-06 20:54:52 +01001641endif
Bram Moolenaarf3913272016-02-25 00:00:01 +01001642if (g:vimsyn_embed =~# 'm' && has("mzscheme")) && filereadable(s:mzschemepath)
Bram Moolenaar8299df92004-07-10 09:47:34 +00001643 unlet! b:current_syntax
Bram Moolenaar03413f42016-04-12 21:07:15 +02001644 let s:iskKeep= &isk
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001645 syn cluster vimFuncBodyList add=vimMzSchemeRegion
Bram Moolenaar5c736222010-01-06 20:54:52 +01001646 exe "syn include @vimMzSchemeScript ".s:mzschemepath
Bram Moolenaar03413f42016-04-12 21:07:15 +02001647 let &isk= s:iskKeep
1648 unlet s:iskKeep
Ken Takata95e90782024-08-22 21:29:39 +02001649 VimFoldm syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+^\z(\s*\)mz\%[scheme]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ contains=@vimMzSchemeScript
1650 VimFoldm syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*\z(\S*\)+ end=+^\z1$+ contains=@vimMzSchemeScript
1651 VimFoldm syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+^\z(\s*\)mz\%[scheme]\s*<<\s*trim\s*$+ end=+^\z1\.$+ contains=@vimMzSchemeScript
1652 VimFoldm syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*$+ end=+^\.$+ contains=@vimMzSchemeScript
Bram Moolenaar5c736222010-01-06 20:54:52 +01001653 syn cluster vimFuncBodyList add=vimMzSchemeRegion
Bram Moolenaarc236c162008-07-13 17:41:49 +00001654else
Ken Takata95e90782024-08-22 21:29:39 +02001655 syn region vimEmbedError start=+^\z(\s*\)mz\%[scheme]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+
1656 syn region vimEmbedError start=+mz\%[scheme]\s*<<\s*\z(\S*\)+ end=+^\z1$+
1657 syn region vimEmbedError start=+^\z(\s*\)mz\%[scheme]\s*<<\s*trim\s\*$+ end=+^\z1\.$+
1658 syn region vimEmbedError start=+mz\%[scheme]\s*<<\s*$+ end=+^\.$+
Bram Moolenaar8299df92004-07-10 09:47:34 +00001659endif
Bram Moolenaar5c736222010-01-06 20:54:52 +01001660unlet s:mzschemepath
Bram Moolenaar8299df92004-07-10 09:47:34 +00001661
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001662" Synchronize (speed) {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001663"============
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00001664if exists("g:vimsyn_minlines")
1665 exe "syn sync minlines=".g:vimsyn_minlines
Bram Moolenaar071d4272004-06-13 20:20:40 +00001666endif
Bram Moolenaar03413f42016-04-12 21:07:15 +02001667exe "syn sync maxlines=".s:vimsyn_maxlines
Bram Moolenaar071d4272004-06-13 20:20:40 +00001668syn sync linecont "^\s\+\\"
dkearns62b26042024-03-10 03:43:28 +11001669syn sync linebreaks=1
Bram Moolenaar071d4272004-06-13 20:20:40 +00001670syn sync match vimAugroupSyncA groupthere NONE "\<aug\%[roup]\>\s\+[eE][nN][dD]"
1671
Bram Moolenaar5c736222010-01-06 20:54:52 +01001672" ====================
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001673" Highlighting Settings {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001674" ====================
1675
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001676if !exists("skip_vim_syntax_inits")
1677 if !exists("g:vimsyn_noerror")
1678 hi def link vimBehaveError vimError
1679 hi def link vimCollClassErr vimError
1680 hi def link vimErrSetting vimError
1681 hi def link vimEmbedError vimError
1682 hi def link vimFTError vimError
1683 hi def link vimFunctionError vimError
1684 hi def link vimFunc vimError
1685 hi def link vimHiAttribList vimError
1686 hi def link vimHiCtermError vimError
1687 hi def link vimHiKeyError vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001688 hi def link vimMapModErr vimError
dkearnsae321b52024-06-15 23:06:17 +10001689 hi def link vimShebangError vimError
Doug Kearns9b171bd2025-04-10 19:59:22 +02001690 hi def link vimSortOptionsError Error
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001691 hi def link vimSubstFlagErr vimError
1692 hi def link vimSynCaseError vimError
Doug Kearns0fab8912025-03-10 21:04:53 +01001693 hi def link vimSyncError vimError
1694 hi def link vimSynConcealError vimError
1695 hi def link vimSynError vimError
1696 hi def link vimSynFoldlevelError vimError
1697 hi def link vimSynIskeywordError vimError
1698 hi def link vimSynSpellError vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001699 hi def link vimBufnrWarn vimWarn
Doug Kearns818c6412024-10-06 17:00:48 +02001700
1701 hi def link vim9TypeAliasError vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001702 endif
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001703
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001704 hi def link vimAbb vimCommand
1705 hi def link vimAddress vimMark
dkearnsc4aef9a2024-03-04 02:42:47 +11001706 hi def link vimAugroupBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001707 hi def link vimAugroupError vimError
1708 hi def link vimAugroupKey vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001709 hi def link vimAutoCmd vimCommand
Doug Kearns1718e7d2025-01-08 18:20:47 +01001710 hi def link vimAutoCmdBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001711 hi def link vimAutoEvent Type
Bram Moolenaard58a3bf2020-09-28 21:48:16 +02001712 hi def link vimAutoCmdMod Special
dkearnsb614b282024-02-12 03:13:34 +11001713 hi def link vimBang vimOper
dkearns2c51e152024-02-27 07:10:18 +11001714 hi def link vimBehaveBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001715 hi def link vimBehaveModel vimBehave
1716 hi def link vimBehave vimCommand
1717 hi def link vimBracket Delimiter
Doug Kearns99984fc2024-07-18 20:45:19 +02001718 hi def link vimCall vimCommand
dkearnsa3bddb72024-06-14 01:48:10 +10001719 hi def link vimCatch vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001720 hi def link vimCmplxRepeat SpecialChar
1721 hi def link vimCommand Statement
1722 hi def link vimComment Comment
Doug Kearnsfc64ac02024-06-22 11:20:36 +02001723 hi def link vimCommentError vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001724 hi def link vimCommentString vimString
1725 hi def link vimCommentTitle PreProc
1726 hi def link vimCondHL vimCommand
dkearnsf6869212023-12-11 01:53:24 +11001727 hi def link vimConst vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001728 hi def link vimContinue Special
dkearns21ce1592024-01-29 04:54:08 +11001729 hi def link vimContinueComment vimComment
Doug Kearns4a530a62025-02-03 18:59:09 +01001730 hi def link vimCount Number
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001731 hi def link vimCtrlChar SpecialChar
Doug Kearns4a530a62025-02-03 18:59:09 +01001732 hi def link vimDebuggreedy vimCommand
Doug Kearnsfc64ac02024-06-22 11:20:36 +02001733 hi def link vimDefComment vim9Comment
dkearns35e6f4c2024-03-22 06:41:10 +11001734 hi def link vimDefKey vimCommand
Doug Kearns1aa287e2025-02-10 22:00:27 +01001735 hi def link vimDefParam vimVar
Doug Kearns3c07eb02024-09-02 10:03:37 +02001736 hi def link vimDelcommand vimCommand
1737 hi def link vimDelcommandAttr vimUserCmdAttr
dkearnsb1427b42024-02-28 05:59:30 +11001738 hi def link vimEcho vimCommand
dkearns61887b32024-03-15 23:45:48 +11001739 hi def link vimEchohlNone vimGroup
1740 hi def link vimEchohl vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001741 hi def link vimElseIfErr Error
dkearns35e6f4c2024-03-22 06:41:10 +11001742 hi def link vimEndfunction vimCommand
1743 hi def link vimEnddef vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001744 hi def link vimEnvvar PreProc
1745 hi def link vimError Error
Bram Moolenaar6ba83ba2022-06-12 22:15:57 +01001746 hi def link vimEscape Special
Doug Kearns9b171bd2025-04-10 19:59:22 +02001747 hi def link vimExFilter vimCommand
1748 hi def link vimExFilterBang vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001749 hi def link vimFBVar vimVar
1750 hi def link vimFgBgAttrib vimHiAttrib
Bram Moolenaarcbaff5e2022-04-08 17:45:08 +01001751 hi def link vimFuncEcho vimCommand
dkearns1c97b5c2023-12-13 02:47:43 +11001752 hi def link vimFor vimCommand
Doug Kearns1aa287e2025-02-10 22:00:27 +01001753 hi def link vimForInContinue vimContinue
1754 hi def link vimForInContinueComment vimContinueComment
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001755 hi def link vimFTCmd vimCommand
1756 hi def link vimFTOption vimSynType
dkearns35e6f4c2024-03-22 06:41:10 +11001757 hi def link vimFuncBang vimBang
1758 hi def link vimFuncComment vimComment
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001759 hi def link vimFuncKey vimCommand
1760 hi def link vimFuncName Function
dkearns35e6f4c2024-03-22 06:41:10 +11001761 hi def link vimFuncMod Special
1762 hi def link vimFuncParam vimVar
1763 hi def link vimFuncParamEquals vimOper
Doug Kearns3dca5122025-03-09 16:30:28 +01001764 hi def link vimFuncScope vimVarScope
Doug Kearns1aa287e2025-02-10 22:00:27 +01001765 hi def link vimFuncSID vimNotation
Doug Kearns9b171bd2025-04-10 19:59:22 +02001766 hi def link vimGrep vimCommand
1767 hi def link vimGrepadd vimCommand
1768 hi def link vimGrepBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001769 hi def link vimGroupAdd vimSynOption
Doug Kearns0fab8912025-03-10 21:04:53 +01001770 hi def link vimGroupName Normal
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001771 hi def link vimGroupRem vimSynOption
1772 hi def link vimGroupSpecial Special
1773 hi def link vimGroup Type
Doug Kearns9b171bd2025-04-10 19:59:22 +02001774 hi def link vimHelpgrep vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001775 hi def link vimHiAttrib PreProc
dkearnsb614b282024-02-12 03:13:34 +11001776 hi def link vimHiBang vimBang
dkearns9530fe42024-03-19 05:19:51 +11001777 hi def link vimHiClear Type
1778 hi def link vimHiCtermColor Constant
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001779 hi def link vimHiCtermFgBg vimHiTerm
dkearns9530fe42024-03-19 05:19:51 +11001780 hi def link vimHiCtermfont vimHiTerm
1781 hi def link vimHiCtermul vimHiTerm
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001782 hi def link vimHiCTerm vimHiTerm
1783 hi def link vimHighlight vimCommand
1784 hi def link vimHiGroup vimGroupName
1785 hi def link vimHiGuiFgBg vimHiTerm
1786 hi def link vimHiGuiFont vimHiTerm
1787 hi def link vimHiGuiRgb vimNumber
1788 hi def link vimHiGui vimHiTerm
1789 hi def link vimHiNmbr Number
Doug Kearns0fab8912025-03-10 21:04:53 +01001790 hi def link vimHiNone vimGroup
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001791 hi def link vimHiStartStop vimHiTerm
1792 hi def link vimHiTerm Type
1793 hi def link vimHLGroup vimGroup
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001794 hi def link vimInsert vimString
dkearns04e53632024-04-11 06:18:37 +10001795 hi def link vim9KeymapLineComment vimKeymapLineComment
dkearns69866442023-11-22 05:43:40 +11001796 hi def link vimKeymapLineComment vimComment
1797 hi def link vimKeymapTailComment vimComment
Doug Kearns722fbd12025-03-28 19:36:37 +01001798 hi def link vimLambdaBrace Delimiter
Doug Kearns1aa287e2025-02-10 22:00:27 +01001799 hi def link vimLambdaOperator vimOper
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001800 hi def link vimLet vimCommand
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001801 hi def link vimLetHereDoc vimString
1802 hi def link vimLetHereDocStart Special
1803 hi def link vimLetHereDocStop Special
Doug Kearns2f5a8c02025-04-05 15:55:36 +02001804 hi def link vimLetRegister vimRegister
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001805 hi def link vimLineComment vimComment
Doug Kearns9b171bd2025-04-10 19:59:22 +02001806 hi def link vimMake vimCommand
1807 hi def link vimMakeadd vimCommand
1808 hi def link vimMakeBang vimBang
dkearnsb614b282024-02-12 03:13:34 +11001809 hi def link vimMapBang vimBang
Doug Kearns6bdfeb02025-03-07 18:49:11 +01001810 hi def link vimMapLeader vimBracket
1811 hi def link vimMapLeaderKey vimNotation
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001812 hi def link vimMapModKey vimFuncSID
1813 hi def link vimMapMod vimBracket
1814 hi def link vimMap vimCommand
1815 hi def link vimMark Number
1816 hi def link vimMarkNumber vimNumber
Doug Kearnse85fdc72024-07-07 20:45:37 +02001817 hi def link vimMatch vimCommand
1818 hi def link vimMatchGroup vimGroup
1819 hi def link vimMatchNone vimGroup
dkearnsb614b282024-02-12 03:13:34 +11001820 hi def link vimMenuBang vimBang
dkearns62b26042024-03-10 03:43:28 +11001821 hi def link vimMenuClear Special
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001822 hi def link vimMenuMod vimMapMod
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001823 hi def link vimMenuName PreProc
dkearns62b26042024-03-10 03:43:28 +11001824 hi def link vimMenu vimCommand
1825 hi def link vimMenuNotation vimNotation
1826 hi def link vimMenuPriority Number
1827 hi def link vimMenuStatus Special
1828 hi def link vimMenutranslateComment vimComment
Doug Kearns818c6412024-10-06 17:00:48 +02001829 hi def link vim9MethodName vimFuncName
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001830 hi def link vimMtchComment vimComment
Doug Kearnsbbe52522024-11-09 19:11:25 +01001831 hi def link vimNormal vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001832 hi def link vimNotation Special
1833 hi def link vimNotFunc vimCommand
1834 hi def link vimNotPatSep vimString
1835 hi def link vimNumber Number
1836 hi def link vimOperError Error
1837 hi def link vimOper Operator
Doug Kearns1aa287e2025-02-10 22:00:27 +01001838 hi def link vimOperContinue vimContinue
1839 hi def link vimOperContinueComment vimContinueComment
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001840 hi def link vimOption PreProc
Doug Kearns1aa287e2025-02-10 22:00:27 +01001841 hi def link vimOptionVar Identifier
Doug Kearns3dca5122025-03-09 16:30:28 +01001842 hi def link vimOptionVarName Identifier
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001843 hi def link vimParenSep Delimiter
Bram Moolenaard2855f52018-07-31 22:23:58 +02001844 hi def link vimPatSepErr vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001845 hi def link vimPatSepR vimPatSep
1846 hi def link vimPatSep SpecialChar
1847 hi def link vimPatSepZone vimString
1848 hi def link vimPatSepZ vimPatSep
1849 hi def link vimPattern Type
1850 hi def link vimPlainMark vimMark
1851 hi def link vimPlainRegister vimRegister
Doug Kearns695522d2025-01-10 20:02:17 +01001852 hi def link vimQuoteEscape vimEscape
Doug Kearns2f5a8c02025-04-05 15:55:36 +02001853 hi def link vimRedir vimCommand
1854 hi def link vimRedirBang vimBang
1855 hi def link vimRedirFileOperator vimOper
1856 hi def link vimRedirRegisterOperator vimOper
1857 hi def link vimRedirVariableOperator vimOper
1858 hi def link vimRedirEnd Special
1859 hi def link vimRedirRegister vimRegister
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001860 hi def link vimRegister SpecialChar
1861 hi def link vimScriptDelim Comment
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001862 hi def link vimSearch vimString
Doug Kearnsc273f1a2025-01-20 21:53:01 +01001863 hi def link vimSearchDelim Delimiter
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001864 hi def link vimSep Delimiter
Doug Kearnsddbb6fe2024-07-24 20:21:22 +02001865 hi def link vimSet vimCommand
1866 hi def link vimSetAll vimOption
1867 hi def link vimSetBang vimBang
Doug Kearns2a6be832025-04-03 21:39:24 +02001868 hi def link vimSetComment vimComment
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001869 hi def link vimSetMod vimOption
Doug Kearnsddbb6fe2024-07-24 20:21:22 +02001870 hi def link vimSetSep vimSep
Doug Kearnsddbb6fe2024-07-24 20:21:22 +02001871 hi def link vimSetTermcap vimOption
dkearnsae321b52024-06-15 23:06:17 +10001872 hi def link vimShebang PreProc
Doug Kearns262e25e2024-06-14 20:16:35 +02001873 hi def link vimSleep vimCommand
1874 hi def link vimSleepArg Constant
1875 hi def link vimSleepBang vimBang
Doug Kearns9b171bd2025-04-10 19:59:22 +02001876 hi def link vimSort vimCommand
1877 hi def link vimSortBang vimBang
1878 hi def link vimSortOptions Special
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001879 hi def link vimSpecFile Identifier
1880 hi def link vimSpecFileMod vimSpecFile
1881 hi def link vimSpecial Type
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001882 hi def link vimStringCont vimString
1883 hi def link vimString String
Bram Moolenaard2855f52018-07-31 22:23:58 +02001884 hi def link vimStringEnd vimString
thincacf8695d2024-01-28 18:57:23 +01001885 hi def link vimStringInterpolationBrace vimEscape
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001886 hi def link vimSubst1 vimSubst
1887 hi def link vimSubstDelim Delimiter
1888 hi def link vimSubstFlags Special
1889 hi def link vimSubstSubstr SpecialChar
1890 hi def link vimSubstTwoBS vimString
1891 hi def link vimSubst vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001892 hi def link vimSynCase Type
Doug Kearns0fab8912025-03-10 21:04:53 +01001893 hi def link vimSyncCcomment Type
dkearnsc79646d2024-01-05 08:58:48 +11001894 hi def link vimSynCchar vimSynOption
1895 hi def link vimSynCcharValue Character
Doug Kearns0fab8912025-03-10 21:04:53 +01001896 hi def link vimSyncClear Type
1897 hi def link vimSyncFromstart Type
1898 hi def link vimSyncGroup vimGroupName
1899 hi def link vimSyncGroupName vimGroupName
1900 hi def link vimSyncKey Type
1901 hi def link vimSyncLinebreak Type
1902 hi def link vimSyncLinecont Type
1903 hi def link vimSyncLines Type
1904 hi def link vimSyncMatch Type
1905 hi def link vimSyncNone Type
1906 hi def link vimSynConceal Type
1907 hi def link vimSynContains vimSynOption
1908 hi def link vimSyncRegion Type
1909 hi def link vimSynFoldlevel Type
1910 hi def link vimSynIskeyword Type
1911 hi def link vimSynIskeywordSep Delimiter
1912 hi def link vimSynKeyContainedin vimSynContains
1913 hi def link vimSynKeyOpt vimSynOption
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001914 hi def link vimSynMtchGrp vimSynOption
1915 hi def link vimSynMtchOpt vimSynOption
1916 hi def link vimSynNextgroup vimSynOption
1917 hi def link vimSynNotPatRange vimSynRegPat
1918 hi def link vimSynOption Special
1919 hi def link vimSynPatRange vimString
Doug Kearns0fab8912025-03-10 21:04:53 +01001920 hi def link vimSynReg Type
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001921 hi def link vimSynRegOpt vimSynOption
1922 hi def link vimSynRegPat vimString
Doug Kearns0fab8912025-03-10 21:04:53 +01001923 hi def link vimSynSpell Type
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001924 hi def link vimSyntax vimCommand
1925 hi def link vimSynType vimSpecial
dkearnsa3bddb72024-06-14 01:48:10 +10001926 hi def link vimThrow vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001927 hi def link vimTodo Todo
Bram Moolenaar4d8f4762021-06-27 15:18:56 +02001928 hi def link vimType Type
dkearnsf6869212023-12-11 01:53:24 +11001929 hi def link vimUnlet vimCommand
dkearnsb614b282024-02-12 03:13:34 +11001930 hi def link vimUnletBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001931 hi def link vimUnmap vimMap
Doug Kearns520a2c72025-04-08 20:50:00 +02001932 hi def link vimUserCmd vimCommand
Doug Kearns3c07eb02024-09-02 10:03:37 +02001933 hi def link vimUserCmdAttrAddr vimSpecial
Doug Kearns520a2c72025-04-08 20:50:00 +02001934 hi def link vimUserCmdAttrComplete vimSpecial
1935 hi def link vimUserCmdAttrCompleteFunc vimVar
Doug Kearns3c07eb02024-09-02 10:03:37 +02001936 hi def link vimUserCmdAttrNargs vimSpecial
1937 hi def link vimUserCmdAttrRange vimSpecial
1938 hi def link vimUserCmdAttrKey vimUserCmdAttr
1939 hi def link vimUserCmdAttr Special
1940 hi def link vimUserCmdAttrError Error
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001941 hi def link vimUserCmdError Error
Doug Kearns3c07eb02024-09-02 10:03:37 +02001942 hi def link vimUserCmdKey vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001943 hi def link vimUserFunc Normal
Doug Kearns1aa287e2025-02-10 22:00:27 +01001944 hi def link vimVar Normal
Doug Kearns3dca5122025-03-09 16:30:28 +01001945 hi def link vimVarScope Identifier
Doug Kearns9b171bd2025-04-10 19:59:22 +02001946 hi def link vimVimgrep vimCommand
1947 hi def link vimVimgrepadd vimCommand
1948 hi def link vimVimgrepBang vimBang
1949 hi def link vimVimgrepFlags Special
Doug Kearns3dca5122025-03-09 16:30:28 +01001950 hi def link vimVimVar Identifier
1951 hi def link vimVimVarName Identifier
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001952 hi def link vimWarn WarningMsg
Doug Kearnsd65e58f2024-07-17 19:34:14 +02001953
Doug Kearns818c6412024-10-06 17:00:48 +02001954 hi def link vim9Abstract vimCommand
Doug Kearnsd65e58f2024-07-17 19:34:14 +02001955 hi def link vim9Boolean Boolean
Doug Kearns818c6412024-10-06 17:00:48 +02001956 hi def link vim9Class vimCommand
Doug Kearnsd65e58f2024-07-17 19:34:14 +02001957 hi def link vim9Comment Comment
1958 hi def link vim9CommentError vimError
1959 hi def link vim9CommentTitle PreProc
Doug Kearns1aa287e2025-02-10 22:00:27 +01001960 hi def link vim9ConstructorDefParam vimVar
Doug Kearnsd65e58f2024-07-17 19:34:14 +02001961 hi def link vim9Const vimCommand
Doug Kearns818c6412024-10-06 17:00:48 +02001962 hi def link vim9ContinueComment vimContinueComment
1963 hi def link vim9Enum vimCommand
1964 hi def link vim9Export vimCommand
1965 hi def link vim9Extends Keyword
Doug Kearnsd65e58f2024-07-17 19:34:14 +02001966 hi def link vim9Final vimCommand
1967 hi def link vim9For vimCommand
Doug Kearns1aa287e2025-02-10 22:00:27 +01001968 hi def link vim9ForInComment vim9Comment
Doug Kearns818c6412024-10-06 17:00:48 +02001969 hi def link vim9Implements Keyword
1970 hi def link vim9AbstractDef vimCommand
1971 hi def link vim9Interface vimCommand
Doug Kearns1aa287e2025-02-10 22:00:27 +01001972 hi def link vim9LambdaOperator vimOper
1973 hi def link vim9LambdaOperatorComment vim9Comment
Doug Kearns722fbd12025-03-28 19:36:37 +01001974 hi def link vim9LambdaParen vimParenSep
Doug Kearns1aa287e2025-02-10 22:00:27 +01001975 hi def link vim9LhsRegister vimLetRegister
1976 hi def link vim9LhsVariable vimVar
Doug Kearnsd65e58f2024-07-17 19:34:14 +02001977 hi def link vim9LineComment vimComment
Doug Kearns818c6412024-10-06 17:00:48 +02001978 hi def link vim9MethodDef vimCommand
Doug Kearnsdd3f1c02025-03-17 20:27:13 +01001979 hi def link vim9MethodDefComment vimDefComment
Doug Kearns818c6412024-10-06 17:00:48 +02001980 hi def link vim9MethodNameError vimFunctionError
Doug Kearnsd65e58f2024-07-17 19:34:14 +02001981 hi def link vim9Null Constant
Doug Kearns818c6412024-10-06 17:00:48 +02001982 hi def link vim9Public vimCommand
Doug Kearnsc273f1a2025-01-20 21:53:01 +01001983 hi def link vim9Search vimString
1984 hi def link vim9SearchDelim Delimiter
Doug Kearns818c6412024-10-06 17:00:48 +02001985 hi def link vim9Static vimCommand
1986 hi def link vim9Super Identifier
1987 hi def link vim9This Identifier
1988 hi def link vim9Type vimCommand
1989 hi def link vim9TypeEquals vimOper
Doug Kearnsd65e58f2024-07-17 19:34:14 +02001990 hi def link vim9Variable vimVar
Doug Kearns818c6412024-10-06 17:00:48 +02001991 hi def link vim9Var vimCommand
Doug Kearnsd65e58f2024-07-17 19:34:14 +02001992 hi def link vim9Vim9ScriptArg Special
Doug Kearns818c6412024-10-06 17:00:48 +02001993 hi def link vim9Vim9Script vimCommand
Doug Kearns025dc482025-02-23 15:48:52 +01001994
1995 hi def link vimCompilerSet vimCommand
1996 hi def link vimSynMenu vimCommand
1997 hi def link vimSynMenuPath vimMenuName
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001998endif
Bram Moolenaar071d4272004-06-13 20:20:40 +00001999
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00002000" Current Syntax Variable: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00002001let b:current_syntax = "vim"
Bram Moolenaar6be7f872012-01-20 21:08:56 +01002002
2003" ---------------------------------------------------------------------
2004" Cleanup: {{{1
Doug Kearnsd65e58f2024-07-17 19:34:14 +02002005delc Vim9
2006delc VimL
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002007delc VimFolda
Doug Kearns818c6412024-10-06 17:00:48 +02002008delc VimFoldc
2009delc VimFolde
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002010delc VimFoldf
Doug Kearnsce064932024-04-13 18:24:01 +02002011delc VimFoldh
2012delc VimFoldH
Doug Kearns818c6412024-10-06 17:00:48 +02002013delc VimFoldi
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002014delc VimFoldl
2015delc VimFoldm
2016delc VimFoldp
2017delc VimFoldP
2018delc VimFoldr
2019delc VimFoldt
Bram Moolenaar6be7f872012-01-20 21:08:56 +01002020let &cpo = s:keepcpo
dkearns04e53632024-04-11 06:18:37 +10002021unlet s:keepcpo s:vim9script
dkearns5d67aef2024-03-10 04:01:22 +11002022" vim:ts=18 fdm=marker ft=vim