blob: 10cefd332ba33b09aec8df0112ac5f6817a9cdd2 [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>
zeertzjq8311e7d2025-06-18 18:02:47 +02005" Last Change: 2025 Jun 18
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 Kearns51289202025-06-11 21:16:14 +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] 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] em[enu] 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] int[ro] ip[ut] is[earch] isp[lit] j[oin] ju[mps] kee[pmarks] keepj[umps] keepp[atterns] keepa[lt] l[ist] nextgroup=vimBang
38syn keyword vimCommand contained 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] lw[indow] ls m[ove] marks menut[ranslate] mes[sages] mk[exrc] mks[ession] mksp[ell] mkv[imrc] mkvie[w] mod[e] n[ext] nb[key] nbc[lose] nbs[tart] noa[utocmd] noh[lsearch] nos[wapfile] nu[mber] o[pen] ol[dfiles] on[ly] opt[ions] ow[nsyntax] p[rint] pa[ckadd] packl[oadall] pb[uffer] pc[lose] ped[it] nextgroup=vimBang
39syn keyword vimCommand contained po[p] pp[op] pre[serve] prev[ious] pro[mptfind] promptr[epl] ps[earch] pt[ag] ptN[ext] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] q[uit] quita[ll] qa[ll] r[ead] rec[over] red[o] redr[aw] redraws[tatus] redrawt[abline] redrawtabp[anel] reg[isters] res[ize] ret[ab] rew[ind] ri[ght] 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] 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] nextgroup=vimBang
40syn keyword vimCommand contained 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] 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] 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] nextgroup=vimBang
41syn keyword vimCommand contained 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
Doug Kearnsc29b5332025-04-26 20:14:15 +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 ise isexpand 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 skipwhite nextgroup=vimSetEqual,vimSetMod
54syn keyword vimOption contained 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 pythonthreedll pythonthreehome skipwhite nextgroup=vimSetEqual,vimSetMod
Naruhiko Nishinobe5bd4d2025-05-14 21:20:28 +020055syn keyword vimOption contained 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 stpl showtabpanel ss sidescroll siso sidescrolloff skipwhite nextgroup=vimSetEqual,vimSetMod
56syn keyword vimOption contained 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 tpl tabpanel tplo tabpanelopt ts tabstop tbs tagbsearch tc tagcase tfu tagfunc tl taglength tr tagrelative tag tags tgst tagstack tcldll term tbidi termbidi tenc termencoding 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 skipwhite nextgroup=vimSetEqual,vimSetMod
57syn keyword vimOption contained 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 write wa writeany skipwhite nextgroup=vimSetEqual,vimSetMod
58syn keyword vimOption contained wb writebackup wd writedelay xtermcodes skipwhite nextgroup=vimSetEqual,vimSetMod
Bram Moolenaar071d4272004-06-13 20:20:40 +000059
60" vimOptions: These are the turn-off setting variants {{{2
h-east9b53c052024-02-13 21:09:22 +010061" GEN_SYN_VIM: vimOption turn-off, START_STR='syn keyword vimOption contained', END_STR=''
62syn 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
63syn 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 +110064syn 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
65syn keyword vimOption contained nowb nowritebackup noxtermcodes
Bram Moolenaar071d4272004-06-13 20:20:40 +000066
67" vimOptions: These are the invertible variants {{{2
h-east9b53c052024-02-13 21:09:22 +010068" GEN_SYN_VIM: vimOption invertible, START_STR='syn keyword vimOption contained', END_STR=''
69syn 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
70syn 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
71syn 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 +110072syn 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 +000073" termcap codes (which can also be set) {{{2
Doug Kearnsddbb6fe2024-07-24 20:21:22 +020074" GEN_SYN_VIM: vimOption term output code, START_STR='syn keyword vimOption contained', END_STR='skipwhite nextgroup=vimSetEqual,vimSetMod'
75syn 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 +010076" term key codes
77syn 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 +010078syn match vimOption contained "t_%1"
Bram Moolenaar071d4272004-06-13 20:20:40 +000079syn match vimOption contained "t_#2"
80syn match vimOption contained "t_#4"
Bram Moolenaar6d5ad4c2016-10-27 17:00:16 +020081syn match vimOption contained "t_@7"
Bram Moolenaarb0d45e72017-11-05 18:19:24 +010082syn match vimOption contained "t_*7"
83syn match vimOption contained "t_&8"
84syn match vimOption contained "t_%i"
Bram Moolenaar071d4272004-06-13 20:20:40 +000085syn match vimOption contained "t_k;"
86
Doug Kearns3dca5122025-03-09 16:30:28 +010087" vimOptions: These are the variable names {{{2
88" GEN_SYN_VIM: vimOption normal variable, START_STR='syn keyword vimOptionVarName contained', END_STR=''
64-bitman88d41ab2025-04-06 17:20:39 +020089syn 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
90syn 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
91syn 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
Doug Kearnsc29b5332025-04-26 20:14:15 +020092syn 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 ise isexpand 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
93syn keyword vimOptionVarName contained mmt maxmemtot 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
94syn keyword vimOptionVarName contained pythondll pythonhome pythonthreedll pythonthreehome pyx pyxversion qftf quickfixtextfunc qe quoteescape ro readonly rdt redrawtime re regexpengine rnu relativenumber remap rop renderoptions report rs restorescreen ri revins rl rightleft rlc rightleftcmd rubydll ru ruler ruf rulerformat rtp runtimepath scr scroll scb scrollbind scf scrollfocus sj scrolljump so scrolloff 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
Naruhiko Nishinobe5bd4d2025-05-14 21:20:28 +020095syn keyword vimOptionVarName contained stal showtabline stpl showtabpanel ss sidescroll siso sidescrolloff scl signcolumn scs smartcase si smartindent sta smarttab sms smoothscroll sts softtabstop spell spc spellcapcheck spf spellfile spl spelllang spo spelloptions sps spellsuggest sb splitbelow spk splitkeep spr splitright sol startofline stl statusline su suffixes sua suffixesadd swf swapfile sws swapsync swb switchbuf smc synmaxcol syn syntax tcl tabclose tal tabline tpm tabpagemax tpl tabpanel tplo tabpanelopt ts tabstop tbs tagbsearch tc tagcase tfu tagfunc tl taglength tr tagrelative tag tags tgst tagstack tcldll term tbidi termbidi tenc termencoding tgc termguicolors twk termwinkey twsl termwinscroll tws termwinsize twt termwintype terse ta textauto tx textmode
96syn keyword vimOptionVarName contained tw textwidth tsr thesaurus tsrfu thesaurusfunc top tildeop to timeout tm timeoutlen title titlelen titleold titlestring tb toolbar tbis toolbariconsize ttimeout ttm ttimeoutlen tbi ttybuiltin tf ttyfast ttym ttymouse tsl ttyscroll tty ttytype udir undodir udf undofile ul undolevels ur undoreload uc updatecount ut updatetime vsts varsofttabstop vts vartabstop vbs verbose vfile verbosefile vdir viewdir vop viewoptions vi viminfo vif viminfofile ve virtualedit vb visualbell warn wiv weirdinvert ww whichwrap wc wildchar wcm wildcharm wig wildignore wic wildignorecase wmnu wildmenu wim wildmode wop wildoptions wak winaltkeys wcr wincolor wi window wfb winfixbuf wfh winfixheight wfw winfixwidth wh winheight wmh winminheight wmw winminwidth
97syn keyword vimOptionVarName contained winptydll wiw winwidth wrap wm wrapmargin ws wrapscan write wa writeany wb writebackup wd writedelay xtermcodes
Doug Kearns3dca5122025-03-09 16:30:28 +010098" GEN_SYN_VIM: vimOption term output code variable, START_STR='syn keyword vimOptionVarName contained', END_STR=''
99syn 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
100syn 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
101syn match vimOptionVarName contained "t_%1"
102syn match vimOptionVarName contained "t_#2"
103syn match vimOptionVarName contained "t_#4"
104syn match vimOptionVarName contained "t_@7"
105syn match vimOptionVarName contained "t_*7"
106syn match vimOptionVarName contained "t_&8"
107syn match vimOptionVarName contained "t_%i"
108syn match vimOptionVarName contained "t_k;"
109
Bram Moolenaar03413f42016-04-12 21:07:15 +0200110" unsupported settings: some were supported by vi but don't do anything in vim {{{2
h-east9b53c052024-02-13 21:09:22 +0100111" GEN_SYN_VIM: Missing vimOption, START_STR='syn keyword vimErrSetting contained', END_STR=''
112syn 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
113syn 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
114syn 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 +0000115
Bram Moolenaar80a94a52006-02-23 21:26:58 +0000116" AutoCmd Events {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000117syn case ignore
Doug Kearnsfa3b1042025-04-22 19:48:13 +0200118" GEN_SYN_VIM: vimAutoEvent, START_STR='syn keyword vimAutoEvent contained', END_STR='skipwhite nextgroup=vimAutoEventSep,@vimAutocmdPattern'
Doug Kearnsc29b5332025-04-26 20:14:15 +0200119syn keyword vimAutoEvent contained BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre CmdlineChanged CmdlineEnter CmdlineLeave CmdlineLeavePre CmdUndefined CmdwinEnter CmdwinLeave ColorScheme ColorSchemePre CompleteChanged CompleteDone CompleteDonePre CursorHold CursorHoldI CursorMoved CursorMovedC CursorMovedI DiffUpdated DirChanged DirChangedPre EncodingChanged ExitPre FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre skipwhite nextgroup=vimAutoEventSep,@vimAutocmdPattern
120syn keyword vimAutoEvent contained FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave InsertLeavePre KeyInputPre MenuPopup ModeChanged OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SafeState SafeStateAgain SessionLoadPost SessionWritePost ShellCmdPost ShellFilterPost SigUSR1 SourceCmd SourcePost SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabClosed TabClosedPre TabEnter TabLeave TabNew TermChanged TerminalOpen TerminalWinOpen TermResponse TermResponseAll TextChanged TextChangedI TextChangedP TextChangedT TextYankPost VimEnter VimLeave VimLeavePre VimResized VimResume VimSuspend WinClosed WinEnter WinLeave WinNew WinNewPre WinResized skipwhite nextgroup=vimAutoEventSep,@vimAutocmdPattern
121syn keyword vimAutoEvent contained WinScrolled skipwhite nextgroup=vimAutoEventSep,@vimAutocmdPattern
Doug Kearnsfa3b1042025-04-22 19:48:13 +0200122
123syn keyword vimAutoEvent contained User skipwhite nextgroup=vimUserAutoEvent
zeertzjq8311e7d2025-06-18 18:02:47 +0200124syn match vimUserAutoEvent contained "\<\h\w*\>" skipwhite nextgroup=vimUserAutoEventSep,vimAutocmdMod,vimAutocmdBlock
Bram Moolenaar071d4272004-06-13 20:20:40 +0000125
126" Highlight commonly used Groupnames {{{2
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200127syn 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 +0000128
129" Default highlighting groups {{{2
h-east9b53c052024-02-13 21:09:22 +0100130" GEN_SYN_VIM: vimHLGroup, START_STR='syn keyword vimHLGroup contained', END_STR=''
Naruhiko Nishinobe5bd4d2025-05-14 21:20:28 +0200131syn keyword vimHLGroup contained ErrorMsg IncSearch ModeMsg NonText StatusLine StatusLineNC EndOfBuffer VertSplit VisualNOS DiffText DiffTextAdd PmenuSbar TabLineSel TabLineFill TabPanel TabPanelSel TabPanelFill 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
132syn keyword vimHLGroup contained LineNrAbove LineNrBelow
Christian Brabandt393708c2024-05-27 15:50:07 +0200133syn match vimHLGroup contained "\<Conceal\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000134syn case match
135
136" Function Names {{{2
h-east9b53c052024-02-13 21:09:22 +0100137" GEN_SYN_VIM: vimFuncName, START_STR='syn keyword vimFuncName contained', END_STR=''
Doug Kearns8dec6c22025-01-19 14:02:06 +0100138syn 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
Doug Kearnsc29b5332025-04-26 20:14:15 +0200139syn keyword vimFuncName contained char2nr charclass charcol charidx chdir cindent clearmatches cmdcomplete_info col complete complete_add complete_check complete_info complete_match 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
140syn keyword vimFuncName contained get getbufinfo getbufline getbufoneline 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
141syn keyword vimFuncName contained histnr hlID hlexists hlget hlset hostname iconv id indent index indexof input inputdialog inputlist inputrestore inputsave inputsecret insert instanceof interrupt invert isabsolutepath isdirectory isinf islocked isnan items job_getchannel job_info job_setoptions job_start job_status job_stop join js_decode js_encode json_decode json_encode keys keytrans len libcall libcallnr line line2byte lispindent list2blob list2str list2tuple listener_add listener_flush listener_remove localtime log log10 luaeval map maparg mapcheck maplist mapnew mapset match matchadd matchaddpos matcharg matchbufline matchdelete matchend matchfuzzy matchfuzzypos matchlist matchstr matchstrlist matchstrpos max menu_info min mkdir mode mzeval nextnonblank
142syn keyword vimFuncName contained ngettext nr2char or pathshorten perleval popup_atcursor popup_beval popup_clear popup_close popup_create popup_dialog popup_filter_menu popup_filter_yesno popup_findecho popup_findinfo popup_findpreview popup_getoptions popup_getpos popup_hide popup_list popup_locate popup_menu popup_move popup_notification popup_setbuf popup_setoptions popup_settext popup_show pow 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
143syn keyword vimFuncName contained reltimefloat reltimestr remote_expr remote_foreground remote_peek remote_read remote_send remote_startserver remove rename repeat resolve reverse round rubyeval screenattr screenchar screenchars screencol screenpos screenrow screenstring search searchcount searchdecl searchpair searchpairpos searchpos server2client serverlist setbufline setbufvar setcellwidths setcharpos setcharsearch setcmdline setcmdpos setcursorcharpos setenv setfperm setline setloclist setmatches setpos setqflist setreg settabvar settabwinvar settagstack setwinvar sha256 shellescape shiftwidth sign_define sign_getdefined sign_getplaced sign_jump sign_place sign_placelist sign_undefine sign_unplace sign_unplacelist simplify sin sinh slice sort sound_clear sound_playevent
144syn keyword vimFuncName contained sound_playfile sound_stop soundfold spellbadword spellsuggest split sqrt srand state str2blob str2float str2list str2nr strcharlen strcharpart strchars strdisplaywidth strftime strgetchar stridx string strlen strpart strptime strridx strtrans strutf16len strwidth submatch substitute swapfilelist swapinfo swapname synID synIDattr synIDtrans synconcealed synstack system systemlist tabpagebuflist tabpagenr tabpagewinnr tagfiles taglist tan tanh tempname term_dumpdiff term_dumpload term_dumpwrite term_getaltscreen term_getansicolors term_getattr term_getcursor term_getjob term_getline term_getscrolled term_getsize term_getstatus term_gettitle term_gettty term_list term_scrape term_sendkeys term_setansicolors term_setapi term_setkill
145syn keyword vimFuncName contained term_setrestore term_setsize term_start term_wait terminalprops test_alloc_fail test_autochdir test_feedinput test_garbagecollect_now test_garbagecollect_soon test_getvalue test_gui_event test_ignore_error test_mswin_event test_null_blob test_null_channel test_null_dict test_null_function test_null_job test_null_list test_null_partial test_null_string test_null_tuple test_option_not_set test_override test_refcount test_setmouse test_settime test_srand_seed test_unknown test_void timer_info timer_pause timer_start timer_stop timer_stopall tolower toupper tr trim trunc tuple2list type typename undofile undotree uniq utf16idx values virtcol virtcol2col visualmode wildmenumode win_execute win_findbuf win_getid win_gettype win_gotoid
146syn keyword vimFuncName contained win_id2tabwin win_id2win win_move_separator win_move_statusline win_screenpos win_splitmove winbufnr wincol windowsversion winheight winlayout winline winnr winrestcmd winrestview winsaveview winwidth wordcount writefile xor
Doug Kearns3dca5122025-03-09 16:30:28 +0100147" Predefined variable names {{{2
148" GEN_SYN_VIM: vimVarName, START_STR='syn keyword vimVimVarName contained', END_STR=''
149syn 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 +0100150syn 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 +0000151
Doug Kearns3dca5122025-03-09 16:30:28 +0100152"--- syntax here and above generated by runtime/syntax/generator/gen_syntax_vim.vim ---
153
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000154" Special Vim Highlighting (not automatic) {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000155
Doug Kearns3dca5122025-03-09 16:30:28 +0100156" Neovim keyword list additions {{{2
157
158if s:has("nvim")
159 syn keyword vimOptionVarName contained channel inccommand mousescroll pumblend redrawdebug scrollback shada shadafile statuscolumn termpastefilter termsync winbar winblend winhighlight
160 syn keyword vimVimVarName contained lua msgpack_types relnum stderr termrequest virtnum
161endif
162
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200163" Set up commands for this syntax highlighting file {{{2
164
165com! -nargs=* Vim9 execute <q-args> s:vim9script ? "" : "contained"
166com! -nargs=* VimL execute <q-args> s:vim9script ? "contained" : ""
167
Doug Kearns818c6412024-10-06 17:00:48 +0200168if exists("g:vimsyn_folding") && g:vimsyn_folding =~# '[acefhiHlmpPrt]'
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200169 if g:vimsyn_folding =~# 'a'
170 com! -nargs=* VimFolda <args> fold
171 else
172 com! -nargs=* VimFolda <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100173 endif
Doug Kearns818c6412024-10-06 17:00:48 +0200174 if g:vimsyn_folding =~# 'c'
175 com! -nargs=* VimFoldc <args> fold
176 else
177 com! -nargs=* VimFoldc <args>
178 endif
179 if g:vimsyn_folding =~# 'e'
180 com! -nargs=* VimFolde <args> fold
181 else
182 com! -nargs=* VimFolde <args>
183 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200184 if g:vimsyn_folding =~# 'f'
185 com! -nargs=* VimFoldf <args> fold
186 else
187 com! -nargs=* VimFoldf <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100188 endif
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100189 if g:vimsyn_folding =~# 'h'
190 com! -nargs=* VimFoldh <args> fold
191 else
192 com! -nargs=* VimFoldh <args>
193 endif
Doug Kearnsce064932024-04-13 18:24:01 +0200194 if g:vimsyn_folding =~# 'H'
195 com! -nargs=* VimFoldH <args> fold
196 else
197 com! -nargs=* VimFoldH <args>
198 endif
Doug Kearns818c6412024-10-06 17:00:48 +0200199 if g:vimsyn_folding =~# 'i'
200 com! -nargs=* VimFoldi <args> fold
201 else
202 com! -nargs=* VimFoldi <args>
203 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200204 if g:vimsyn_folding =~# 'l'
205 com! -nargs=* VimFoldl <args> fold
206 else
207 com! -nargs=* VimFoldl <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100208 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200209 if g:vimsyn_folding =~# 'm'
210 com! -nargs=* VimFoldm <args> fold
211 else
212 com! -nargs=* VimFoldm <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100213 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200214 if g:vimsyn_folding =~# 'p'
215 com! -nargs=* VimFoldp <args> fold
216 else
217 com! -nargs=* VimFoldp <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100218 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200219 if g:vimsyn_folding =~# 'P'
220 com! -nargs=* VimFoldP <args> fold
221 else
222 com! -nargs=* VimFoldP <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100223 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200224 if g:vimsyn_folding =~# 'r'
225 com! -nargs=* VimFoldr <args> fold
226 else
227 com! -nargs=* VimFoldr <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100228 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200229 if g:vimsyn_folding =~# 't'
230 com! -nargs=* VimFoldt <args> fold
231 else
232 com! -nargs=* VimFoldt <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100233 endif
234else
235 com! -nargs=* VimFolda <args>
Doug Kearns818c6412024-10-06 17:00:48 +0200236 com! -nargs=* VimFoldc <args>
237 com! -nargs=* VimFolde <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100238 com! -nargs=* VimFoldf <args>
Doug Kearns818c6412024-10-06 17:00:48 +0200239 com! -nargs=* VimFoldi <args>
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100240 com! -nargs=* VimFoldh <args>
Doug Kearnsce064932024-04-13 18:24:01 +0200241 com! -nargs=* VimFoldH <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100242 com! -nargs=* VimFoldl <args>
243 com! -nargs=* VimFoldm <args>
244 com! -nargs=* VimFoldp <args>
245 com! -nargs=* VimFoldP <args>
246 com! -nargs=* VimFoldr <args>
247 com! -nargs=* VimFoldt <args>
248endif
249
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000250" Deprecated variable options {{{2
251if exists("g:vim_minlines")
252 let g:vimsyn_minlines= g:vim_minlines
253endif
254if exists("g:vim_maxlines")
255 let g:vimsyn_maxlines= g:vim_maxlines
256endif
257if exists("g:vimsyntax_noerror")
258 let g:vimsyn_noerror= g:vimsyntax_noerror
259endif
260
Bram Moolenaar03413f42016-04-12 21:07:15 +0200261" Variable options {{{2
262if exists("g:vim_maxlines")
263 let s:vimsyn_maxlines= g:vim_maxlines
264else
265 let s:vimsyn_maxlines= 60
266endif
267
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200268" Nulls {{{2
269" =====
270Vim9 syn keyword vim9Null null null_blob null_channel null_class null_dict null_function null_job null_list null_object null_partial null_string
271
272" Booleans {{{2
273" ========
274Vim9 syn keyword vim9Boolean true false
275
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000276" Numbers {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000277" =======
dkearns5cd86c62024-03-12 07:40:58 +1100278syn case ignore
Doug Kearnse957cba2025-05-04 21:01:18 +0200279syn match vimNumber "\<\d\+\%('\d\+\)*" skipwhite nextgroup=@vimComment,vimSubscript,vimGlobal,vimSubst1
280syn match vimNumber "\<\d\+\%('\d\+\)*\.\d\+\%(e[+-]\=\d\+\)\=" skipwhite nextgroup=@vimComment
281syn match vimNumber "\<0b[01]\+\%('[01]\+\)*" skipwhite nextgroup=@vimComment,vimSubscript
282syn match vimNumber "\<0o\=\o\+\%('\o\+\)*" skipwhite nextgroup=@vimComment,vimSubscript
283syn match vimNumber "\<0x\x\+\%('\x\+\)*" skipwhite nextgroup=@vimComment,vimSubscript
284syn match vimNumber '\<0z\>' skipwhite nextgroup=@vimComment
285syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=@vimComment,vimSubscript
dkearns5cd86c62024-03-12 07:40:58 +1100286syn case match
Bram Moolenaar071d4272004-06-13 20:20:40 +0000287
Bram Moolenaar6c1e1572019-06-22 02:13:00 +0200288" All vimCommands are contained by vimIsCommand. {{{2
Doug Kearns51289202025-06-11 21:16:14 +0200289syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutocmd,vimAugroup,vimBehave,vimCall,vimCatch,vimConst,vimDoautocmd,vimDebuggreedy,vimDef,vimDefFold,vimDelcommand,vimDelFunction,@vimEcho,vimElse,vimEnddef,vimEndfunction,vimEndif,vimExecute,vimIsCommand,vimExtCmd,vimExFilter,vimExMark,vimFor,vimFunction,vimFunctionFold,vimGrep,vimGrepAdd,vimGlobal,vimHelpgrep,vimHighlight,vimImport,vimLet,vimLoadkeymap,vimLockvar,vimMake,vimMap,vimMark,vimMatch,vimNotFunc,vimNormal,vimProfdel,vimProfile,vimRedir,vimSet,vimSleep,vimSort,vimSyntax,vimThrow,vimUnlet,vimUnlockvar,vimUnmap,vimUserCmd,vimVimgrep,vimVimgrepadd,vimMenu,vimMenutranslate,@vim9CmdList,@vimExUserCmdList,vimLua,vimMzScheme,vimPerl,vimPython,vimPython3,vimPythonX,vimRuby,vimTcl
h-east61397662025-01-03 17:32:54 +0100290syn cluster vim9CmdList contains=vim9Abstract,vim9Class,vim9Const,vim9Enum,vim9Export,vim9Final,vim9For,vim9Interface,vim9Type,vim9Var
Doug Kearns60bd1402025-02-27 19:15:20 +0100291syn match vimCmdSep "\\\@1<!|" skipwhite nextgroup=@vimCmdList,vimSubst1,vimFunc
292syn match vimCmdSep ":\+" skipwhite nextgroup=@vimCmdList,vimSubst1
Doug Kearns4a530a62025-02-03 18:59:09 +0100293syn match vimCount contained "\d\+"
Doug Kearns1718e7d2025-01-08 18:20:47 +0100294syn match vimIsCommand "\<\%(\h\w*\|[23]mat\%[ch]\)\>" nextgroup=vimBang contains=vimCommand
Doug Kearns3c07eb02024-09-02 10:03:37 +0200295syn match vimBang contained "!"
Doug Kearnsc29b5332025-04-26 20:14:15 +0200296syn match vimWhitespace contained "\s\+"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000297
Doug Kearns1aa287e2025-02-10 22:00:27 +0100298syn region vimSubscript contained matchgroup=vimSubscriptBracket start="\[" end="]" nextgroup=vimSubscript contains=@vimExprList
299
300syn match vimVar contained "\<\h[a-zA-Z0-9#_]*\>" nextgroup=vimSubscript contains=vim9Super,vim9This
Doug Kearns3dca5122025-03-09 16:30:28 +0100301syn match vimVar "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>" nextgroup=vimSubscript contains=vimVarScope
302syn match vimVar "\<a:\%(000\|1\=[0-9]\|20\)\>" nextgroup=vimSubscript contains=vimVarScope
303syn match vimFBVar contained "\<[bwglsta]:\h[a-zA-Z0-9#_]*\>" nextgroup=vimSubscript contains=vimVarScope
Doug Kearns1aa287e2025-02-10 22:00:27 +0100304
Doug Kearns3dca5122025-03-09 16:30:28 +0100305" match the scope prefix independently of the retrofitted scope dictionary
306syn match vimVarScope contained "\<[bwglstav]:"
307syn match vimVimVar contained "\<[bwglstav]:\%(\h\|\d\)\@!" nextgroup=vimSubscript
308
309syn match vimVarNameError contained "\<\h\w*\>"
310syn match vimVimVar "\<v:" nextgroup=vimSubscript,vimVimVarName,vimVarNameError
311syn match vimOptionVar "&\%([lg]:\)\=" nextgroup=vimSubscript,vimOptionVarName,vimVarNameError
Doug Kearns1aa287e2025-02-10 22:00:27 +0100312syn cluster vimSpecialVar contains=vimEnvvar,vimLetRegister,vimOptionVar,vimVimVar
313
Doug Kearns274efcc2025-06-10 21:02:43 +0200314Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s\+[-+/*%]\=="
315Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s\+\.\.="
316Vim9 syn match vim9LhsVariable "\s\=\%([bwgt]:\)\=\h[a-zA-Z0-9#_]*\ze\s\+=<<" skipwhite nextgroup=vimLetHeredoc contains=vimVarScope
317Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\[" nextgroup=vimSubscript
318Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\." nextgroup=vimOper contains=vim9Super,vim9This
319Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s*->" contains=vim9Super,vim9This
Doug Kearns1aa287e2025-02-10 22:00:27 +0100320
Doug Kearns274efcc2025-06-10 21:02:43 +0200321Vim9 syn match vim9LhsVariableList "\[\_[^]]\+]\ze\s\+[-+/*%]\==" contains=vimVar,@vimSpecialVar
322Vim9 syn match vim9LhsVariableList "\[\_[^]]\+]\ze\s\+=<<" skipwhite nextgroup=vimLetHeredoc contains=vimVar,@vimSpecialVar
323Vim9 syn match vim9LhsVariableList "\[\_[^]]\+]\ze\s\+\.\.=" contains=vimVar,@vimSpecialVar
Doug Kearns1aa287e2025-02-10 22:00:27 +0100324
325Vim9 syn match vim9LhsRegister "@["0-9\-a-zA-Z#=*+_/]\ze\s\+\%(\.\.\)\=="
326
327syn cluster vimExprList contains=@vimSpecialVar,vimFunc,vimNumber,vimOper,vimOperParen,vimLambda,vimString,vimVar,@vim9ExprList
328syn cluster vim9ExprList contains=vim9Boolean,vim9LambdaParams,vim9Null
dkearnsb1427b42024-02-28 05:59:30 +1100329
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000330" Insertions And Appends: insert append {{{2
Bram Moolenaar519cc552021-11-16 19:18:26 +0000331" (buftype != nofile test avoids having append, change, insert show up in the command window)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000332" =======================
Bram Moolenaar519cc552021-11-16 19:18:26 +0000333if &buftype != 'nofile'
dkearns4ba70ca2024-04-15 04:32:56 +1000334 syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=a\%[ppend]$" matchgroup=vimCommand end="^\.$" extend
335 syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=c\%[hange]$" matchgroup=vimCommand end="^\.$" extend
336 syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=i\%[nsert]$" matchgroup=vimCommand end="^\.$" extend
Bram Moolenaar519cc552021-11-16 19:18:26 +0000337endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000338
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000339" Behave! {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000340" =======
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100341if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_nobehaveerror")
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000342 syn match vimBehaveError contained "[^ ]\+"
343endif
Doug Kearnsfe6d5b02024-02-14 21:17:43 +0100344syn match vimBehave "\<be\%[have]\>" nextgroup=vimBehaveBang,vimBehaveModel,vimBehaveError skipwhite
345syn match vimBehaveBang contained "\a\@1<=!" nextgroup=vimBehaveModel skipwhite
346syn keyword vimBehaveModel contained mswin xterm
Bram Moolenaar071d4272004-06-13 20:20:40 +0000347
Doug Kearns99984fc2024-07-18 20:45:19 +0200348" Call {{{2
349" ====
350syn match vimCall "\<call\=\>" skipwhite nextgroup=vimFunc
351
Doug Kearnsa9c06422025-02-12 20:44:17 +0100352" Debuggreedy {{{2
Doug Kearns4a530a62025-02-03 18:59:09 +0100353" ===========
354" TODO: special-cased until generalised range/count support is implemented
355syn match vimDebuggreedy "\<0\=debugg\%[reedy]\>" contains=vimCount
356
dkearnsa3bddb72024-06-14 01:48:10 +1000357" Exception Handling {{{2
358syn keyword vimThrow th[row] skipwhite nextgroup=@vimExprList
359syn keyword vimCatch cat[ch] skipwhite nextgroup=vimCatchPattern
360syn region vimCatchPattern contained matchgroup=Delimiter start="\z([!#$%&'()*+,-./:;<=>?@[\]^_`{}~]\)" skip="\\\\\|\\\z1" end="\z1" contains=@vimSubstList oneline
361
Doug Kearns818c6412024-10-06 17:00:48 +0200362" Export {{{2
363" ======
364if s:vim9script
365 syn keyword vim9Export export skipwhite nextgroup=vim9Abstract,vim9ClassBody,vim9Const,vim9Def,vim9EnumBody,vim9Final,vim9InterfaceBody,vim9Type,vim9Var
366endif
367
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000368" Filetypes {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000369" =========
Bram Moolenaar293ee4d2004-12-09 21:34:53 +0000370syn match vimFiletype "\<filet\%[ype]\(\s\+\I\i*\)*" skipwhite contains=vimFTCmd,vimFTOption,vimFTError
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100371if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_vimFTError")
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000372 syn match vimFTError contained "\I\i*"
373endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000374syn keyword vimFTCmd contained filet[ype]
375syn keyword vimFTOption contained detect indent off on plugin
376
Doug Kearns7b5550f2025-05-18 20:37:34 +0200377" Import {{{2
378" ======
379syn keyword vimImportAutoload contained autoload skipwhite nextgroup=vimImportFilename
380if s:vim9script
381 syn region vimImportFilename contained
382 \ start="\S"
383 \ skip=+\%#=1
384 "\ continuation operators at SOL
385 \\n\%(\s*#.*\n\)*\s*\%([[:punct:]]\+\&[^#"'(]\)
386 \\|
387 "\ continuation operators at EOL
388 \\%(\%([[:punct:]]\+\&[^#"')]\)\s*\%(#.*\)\=\)\@<=$
389 \\|
390 \\n\%(\s*#.*\n\)*\s*as\s
391 \\|
392 \\%(^\s*#.*\)\@<=$
393 \\|
Eisuke Kawashima6acca4b2025-06-07 17:55:58 +0200394 \\n\s*\\\|\n\s*#\\
Doug Kearns7b5550f2025-05-18 20:37:34 +0200395 \+
396 \ matchgroup=vimCommand
397 \ end="\s\+\zsas\ze\s\+\h"
398 \ matchgroup=NONE
399 \ end="$"
400 \ skipwhite nextgroup=vimImportName
401 \ contains=@vim9Continue,@vimExprList,vim9Comment
402 \ transparent
403else
404 syn region vimImportFilename contained
405 \ start="\S"
406 \ skip=+\n\s*\\\|\n\s*"\\ +
407 \ matchgroup=vimCommand
408 \ end="\s\+\zsas\ze\s\+\h"
409 \ matchgroup=NONE
410 \ end="$"
411 \ skipwhite nextgroup=vimImportName
412 \ contains=@vimContinue,@vimExprList
413 \ transparent
414endif
415syn match vimImportName contained "\%(\<as\s\+\)\@<=\h\w*\>" skipwhite nextgroup=@vimComment
416syn match vimImport "\<imp\%[ort]\>" skipwhite nextgroup=vimImportAutoload,vimImportFilename
417
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000418" Augroup : vimAugroupError removed because long augroups caused sync'ing problems. {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000419" ======= : Trade-off: Increasing synclines with slower editing vs augroup END error checking.
Doug Kearns1aa287e2025-02-10 22:00:27 +0100420syn cluster vimAugroupList contains=@vimCmdList,vimFilter,vimFunc,vimLineComment,vimSpecFile,vimOper,vimNumber,vimOperParen,@vimComment,vimString,vimSubst,vimRegister,vimCmplxRepeat,vimNotation,vimCtrlChar,vimContinue
Doug Kearnsfa3b1042025-04-22 19:48:13 +0200421
422" define
423VimFolda syn region vimAugroup
424 \ start="\<aug\%[roup]\>\ze\s\+\%([eE][nN][dD]\)\@!\S\+"
425 \ matchgroup=vimAugroupKey
426 \ end="\<aug\%[roup]\>\ze\s\+[eE][nN][dD]\>"
427 \ skipwhite nextgroup=vimAugroupEnd
428 \ contains=vimAutocmd,@vimAugroupList,vimAugroupkey
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100429if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noaugrouperror")
Doug Kearnsfa3b1042025-04-22 19:48:13 +0200430 syn match vimAugroupError "\<aug\%[roup]\>\s\+[eE][nN][dD]\>"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000431endif
dkearnsc4aef9a2024-03-04 02:42:47 +1100432
Doug Kearnsfa3b1042025-04-22 19:48:13 +0200433" TODO: Vim9 comment
434syn match vimAugroupName contained "\%(\\["|[:space:]]\|[^"|[:space:]]\)\+"
Doug Kearnsc29b5332025-04-26 20:14:15 +0200435 \ skipwhite nextgroup=vimCmdSep,vimComment
436syn match vimAugroupEnd contained "\c\<END\>" skipwhite nextgroup=vimCmdSep,vimComment
Doug Kearnsfa3b1042025-04-22 19:48:13 +0200437syn match vimAugroupBang contained "\a\@1<=!" skipwhite nextgroup=vimAugroupName
438syn keyword vimAugroupKey contained aug[roup] skipwhite nextgroup=vimAugroupBang,vimAugroupName,vimAugroupEnd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000439
Doug Kearnsfa3b1042025-04-22 19:48:13 +0200440" remove
Eisuke Kawashima6acca4b2025-06-07 17:55:58 +0200441syn match vimAugroup "\<aug\%[roup]!" skipwhite nextgroup=vimAugroupName contains=vimAugroupKey,vimAugroupBang
Doug Kearnsfa3b1042025-04-22 19:48:13 +0200442
443" list
444VimL syn match vimAugroup "\<aug\%[roup]\>\ze\s*\%(["|]\|$\)" skipwhite nextgroup=vimCmdSep,vimComment contains=vimAugroupKey
445Vim9 syn match vimAugroup "\<aug\%[roup]\>\ze\s*\%([#|]\|$\)" skipwhite nextgroup=vimCmdSep,vim9Comment contains=vimAugroupKey
446
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000447" Operators: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000448" =========
Doug Kearnsb9ffbf52025-04-27 19:17:06 +0200449syn cluster vimOperGroup contains=@vimContinue,@vimExprList,vim9Comment,vim9LineComment,vimContinueString
Doug Kearns1aa287e2025-02-10 22:00:27 +0100450syn match vimOper "\a\@<!!" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimSpecFile
451syn match vimOper "||\|&&\|[-+*/%.]" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimSpecFile
Doug Kearnsc29b5332025-04-26 20:14:15 +0200452syn match vimOper "?" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimContinueString
Doug Kearnsc273f1a2025-01-20 21:53:01 +0100453" distinguish ternary : from ex-colon
Doug Kearnsc29b5332025-04-26 20:14:15 +0200454syn match vimOper "\s\@1<=:\ze\s\|\s\@1<=:$" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimContinueString
455syn match vimOper "??" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimContinueString
456syn match vimOper "=" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimContinueString,vimSpecFile
457syn match vimOper "\%#=1\%(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\)[?#]\=" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimContinueString,vimSpecFile
458syn match vimOper "\<is\%(not\)\=\>" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimContinueString,vimSpecFile
459syn match vimOper "\<is\%(not\)\=[?#]" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimContinueString,vimSpecFile
Doug Kearns1aa287e2025-02-10 22:00:27 +0100460syn region vimOperParen matchgroup=vimParenSep start="(" end=")" contains=@vimOperGroup nextgroup=vimSubscript
461syn region vimOperParen matchgroup=vimSep start="#\={" end="}" contains=@vimOperGroup nextgroup=vimSubscript,vimVar
462syn region vimOperParen contained matchgroup=vimSep start="\[" end="]" contains=@vimOperGroup nextgroup=vimSubscript,vimVar
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100463if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noopererror")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100464 syn match vimOperError ")"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000465endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000466
Doug Kearnsc29b5332025-04-26 20:14:15 +0200467syn match vimOperContinue contained "^\s*\\" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList contains=vimWhitespace
468syn match vimOperContinueComment contained '^\s*["#]\\ .*' skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList contains=vimWhitespace
Doug Kearns1aa287e2025-02-10 22:00:27 +0100469syn cluster vimOperContinue contains=vimOperContinue,vimOperContinueComment
470
471" Lambda Expressions: {{{2
472" ==================
473syn match vimLambdaOperator contained "->" skipwhite nextgroup=@vimExprList
Doug Kearns722fbd12025-03-28 19:36:37 +0100474syn region vimLambda contained
475 \ matchgroup=vimLambdaBrace
476 \ start=+{\ze[[:space:][:alnum:]_.,]*\%(\n\s*\%(\\[[:space:][:alnum:]_.,]*\|"\\ .*\)\)*->+
477 \ skip=+\n\s*\%(\\\|"\\ \)+
478 \ end="}" end="$"
479 \ contains=@vimContinue,@vimExprList,vimLambdaParams
Doug Kearns51289202025-06-11 21:16:14 +0200480syn match vimLambdaParams contained "\%({\n\=\)\@1<=\_.\{-}\%(->\)\@=" nextgroup=vimLambdaOperator contains=@vimContinue,vimFunctionParam
Doug Kearns1aa287e2025-02-10 22:00:27 +0100481
Doug Kearns722fbd12025-03-28 19:36:37 +0100482syn match vim9LambdaOperator contained "=>" skipwhite skipempty nextgroup=@vimExprList,vim9LambdaBlock,vim9LambdaOperatorComment
483syn match vim9LambdaParen contained "[()]"
484syn match vim9LambdaParams contained
485 \ "(\%(\<func(\|[^(]\)*\%(\n\s*\\\%(\<func(\|[^(]\)*\|\n\s*#\\ .*\)*\ze\s\+=>"
486 \ skipwhite nextgroup=vim9LambdaOperator
487 \ contains=@vim9Continue,vimDefParam,vim9LambdaParen,vim9LambdaReturnType
488syn region vim9LambdaReturnType contained start=")\@<=:\s" end="\ze\s*#" end="\ze\s*=>" contains=@vim9Continue,@vimType transparent
489syn region vim9LambdaBlock contained matchgroup=vimSep start="{" end="^\s*\zs}" contains=@vimDefBodyList
Doug Kearns1aa287e2025-02-10 22:00:27 +0100490
491syn match vim9LambdaOperatorComment contained "#.*" skipwhite skipempty nextgroup=@vimExprList,vim9LambdaBlock,vim9LambdaOperatorComment
492
dkearns4ba70ca2024-04-15 04:32:56 +1000493" Functions: Tag is provided for those who wish to highlight tagged functions {{{2
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000494" =========
Doug Kearns51289202025-06-11 21:16:14 +0200495syn cluster vimFunctionBodyCommon contains=@vimCmdList,vimCmplxRepeat,vimContinue,vimCtrlChar,vimDef,vimFBVar,vimFunc,vimFunction,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegister,vimSpecFile,vimString,vimSubst,vimFunctionFold,vimDefFold,vimCmdSep
496syn cluster vimFunctionBodyList contains=@vimFunctionBodyCommon,vimComment,vimLineComment,vimInsert,vimConst,vimLet,vimSearch
497syn cluster vimDefBodyList contains=@vimFunctionBodyCommon,vim9Comment,vim9LineComment,vim9Block,vim9Const,vim9Final,vim9Var,vim9Null,vim9Boolean,vim9For,vim9LhsVariable,vim9LhsVariableList,vim9LhsRegister,vim9Search,@vimSpecialVar
dkearns4ba70ca2024-04-15 04:32:56 +1000498
Doug Kearns51289202025-06-11 21:16:14 +0200499syn region vimFunctionPattern contained
500 \ matchgroup=vimOper
501 \ start="/"
Doug Kearnsdd3f1c02025-03-17 20:27:13 +0100502 \ end="$"
Doug Kearns51289202025-06-11 21:16:14 +0200503 \ contains=@vimSubstList
504
505syn match vimFunctionBang contained "\a\@1<=!" skipwhite nextgroup=vimFunctionName
506syn match vimDefBang contained "\a\@1<=!" skipwhite nextgroup=vimDefName
507syn match vimFunctionSID contained "\c<sid>"
508syn match vimFunctionScope contained "\<[bwglstav]:"
509syn match vimFunctionName contained
510 \ "\%(<[sS][iI][dD]>\|[bwglstav]:\)\=\%([[:alnum:]_#.]\+\|{.\{-1,}}\)\+"
511 \ skipwhite nextgroup=vimFunctionParams,vimCmdSep,vimComment,vim9Comment
512 \ contains=vimFunctionError,vimFunctionScope,vimFunctionSID,Tag
513syn match vimDefName contained
514 \ "\%(<[sS][iI][dD]>\|[bwglstav]:\)\=\%([[:alnum:]_#.]\+\|{.\{-1,}}\)\+"
515 \ nextgroup=vimDefParams,vimCmdSep,vimComment,vim9Comment
516 \ contains=vimFunctionError,vimFunctionScope,vimFunctionSID,Tag
517
518syn match vimFunction "\<fu\%[nction]\>" skipwhite nextgroup=vimFunctionBang,vimFunctionName,vimFunctionPattern,vimCmdSep,vimComment
519syn match vimDef "\<def\>" skipwhite nextgroup=vimDefBang,vimDefName,vimFunctionPattern,vimCmdSep,vimComment
520
521syn region vimFunctionComment contained
522 \ start=+".*+
523 \ skip=+\n\s*\%(\\\|"\\ \)+
524 \ end="$"
525 \ skipwhite skipempty nextgroup=vimFunctionBody,vimEndfunction
Doug Kearnsdd3f1c02025-03-17 20:27:13 +0100526syn region vimDefComment contained
527 \ start="#.*"
Doug Kearns51289202025-06-11 21:16:14 +0200528 \ skip=+\n\s*\%(\\\|#\\ \)+
Doug Kearnsdd3f1c02025-03-17 20:27:13 +0100529 \ end="$"
530 \ skipwhite skipempty nextgroup=vimDefBody,vimEnddef
dkearns35e6f4c2024-03-22 06:41:10 +1100531
Doug Kearns51289202025-06-11 21:16:14 +0200532syn region vimFunctionParams contained
533 \ matchgroup=Delimiter
534 \ start="("
535 \ skip=+\n\s*\%(\\\|"\\ \)+
536 \ end=")"
537 \ skipwhite skipempty nextgroup=vimFunctionBody,vimFunctionComment,vimEndfunction,vimFunctionMod,vim9CommentError
538 \ contains=vimFunctionParam,vimOperParen,@vimContinue
539syn region vimDefParams contained
540 \ matchgroup=Delimiter
541 \ start="("
542 \ end=")"
543 \ skipwhite skipempty nextgroup=vimDefBody,vimDefComment,vimEnddef,vimReturnType,vimCommentError
544 \ contains=vimDefParam,vim9Comment,vimFunctionParamEquals,vimOperParen
545syn match vimFunctionParam contained "\<\h\w*\>\|\.\.\." skipwhite nextgroup=vimFunctionParamEquals
546syn match vimDefParam contained "\<\h\w*\>" skipwhite nextgroup=vimParamType,vimFunctionParamEquals
dkearns35e6f4c2024-03-22 06:41:10 +1100547
Doug Kearns51289202025-06-11 21:16:14 +0200548syn match vimFunctionParamEquals contained "=" skipwhite nextgroup=@vimExprList
549syn match vimFunctionMod contained "\<\%(abort\|closure\|dict\|range\)\>" skipwhite skipempty nextgroup=vimFunctionBody,vimFunctionComment,vimEndfunction,vimFunctionMod,vim9CommentError
dkearns35e6f4c2024-03-22 06:41:10 +1100550
Doug Kearns51289202025-06-11 21:16:14 +0200551syn region vimFunctionBody contained
552 \ start="^."
553 \ matchgroup=vimCommand
554 \ end="\<endfu\%[nction]\>"
555 \ skipwhite nextgroup=vimCmdSep,vimComment,vim9CommentError
556 \ contains=@vimFunctionBodyList
557syn region vimDefBody contained
558 \ start="^."
559 \ matchgroup=vimCommand
560 \ end="\<enddef\>"
561 \ skipwhite nextgroup=vimCmdSep,vim9Comment,vimCommentError
562 \ contains=@vimDefBodyList
dkearns35e6f4c2024-03-22 06:41:10 +1100563
Doug Kearns51289202025-06-11 21:16:14 +0200564syn match vimEndfunction "\<endf\%[unction]\>" skipwhite nextgroup=vimCmdSep,vimComment,vim9CommentError
565syn match vimEnddef "\<enddef\>" skipwhite nextgroup=vimCmdSep,vim9Comment,vimCommentError
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000566
Bram Moolenaarf3913272016-02-25 00:00:01 +0100567if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f'
Doug Kearns51289202025-06-11 21:16:14 +0200568 syn region vimFunctionFold
569 \ start="\<fu\%[nction]!"
570 "\ assume no dict literal in curly-brace name expressions
571 \ start="\<fu\%[nction]\>\s*\%([[:alnum:]_:<>.#]\+\|{.\{-1,}}\)\+\s*("
572 \ end="^\s*:\=\s*endf\%[unction]\>"
573 \ contains=vimFunction
574 \ extend fold keepend transparent
575 syn region vimDefFold
576 \ start="\<def!"
577 "\ assume no dict literal in curly-brace name expressions
578 \ start="\<def\>\s*\%([[:alnum:]_:<>.#]\+\|{.\{-1,}}\)\+("
579 \ end="^\s*:\=\s*enddef\>"
580 \ contains=vimDef
581 \ extend fold keepend transparent
Bram Moolenaarb4ff5182015-11-10 21:15:48 +0100582endif
dkearns35e6f4c2024-03-22 06:41:10 +1100583
Doug Kearns51289202025-06-11 21:16:14 +0200584syn match vimDelfunctionBang contained "\a\@1<=!" skipwhite nextgroup=vimFunctionName
585syn match vimDelfunction "\<delf\%[unction]\>" skipwhite nextgroup=vimDelfunctionBang,vimFunctionName
586
dkearns35e6f4c2024-03-22 06:41:10 +1100587" Types: {{{2
588" =====
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200589
Doug Kearnsdd3f1c02025-03-17 20:27:13 +0100590syn region vimReturnType contained
591 \ start=":\%(\s\|\n\)\@="
592 \ skip=+\n\s*\\\|\n\s*#\\ \|^\s*#\\ +
593 \ end="$"
594 \ matchgroup=vim9Comment
595 "\ allow for legacy script tail comment error
596 \ end="\ze[#"]"
597 \ skipwhite skipempty nextgroup=vimDefBody,vimDefComment,vimEnddef,vimCommentError
598 \ contains=@vim9Continue,@vimType
599 \ transparent
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200600syn match vimParamType contained ":\s" skipwhite skipnl nextgroup=@vimType contains=vimTypeSep
dkearns35e6f4c2024-03-22 06:41:10 +1100601
Doug Kearnsdd3f1c02025-03-17 20:27:13 +0100602syn match vimTypeSep contained ":\%(\s\|\n\)\@=" skipwhite nextgroup=@vimType
dkearns35e6f4c2024-03-22 06:41:10 +1100603syn keyword vimType contained any blob bool channel float job number string void
Doug Kearns722fbd12025-03-28 19:36:37 +0100604syn match vimType contained "\<\%(func\)\>"
605syn region vimCompoundType contained matchgroup=vimType start="\<func(" end=")" nextgroup=vimTypeSep contains=@vim9Continue,@vimType transparent
606syn region vimCompoundType contained matchgroup=vimType start="\<tuple<" end=">" contains=@vim9Continue,@vimType transparent
607syn region vimCompoundType contained matchgroup=vimType start="\<\%(list\|dict\)<" end=">" contains=@vimType oneline transparent
Doug Kearnsdd3f1c02025-03-17 20:27:13 +0100608syn match vimUserType contained "\<\%(\h\w*\.\)*\u\w*\>"
dkearns35e6f4c2024-03-22 06:41:10 +1100609
610syn cluster vimType contains=vimType,vimCompoundType,vimUserType
Bram Moolenaar4d8f4762021-06-27 15:18:56 +0200611
Doug Kearns818c6412024-10-06 17:00:48 +0200612" Classes, Enums And Interfaces: {{{2
613" =============================
614
615if s:vim9script
Doug Kearns1c580192025-05-01 17:43:17 +0200616
Doug Kearns818c6412024-10-06 17:00:48 +0200617 " Methods {{{3
Doug Kearns1aa287e2025-02-10 22:00:27 +0100618 syn match vim9MethodDef contained "\<def\>" skipwhite nextgroup=vim9MethodDefName,vim9ConstructorDefName
Doug Kearns818c6412024-10-06 17:00:48 +0200619 syn match vim9MethodDefName contained "\<\h\w*\>" nextgroup=vim9MethodDefParams contains=@vim9MethodName
620 syn region vim9MethodDefParams contained
621 \ matchgroup=Delimiter start="(" end=")"
Doug Kearnsdd3f1c02025-03-17 20:27:13 +0100622 \ skipwhite skipnl nextgroup=vim9MethodDefBody,vim9MethodDefComment,vimEnddef,vim9MethodDefReturnType,vimCommentError
Doug Kearns51289202025-06-11 21:16:14 +0200623 \ contains=vimDefParam,vim9Comment,vimFunctionParamEquals
Doug Kearns1aa287e2025-02-10 22:00:27 +0100624
Doug Kearnsadb703e2025-03-23 16:14:20 +0100625 syn match vim9ConstructorDefName contained "\<_\=new\w*\>"
Doug Kearns1aa287e2025-02-10 22:00:27 +0100626 \ nextgroup=vim9ConstructorDefParams
627 \ contains=@vim9MethodName
628 syn match vim9ConstructorDefParam contained "\<\%(this\.\)\=\h\w*\>"
Doug Kearns51289202025-06-11 21:16:14 +0200629 \ skipwhite nextgroup=vimParamType,vimFunctionParamEquals
Doug Kearns1aa287e2025-02-10 22:00:27 +0100630 \ contains=vim9This,vimOper
631 syn region vim9ConstructorDefParams contained
632 \ matchgroup=Delimiter start="(" end=")"
Doug Kearnsdd3f1c02025-03-17 20:27:13 +0100633 \ skipwhite skipnl nextgroup=vim9MethodDefBody,vim9MethodDefComment,vimEnddef,vimCommentError
Doug Kearns51289202025-06-11 21:16:14 +0200634 \ contains=vim9ConstructorDefParam,vim9Comment,vimFunctionParamEquals
Doug Kearns1aa287e2025-02-10 22:00:27 +0100635
Doug Kearns818c6412024-10-06 17:00:48 +0200636 syn region vim9MethodDefReturnType contained
Doug Kearnsdd3f1c02025-03-17 20:27:13 +0100637 \ start=":\%(\s\|\n\)\@="
638 \ skip=+\n\s*\\\|\n\s*#\\ \|^\s*#\\ +
639 \ end="$"
640 \ matchgroup=vim9Comment
641 \ end="\ze#"
642 \ skipwhite skipnl nextgroup=vim9MethodDefBody,vim9MethodDefComment,vimEnddef,vimCommentError
643 \ contains=@vim9Continue,vimType,vimTypeSep
Doug Kearns818c6412024-10-06 17:00:48 +0200644 \ transparent
Doug Kearnsdd3f1c02025-03-17 20:27:13 +0100645
646 syn region vim9MethodDefComment contained
647 \ start="#.*"
648 \ skip=+\n\s*\\\|\n\s*#\\ +
649 \ end="$"
650 \ skipwhite skipempty nextgroup=vim9MethodDefBody,vimEnddef
651
Doug Kearns818c6412024-10-06 17:00:48 +0200652 syn region vim9MethodDefBody contained
653 \ start="^.\=" matchgroup=vimCommand end="\<enddef\>"
654 \ skipwhite nextgroup=vimCmdSep,vim9Comment,vimCommentError
655 \ contains=@vim9MethodDefBodyList
656
657 syn cluster vim9MethodDefBodyList contains=@vimDefBodyList,vim9This,vim9Super
658
659 if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimfunctionerror")
660 syn match vim9MethodNameError contained "\<[a-z0-9]\i\>"
661 endif
Doug Kearnsadb703e2025-03-23 16:14:20 +0100662 syn match vim9MethodName contained "\<_\=new\w*\>"
Doug Kearns818c6412024-10-06 17:00:48 +0200663 syn keyword vim9MethodName contained empty len string
664
665 syn cluster vim9MethodName contains=vim9MethodName,vim9MethodNameError
666
667 if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f'
668 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 +0100669 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 +0200670 endif
671
672 syn cluster vim9MethodDef contains=vim9MethodDef,vim9MethodDefFold
673
674 " Classes {{{3
675 syn cluster vim9ClassBodyList contains=vim9Abstract,vim9Class,vim9Comment,vim9LineComment,@vim9Continue,@vimExprList,vim9Extends,vim9Implements,@vim9MethodDef,vim9Public,vim9Static,vim9Const,vim9Final,vim9This,vim9Super,vim9Var
676
677 syn match vim9Class contained "\<class\>" skipwhite nextgroup=vim9ClassName
678 syn match vim9ClassName contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9Extends,vim9Implements
679 syn match vim9SuperClass contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9Implements
680 syn match vim9ImplementedInterface contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9InterfaceListComma,vim9Extends
681 syn match vim9InterfaceListComma contained "," skipwhite skipnl nextgroup=vim9ImplementedInterface
682 syn keyword vim9Abstract abstract skipwhite skipnl nextgroup=vim9ClassBody,vim9AbstractDef
683 syn keyword vim9Extends contained extends skipwhite skipnl nextgroup=vim9SuperClass
684 syn keyword vim9Implements contained implements skipwhite skipnl nextgroup=vim9ImplementedInterface
685 syn keyword vim9Public contained public
686 syn keyword vim9Static contained static
Doug Kearns1aa287e2025-02-10 22:00:27 +0100687 " FIXME: don't match as dictionary keys, remove when operators are not
688 " shared between Vim9 and legacy script
689 syn match vim9This contained "\.\@1<!\<this\>:\@!"
690 " super must be folowed by '.'
691 syn match vim9Super contained "\.\@1<!\<super\.\@="
Doug Kearns818c6412024-10-06 17:00:48 +0200692
693 VimFoldc syn region vim9ClassBody start="\<class\>" matchgroup=vimCommand end="\<endclass\>" contains=@vim9ClassBodyList transparent
694
695 " Enums {{{3
Doug Kearns1c580192025-05-01 17:43:17 +0200696 syn cluster vim9EnumBodyList contains=vim9Comment,vim9LineComment,@vim9Continue,vim9Enum,@vimExprList,@vim9MethodDef,vim9Public,vim9Static,vim9Const,vim9Final,vim9This,vim9Var
Doug Kearns818c6412024-10-06 17:00:48 +0200697
Doug Kearns1c580192025-05-01 17:43:17 +0200698 syn match vim9Enum contained "\<enum\>" skipwhite nextgroup=vim9EnumName
699
700 syn match vim9EnumName contained "\<\u\w*\>" skipwhite skipempty nextgroup=vim9EnumNameTrailing,vim9EnumNameEmpty,vim9EnumNameComment,@vim9EnumNameContinue,vim9EnumImplements
701 syn match vim9EnumNameTrailing contained "\S.*"
702 syn region vim9EnumNameComment contained
703 \ start="#" skip="\n\s*\%(\\\|#\\ \)" end="$"
704 \ skipwhite skipempty nextgroup=vim9EnumNameComment,vim9EnumValue
705 \ contains=@vimCommentGroup,vimCommentString
706 " vim9EnumName's "skipempty" should only apply to comments and enum values and not implements clauses
707 syn match vim9EnumNameEmpty contained "^" skipwhite skipempty nextgroup=vim9EnumNameComment,vim9EnumValue
708 " allow line continuation between enum name and "implements"
709 syn match vim9EnumNameContinue contained
710 \ "^\s*\\"
711 \ skipwhite skipnl nextgroup=vim9EnumNameTrailing,vim9EnumNameEmpty,vim9EnumNameComment,@vim9EnumNameContinue,vim9EnumImplements
712 \ contains=vimWhitespace
713 syn match vim9EnumNameContinueComment contained
714 \ "^\s*#\\ .*"
715 \ skipwhite skipnl nextgroup=vim9EnumNameEmpty,vim9EnumNameComment,@vim9EnumNameContinue
716 \ contains=vimWhitespace
717 syn cluster vim9EnumNameContinue contains=vim9EnumNameContinue,vim9EnumNameContinueComment
718
719 " enforce enum value list location
720 syn match vim9EnumValue contained "\<\a\w*\>" nextgroup=vim9EnumValueArgList,vim9EnumValueListComma,vim9Comment
721 syn match vim9EnumValueListComma contained "," skipwhite skipempty nextgroup=vim9EnumValue,vim9EnumValueListCommaComment
722 syn region vim9EnumValueListCommaComment contained
723 \ start="#" skip="\n\s*\%(\\\|#\\ \)" end="$"
724 \ skipwhite skipempty nextgroup=vim9EnumValueListCommaComment,vim9EnumValue
725 \ contains=@vimCommentGroup,vimCommentString
726 syn region vim9EnumValueArgList contained
727 \ matchgroup=vimParenSep start="(" end=")"
728 \ nextgroup=vim9EnumValueListComma
729 \ contains=@vimExprList,vimContinueString,vim9Comment
730
731 syn keyword vim9EnumImplements contained implements skipwhite nextgroup=vim9EnumImplementedInterface
732 syn match vim9EnumImplementedInterface contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9EnumInterfaceListComma,vim9EnumImplementedInterfaceComment,vim9EnumValue
733 syn match vim9EnumInterfaceListComma contained "," skipwhite nextgroup=vim9EnumImplementedInterface
734 syn region vim9EnumImplementedInterfaceComment contained
735 \ start="#" skip="\n\s*\%(\\\|#\\ \)" end="$"
736 \ skipwhite skipempty nextgroup=vim9EnumImplementedInterfaceComment,vim9EnumValue
737 \ contains=@vimCommentGroup,vimCommentString
Doug Kearns818c6412024-10-06 17:00:48 +0200738
739 VimFolde syn region vim9EnumBody start="\<enum\>" matchgroup=vimCommand end="\<endenum\>" contains=@vim9EnumBodyList transparent
740
741 " Interfaces {{{3
742 " TODO: limit to decl only - no init values
743 syn cluster vim9InterfaceBodyList contains=vim9Comment,vim9LineComment,@vim9Continue,vim9Extends,vim9Interface,vim9AbstractDef,vim9Var
744
745 syn match vim9Interface contained "\<interface\>" skipwhite nextgroup=vim9InterfaceName
746 syn match vim9InterfaceName contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9Extends
747
748 syn keyword vim9AbstractDef contained def skipwhite nextgroup=vim9AbstractDefName
749 syn match vim9AbstractDefName contained "\<\h\w*\>" skipwhite nextgroup=vim9AbstractDefParams contains=@vim9MethodName
750 syn region vim9AbstractDefParams contained
751 \ matchgroup=Delimiter start="(" end=")"
752 \ skipwhite skipnl nextgroup=vimDefComment,vim9AbstractDefReturnType,vimCommentError
Doug Kearns51289202025-06-11 21:16:14 +0200753 \ contains=vimDefParam,vim9Comment,vimFunctionParamEquals
Doug Kearns818c6412024-10-06 17:00:48 +0200754 syn region vim9AbstractDefReturnType contained
755 \ start=":\s" end="$" matchgroup=vim9Comment end="\ze[#"]"
756 \ skipwhite skipnl nextgroup=vimDefComment,vimCommentError
757 \ contains=vimTypeSep
758 \ transparent
759
760 VimFoldi syn region vim9InterfaceBody start="\<interface\>" matchgroup=vimCommand end="\<endinterface\>" contains=@vim9InterfaceBodyList transparent
761
Doug Kearns1aa287e2025-02-10 22:00:27 +0100762 " Type Aliases {{{3
Doug Kearns818c6412024-10-06 17:00:48 +0200763 syn match vim9Type "\<ty\%[pe]\>" skipwhite nextgroup=vim9TypeAlias,vim9TypeAliasError
764 syn match vim9TypeAlias contained "\<\u\w*\>" skipwhite nextgroup=vim9TypeEquals
765 syn match vim9TypeEquals contained "=" skipwhite nextgroup=@vimType
766 if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_notypealiaserror")
Doug Kearns1aa287e2025-02-10 22:00:27 +0100767 syn match vim9TypeAliasError contained "\<\l\w*\>" skipwhite nextgroup=vim9TypeEquals
Doug Kearns818c6412024-10-06 17:00:48 +0200768 endif
769endif
770
Doug Kearns1aa287e2025-02-10 22:00:27 +0100771" Blocks: {{{2
772" ======
Doug Kearns1cccdeb2025-06-05 20:23:07 +0200773Vim9 syn region vim9Block
774 \ matchgroup=vimSep
775 \ start="{\ze\s*\%($\|[#|]\)"
776 \ end="^\s*\zs}"
777 \ skipwhite nextgroup=vim9Comment,vimCmdSep
778 \ contains=@vimDefBodyList
Doug Kearns1aa287e2025-02-10 22:00:27 +0100779
dkearns04e53632024-04-11 06:18:37 +1000780" Keymaps: {{{2
dkearns69866442023-11-22 05:43:40 +1100781" =======
782
dkearns04e53632024-04-11 06:18:37 +1000783syn match vimKeymapStart "^" contained skipwhite nextgroup=vimKeymapLhs,@vimKeymapLineComment
dkearns69866442023-11-22 05:43:40 +1100784syn match vimKeymapLhs "\S\+" contained skipwhite nextgroup=vimKeymapRhs contains=vimNotation
785syn match vimKeymapRhs "\S\+" contained skipwhite nextgroup=vimKeymapTailComment contains=vimNotation
786syn match vimKeymapTailComment "\S.*" contained
dkearns04e53632024-04-11 06:18:37 +1000787
788" TODO: remove when :" comment is matched in parts as "ex-colon comment" --djk
789if s:vim9script
790 syn match vim9KeymapLineComment "#.*" contained contains=@vimCommentGroup,vimCommentString,vim9CommentTitle
791else
792 syn match vimKeymapLineComment +".*+ contained contains=@vimCommentGroup,vimCommentString,vimCommentTitle
793endif
794syn cluster vimKeymapLineComment contains=vim9\=KeymapLineComment
dkearns69866442023-11-22 05:43:40 +1100795
Doug Kearns7866d542024-08-23 18:37:55 +0200796syn region vimLoadkeymap matchgroup=vimCommand start="\<loadk\%[eymap]\>" end="\%$" contains=vimKeymapStart
dkearns69866442023-11-22 05:43:40 +1100797
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000798" Special Filenames, Modifiers, Extension Removal: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000799" ===============================================
dkearns2c51e152024-02-27 07:10:18 +1100800syn match vimSpecFile "<c\(word\|WORD\)>" nextgroup=vimSpecFileMod,vimSubst1
801syn match vimSpecFile "<\([acs]file\|amatch\|abuf\)>" nextgroup=vimSpecFileMod,vimSubst1
802syn match vimSpecFile "\s%[ \t:]"ms=s+1,me=e-1 nextgroup=vimSpecFileMod,vimSubst1
803syn match vimSpecFile "\s%$"ms=s+1 nextgroup=vimSpecFileMod,vimSubst1
804syn match vimSpecFile "\s%<"ms=s+1,me=e-1 nextgroup=vimSpecFileMod,vimSubst1
805syn match vimSpecFile "#\d\+\|[#%]<\>" nextgroup=vimSpecFileMod,vimSubst1
Bram Moolenaar5c736222010-01-06 20:54:52 +0100806syn match vimSpecFileMod "\(:[phtre]\)\+" contained
Bram Moolenaar071d4272004-06-13 20:20:40 +0000807
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000808" User-Specified Commands: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000809" =======================
dkearns04e53632024-04-11 06:18:37 +1000810syn 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 +0200811
812syn match vimUserCmd "\<com\%[mand]\>!\=" skipwhite nextgroup=vimUserCmdAttrs,vimUserCmdName contains=vimBang
813syn match vimUserCmd +\<com\%[mand]\>!\=\ze\s*\n\s*\%(\\\|["#]\\ \)+ skipwhite skipnl nextgroup=vimUserCmdAttrs,vimUserCmdName contains=vimBang
814
815syn region vimUserCmdAttrs contained
816 \ start="-\l"
817 \ start=+^\s*\%(\\\|["#]\\ \)+
818 \ end="\ze\s\u"
819 \ skipwhite nextgroup=vimUserCmdName
820 \ contains=@vimContinue,vimUserCmdAttr,vimUserCmdAttrError
821 \ transparent
822syn match vimUserCmdAttrError contained "-\a\+\ze\%(\s\|=\)"
823syn match vimUserCmdAttr contained "-addr=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrAddr
824syn match vimUserCmdAttr contained "-bang\>" contains=vimUserCmdAttrKey
825syn match vimUserCmdAttr contained "-bar\>" contains=vimUserCmdAttrKey
826syn match vimUserCmdAttr contained "-buffer\>" contains=vimUserCmdAttrKey
827syn match vimUserCmdAttr contained "-complete=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrComplete,vimUserCmdError
828syn match vimUserCmdAttr contained "-count\>" contains=vimUserCmdAttrKey
829syn match vimUserCmdAttr contained "-count=" contains=vimUserCmdAttrKey nextgroup=vimNumber
830syn match vimUserCmdAttr contained "-keepscript\>" contains=vimUserCmdAttrKey
831syn match vimUserCmdAttr contained "-nargs=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrNargs
832syn match vimUserCmdAttr contained "-range\>" contains=vimUserCmdAttrKey
833syn match vimUserCmdAttr contained "-range=" contains=vimUserCmdAttrKey nextgroup=vimNumber,vimUserCmdAttrRange
834syn match vimUserCmdAttr contained "-register\>" contains=vimUserCmdAttrKey
Doug Kearns3c07eb02024-09-02 10:03:37 +0200835
836syn match vimUserCmdAttrNargs contained "[01*?+]"
837syn match vimUserCmdAttrRange contained "%"
838
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100839if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_nousercmderror")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100840 syn match vimUserCmdError contained "\S\+\>"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000841endif
Bram Moolenaara93fa7e2006-04-17 22:14:47 +0000842
Doug Kearns3c07eb02024-09-02 10:03:37 +0200843syn case ignore
844syn 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 +0200845
846" GEN_SYN_VIM: vimUserCmdAttrComplete, START_STR='syn keyword vimUserCmdAttrComplete contained', END_STR=''
Doug Kearnsc29b5332025-04-26 20:14:15 +0200847syn keyword vimUserCmdAttrComplete contained arglist augroup behave breakpoint buffer color command compiler cscope diff_buffer dir dir_in_path environment event expression file file_in_path filetype filetypecmd function help highlight history keymap locale mapclear mapping menu messages option packadd runtime scriptnames shellcmd shellcmdline sign syntax syntime tag tag_listfiles user var
Doug Kearns520a2c72025-04-08 20:50:00 +0200848syn 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
849syn keyword vimUserCmdAttrComplete contained custom customlist nextgroup=vimUserCmdAttrCompleteFunc,vimUserCmdError
Doug Kearns51289202025-06-11 21:16:14 +0200850syn match vimUserCmdAttrCompleteFunc contained ",\%([bwglstav]:\|<[sS][iI][dD]>\)\=\h\w*\%([.#]\h\w*\)*"hs=s+1 nextgroup=vimUserCmdError contains=vimVarScope,vimFunctionSID
Doug Kearns520a2c72025-04-08 20:50:00 +0200851
Doug Kearns3c07eb02024-09-02 10:03:37 +0200852" GEN_SYN_VIM: vimUserCmdAttrAddr, START_STR='syn keyword vimUserCmdAttrAddr contained', END_STR=''
853syn 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 +0200854syn keyword vimUserCmdAttrAddr contained arguments arg buffers buf lines line loaded_buffers load other quickfix qf tabs tab windows win
855syn match vimUserCmdAttrAddr contained "?"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000856syn case match
Bram Moolenaar071d4272004-06-13 20:20:40 +0000857
Doug Kearns520a2c72025-04-08 20:50:00 +0200858syn match vimUserCmdName contained "\<\u[[:alnum:]]*\>" skipwhite nextgroup=vimUserCmdBlock,vimUserCmdReplacement
859syn match vimUserCmdName contained +\<\u[[:alnum:]]*\>\ze\s*\n\s*\%(\\\|["#]\\ \)+ skipwhite skipnl nextgroup=vimUserCmdBlock,vimUserCmdReplacement
860syn region vimUserCmdReplacement contained
861 \ start="\S"
862 \ start=+^\s*\%(\\\|["#]\\ \)+
863 \ skip=+\n\s*\%(\\\|["#]\\ \)+
864 \ end="$"
865 \ contains=@vimContinue,@vimUserCmdList,vimComFilter
866syn region vimUserCmdBlock contained
867 \ matchgroup=vimSep
868 \ start="{"
869 \ end="^\s*\zs}"
870 \ contains=@vimDefBodyList
dkearns04e53632024-04-11 06:18:37 +1000871
Doug Kearns520a2c72025-04-08 20:50:00 +0200872syn match vimDelcommand "\<delc\%[ommand]\>" skipwhite nextgroup=vimDelcommandAttr,vimDelcommandName
873syn match vimDelcommandAttr contained "-buffer\>" skipwhite nextgroup=vimDelcommandName
874syn match vimDelcommandName contained "\<\u[[:alnum:]]*\>"
Doug Kearns3c07eb02024-09-02 10:03:37 +0200875
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000876" Lower Priority Comments: after some vim commands... {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000877" =======================
dkearns959c3c82024-06-12 04:18:08 +1000878if get(g:, "vimsyn_comment_strings", 1)
Doug Kearns35699f12024-09-19 19:51:59 +0200879 syn region vimCommentString contained oneline start='\S\s\+"'ms=e end='"' extend
dkearns959c3c82024-06-12 04:18:08 +1000880endif
dkearns04e53632024-04-11 06:18:37 +1000881
882if s:vim9script
dkearns04e53632024-04-11 06:18:37 +1000883 syn cluster vimComment contains=vim9Comment
884else
dkearns04e53632024-04-11 06:18:37 +1000885 syn cluster vimComment contains=vimComment
886endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000887
Doug Kearnsc29b5332025-04-26 20:14:15 +0200888VimL syn region vimComment
889 \ excludenl
890 \ start=+"+
891 \ skip=+\n\s*\%(\\\|"\\ \)+
892 \ end="$"
893 \ contains=@vimCommentGroup,vimCommentString
894 \ extend
895Vim9 syn region vim9Comment
896 \ excludenl
897 \ start="\%#=1\s\@1<=#\%({\@!\|{{\)"
898 \ skip="\n\s*\%(\\\|#\\ \)"
899 \ end="$"
900 \ contains=@vimCommentGroup,vimCommentString
901 \ extend
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200902
Doug Kearnsfc64ac02024-06-22 11:20:36 +0200903syn match vim9CommentError contained "#.*"
904syn match vimCommentError contained +".*+
905
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000906" Environment Variables: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000907" =====================
Bram Moolenaar5c736222010-01-06 20:54:52 +0100908syn match vimEnvvar "\$\I\i*"
909syn match vimEnvvar "\${\I\i*}"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000910
Doug Kearns68ba6c22025-02-16 16:40:12 +0100911" Strings {{{2
912" =======
913
914" In-String Specials:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000915" Try to catch strings, if nothing else matches (therefore it must precede the others!)
916" vimEscapeBrace handles ["] []"] (ie. "s don't terminate string inside [])
Doug Kearnsc29b5332025-04-26 20:14:15 +0200917" syn region vimEscapeBrace oneline contained transparent start="[^\\]\(\\\\\)*\[\zs\^\=\]\=" skip="\\\\\|\\\]" end="]"me=e-1
Bram Moolenaar5c736222010-01-06 20:54:52 +0100918syn match vimPatSepErr contained "\\)"
919syn match vimPatSep contained "\\|"
Bram Moolenaarb730f0c2018-11-25 03:56:26 +0100920syn region vimPatSepZone oneline contained matchgroup=vimPatSepZ start="\\%\=\ze(" skip="\\\\" end="\\)\|[^\\]['"]" contains=@vimStringGroup
Bram Moolenaar5c736222010-01-06 20:54:52 +0100921syn region vimPatRegion contained transparent matchgroup=vimPatSepR start="\\[z%]\=(" end="\\)" contains=@vimSubstList oneline
922syn match vimNotPatSep contained "\\\\"
Bram Moolenaar6ba83ba2022-06-12 22:15:57 +0100923syn cluster vimStringGroup contains=vimEscape,vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone,@Spell
Doug Kearns3993cd62025-06-02 19:31:10 +0200924syn region vimString oneline keepend matchgroup=vimString start=+[^a-zA-Z\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ nextgroup=vimSubscript contains=@vimStringGroup extend
925syn region vimString oneline matchgroup=vimString start=+[^a-zA-Z\\@]'+lc=1 end=+'+ nextgroup=vimSubscript contains=vimQuoteEscape extend
Bram Moolenaaracc22402020-06-07 21:07:18 +0200926"syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup " see tst45.vim
Doug Kearns695522d2025-01-10 20:02:17 +0100927
Bram Moolenaar6ba83ba2022-06-12 22:15:57 +0100928syn match vimEscape contained "\\."
dkearnse3e39342024-02-02 07:44:26 +1100929" syn match vimEscape contained +\\[befnrt\"]+
930syn match vimEscape contained "\\\o\{1,3}\|\\[xX]\x\{1,2}\|\\u\x\{1,4}\|\\U\x\{1,8}"
931syn match vimEscape contained "\\<" contains=vimNotation
932syn match vimEscape contained "\\<\*[^>]*>\=>"
Doug Kearns695522d2025-01-10 20:02:17 +0100933syn match vimQuoteEscape contained "''"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000934
Doug Kearnsc29b5332025-04-26 20:14:15 +0200935syn region vimString oneline matchgroup=vimString start=+$'+ end=+'+ nextgroup=vimSubscript contains=@vimStringInterpolation,vimQuoteEscape extend
936syn region vimString oneline matchgroup=vimString start=+$"+ end=+"+ nextgroup=vimSubscript contains=@vimStringInterpolation,@vimStringGroup extend
dkearnsb1427b42024-02-28 05:59:30 +1100937syn region vimStringInterpolationExpr oneline contained matchgroup=vimSep start=+{+ end=+}+ contains=@vimExprList
938syn match vimStringInterpolationBrace contained "{{"
939syn match vimStringInterpolationBrace contained "}}"
Doug Kearnsd164f2a2024-08-16 21:07:15 +0200940syn cluster vimStringInterpolation contains=vimStringInterpolationExpr,vimStringInterpolationBrace
thincacf8695d2024-01-28 18:57:23 +0100941
Doug Kearnsc29b5332025-04-26 20:14:15 +0200942syn region vimContinueString contained matchgroup=vimContinueString start=+"+ skip=+\n\s*\%(\\\|["#]\\ \)+ end=+"+ end="$" skipwhite nextgroup=vimSubscript,vimComment contains=@vimContinue,@vimStringGroup
943syn region vimContinueString contained matchgroup=vimContinueString start=+'+ skip=+\n\s*\%(\\\|["#]\\ \)+ end=+'+ end="$" skipwhite nextgroup=vimSubscript,vimComment contains=@vimContinue,vimQuoteEscape
944syn region vimContinueString contained matchgroup=vimContinueString start=+$"+ skip=+\n\s*\%(\\\|["#]\\ \)+ end=+"+ end="$" skipwhite nextgroup=vimSubscript,vimComment contains=@vimContinue,@vimStringInterpolation,@vimStringGroup
945syn region vimContinueString contained matchgroup=vimContinueString start=+$'+ skip=+\n\s*\%(\\\|["#]\\ \)+ end=+'+ end="$" skipwhite nextgroup=vimSubscript,vimComment contains=@vimContinue,@vimStringInterpolation,vimQuoteEscape
946
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000947" Substitutions: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000948" =============
Bram Moolenaar5c736222010-01-06 20:54:52 +0100949syn cluster vimSubstList contains=vimPatSep,vimPatRegion,vimPatSepErr,vimSubstTwoBS,vimSubstRange,vimNotation
950syn cluster vimSubstRepList contains=vimSubstSubstr,vimSubstTwoBS,vimNotation
951syn cluster vimSubstList add=vimCollection
Doug Kearns086b3b52025-05-31 17:52:48 +0200952syn match vimSubst "^\s*\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)\>" skipwhite nextgroup=vimSubstPat,vimSubstFlags,vimSubstCount
953syn match vimSubst "^\s*\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)[_#]\@=" skipwhite nextgroup=vimSubstPat
954syn match vimSubst "^\s*\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)\%(\d\+\)\@=" skipwhite nextgroup=vimSubstCount
955syn match vimSubst1 contained "\%(s\%[ubstitute]\|sm\%[agic]\>\|sno\%[magic]\)\>" skipwhite nextgroup=vimSubstPat,vimSubstFlags,vimSubstCount
Doug Kearns92f4e912024-06-05 19:45:43 +0200956syn match vimSubst1 contained "\%(s\%[ubstitute]\|sm\%[agic]\>\|sno\%[magic]\)[_#]\@=" skipwhite nextgroup=vimSubstPat
Doug Kearns086b3b52025-05-31 17:52:48 +0200957syn match vimSubst1 contained "\%(s\%[ubstitute]\|sm\%[agic]\>\|sno\%[magic]\)\%(\d\+\)\@=" skipwhite nextgroup=vimSubstCount
958syn match vimSubstFlagErr contained "[^< \t\r|]\+" contains=vimSubstFlags
959" & and # after :s are always pattern delimiters not flags
960syn match vimSubstFlags contained "[&cegiIlnpr#]\+" skipwhite nextgroup=vimSubstCount
961syn match vimSubstCount contained "\d\+\>"
dkearns2c51e152024-02-27 07:10:18 +1100962" TODO: Vim9 illegal separators for abbreviated :s form are [-.:], :su\%[...] required
963" : # is allowed but "not recommended" (see :h pattern-delimiter)
964syn 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
965syn region vimSubstRep4 contained matchgroup=vimSubstDelim start="\z(.\)" skip="\\\\\|\\\z1" end="\z1" matchgroup=vimNotation end="<[cC][rR]>" contains=@vimSubstRepList nextgroup=vimSubstFlagErr oneline
966syn region vimCollection contained transparent start="\\\@<!\[" skip="\\\[" end="\]" contains=vimCollClass
967syn match vimCollClassErr contained "\[:.\{-\}:\]"
968syn match vimCollClass contained transparent "\%#=1\[:\(alnum\|alpha\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|xdigit\|retu\%[rn]\|tab\|escape\|backspace\):\]"
969syn match vimSubstSubstr contained "\\z\=\d"
970syn match vimSubstTwoBS contained "\\\\"
Doug Kearns086b3b52025-05-31 17:52:48 +0200971
972" TODO: flags, unlike count, must follow immediately
973" : distinguish from with Vim9 &var
974" syn match vimSubst "^\s*\zs&&\=" skipwhite nextgroup=vimSubstFlags,vimSubstCount
975" syn match vimSubst "^\s*\zs\~&\=" skipwhite nextgroup=vimSubstFlags,vimSubstCount
976" syn match vimSubst1 contained "&&\=" skipwhite nextgroup=vimSubstFlags,vimSubstCount
977" syn match vimSubst1 contained "\~&\=" skipwhite nextgroup=vimSubstFlags,vimSubstCount
978
979" two and three letter variants (matched as :s + flags, count may follow immediately)
980syn match vimSubst "^\s*\zssc[egiIlnp]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags
981syn match vimSubst "^\s*\zssg[ceiIlnpr]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags
982syn match vimSubst "^\s*\zssi[ceInpr]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags
983syn match vimSubst "^\s*\zssI[ceginplr]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags
984syn match vimSubst "^\s*\zssr[cgiInplr]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags
985
986syn match vimSubst1 contained "\<sc[egiIlnp]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags
987syn match vimSubst1 contained "\<sg[ceiIlnpr]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags
988syn match vimSubst1 contained "\<si[ceInpr]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags
989syn match vimSubst1 contained "\<sI[ceginplr]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags
990syn match vimSubst1 contained "\<sr[cgiInplr]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags
Bram Moolenaar071d4272004-06-13 20:20:40 +0000991
Doug Kearns92f4e912024-06-05 19:45:43 +0200992" Vi compatibility
993syn match vimSubstDelim contained "\\"
994syn match vimSubstPat contained "\\\ze[/?&]" contains=vimSubstDelim nextgroup=vimSubstRep4
995
Doug Kearns086b3b52025-05-31 17:52:48 +0200996" Mark: {{{2
997" ====
998VimL syn match vimExMark "\<k\%([a-zA-Z0-9]\>\|[[\]<>'`]\)\@=" nextgroup=@vimMarkArg
999VimL syn match vimExMark "\<k\>" skipwhite nextgroup=@vimMarkArg
1000syn match vimExMark "\<mark\>" skipwhite nextgroup=@vimMarkArg
1001
1002syn match vimMarkArg contained "[a-zA-Z]\>\|[[\]<>'`]" skipwhite nextgroup=vimCmdSep,vimComment
1003syn match vimMarkArgError contained "["^.(){}0-9]"
1004syn cluster vimMarkArg contains=vimMarkArg,vimMarkArgError
1005
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001006" Marks, Registers, Addresses, Filters: {{{2
dkearns2c51e152024-02-27 07:10:18 +11001007syn match vimMark "'[a-zA-Z0-9]\ze[-+,!]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
Doug Kearnsd8176092024-08-31 16:57:32 +02001008syn match vimMark "'[[\]{}()<>]\ze[-+,!]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
1009syn match vimMark ",\zs'[[\]{}()<>]\ze" nextgroup=vimFilter,vimMarkNumber,vimSubst1
dkearns2c51e152024-02-27 07:10:18 +11001010syn match vimMark "[!,:]\zs'[a-zA-Z0-9]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
1011syn match vimMark "\<norm\%[al]\s\zs'[a-zA-Z0-9]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
1012syn match vimMarkNumber "[-+]\d\+" contained contains=vimOper nextgroup=vimSubst1
Bram Moolenaar5c736222010-01-06 20:54:52 +01001013syn match vimPlainMark contained "'[a-zA-Z0-9]"
Bram Moolenaar6c1e1572019-06-22 02:13:00 +02001014syn match vimRange "[`'][a-zA-Z0-9],[`'][a-zA-Z0-9]" contains=vimMark skipwhite nextgroup=vimFilter
Bram Moolenaar071d4272004-06-13 20:20:40 +00001015
Bram Moolenaarb4ff5182015-11-10 21:15:48 +01001016syn match vimRegister '[^,;[{: \t]\zs"[a-zA-Z0-9.%#:_\-/]\ze[^a-zA-Z_":0-9]'
Bram Moolenaar5c736222010-01-06 20:54:52 +01001017syn match vimRegister '\<norm\s\+\zs"[a-zA-Z0-9]'
1018syn match vimRegister '\<normal\s\+\zs"[a-zA-Z0-9]'
1019syn match vimRegister '@"'
1020syn match vimPlainRegister contained '"[a-zA-Z0-9\-:.%#*+=]'
Doug Kearnsa9c06422025-02-12 20:44:17 +01001021syn match vimLetRegister contained '@["0-9\-a-zA-Z:.%#=*+~_/]'
Bram Moolenaar071d4272004-06-13 20:20:40 +00001022
Bram Moolenaar5c736222010-01-06 20:54:52 +01001023syn match vimAddress ",\zs[.$]" skipwhite nextgroup=vimSubst1
1024syn match vimAddress "%\ze\a" skipwhite nextgroup=vimString,vimSubst1
Bram Moolenaar071d4272004-06-13 20:20:40 +00001025
Bram Moolenaar6c1e1572019-06-22 02:13:00 +02001026syn match vimFilter "^!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile
Bram Moolenaard58a3bf2020-09-28 21:48:16 +02001027syn match vimFilter contained "!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile
1028syn match vimComFilter contained "|!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile
Bram Moolenaar071d4272004-06-13 20:20:40 +00001029
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001030" Complex Repeats: (:h complex-repeat) {{{2
1031" ===============
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001032syn match vimCmplxRepeat '[^a-zA-Z_/\\()]q[0-9a-zA-Z"]\>'lc=1
1033syn match vimCmplxRepeat '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\>\)'
Bram Moolenaar071d4272004-06-13 20:20:40 +00001034
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001035" Set command and associated set-options (vimOptions) with comment {{{2
Doug Kearns570e71a2025-05-30 16:17:30 +02001036syn match vimSet "\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skipwhite nextgroup=vimSetBang,vimCmdSep,vimComment,vimSetArgs
Doug Kearns2a6be832025-04-03 21:39:24 +02001037syn region vimSetComment contained start=+"+ skip=+\n\s*\%(\\\||"\\ \)+ end="$" contains=@vimCommentGroup,vimCommentString extend
1038syn match vimSetCmdSep contained "|" skipwhite nextgroup=@vimCmdList,vimSubst1,vimFunc
1039syn match vimSetEscape contained "\\\%(\\[|"]\|.\)"
1040syn match vimSetBarEscape contained "\\|"
1041syn match vimSetQuoteEscape contained +\\"+
1042syn region vimSetArgs contained
Doug Kearns570e71a2025-05-30 16:17:30 +02001043 \ start="\l\|<"
Doug Kearns2a6be832025-04-03 21:39:24 +02001044 \ skip=+\n\s*\%(\\\|["#]\\ \)\|^\s*"\\ +
1045 \ end=+\ze\\\@1<![|"]+
1046 "\ assume this isn't an escaped char with backslash on the previous line
1047 \ end=+^\s*\\\ze[|"]+
1048 \ end="\ze\s#"
1049 \ end="$"
1050 \ nextgroup=vimSetCmdSep,vimSetComment,vim9Comment
1051 \ contains=@vimContinue,vimErrSetting,vimOption,vimSetAll,vimSetTermcap
1052 \ keepend
Doug Kearns570e71a2025-05-30 16:17:30 +02001053" TODO: restrict this to valid values?
1054syn match vimOption contained "<[^>]\+>" contains=vimOption
Doug Kearns2a6be832025-04-03 21:39:24 +02001055syn region vimSetEqual contained
1056 \ matchgroup=vimOper
1057 \ start="[=:]\|[-+^]="
1058 \ skip=+\\\s\|^\s*\%(\\\|["#]\\ \)+
1059 \ end="\ze\s"
1060 \ contains=@vimContinue,vimCtrlChar,vimEnvvar,vimNotation,vimSetSep,vimSetEscape,vimSetBarEscape,vimSetQuoteEscape
Doug Kearnsddbb6fe2024-07-24 20:21:22 +02001061syn match vimSetBang contained "\a\@1<=!" skipwhite nextgroup=vimSetAll,vimSetTermcap
1062syn keyword vimSetAll contained all nextgroup=vimSetMod
1063syn keyword vimSetTermcap contained termcap
Bram Moolenaar4072ba52020-12-23 13:56:35 +01001064syn match vimSetSep contained "[,:]"
Doug Kearnsddbb6fe2024-07-24 20:21:22 +02001065syn match vimSetMod contained "\a\@1<=\%(&vim\=\|[!&?<]\)"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001066
Doug Kearnsd65e58f2024-07-17 19:34:14 +02001067" Variable Declarations: {{{2
1068" =====================
Doug Kearns274efcc2025-06-10 21:02:43 +02001069VimL syn keyword vimLet let skipwhite nextgroup=@vimSpecialVar,vimVar,vimVarList,vimLetVar
1070VimL syn keyword vimConst cons[t] skipwhite nextgroup=@vimSpecialVar,vimVar,vimVarList,vimLetVar
Doug Kearns1aa287e2025-02-10 22:00:27 +01001071syn region vimVarList contained
1072 \ start="\[" end="]"
Doug Kearns274efcc2025-06-10 21:02:43 +02001073 \ skipwhite nextgroup=vimLetHeredoc
Doug Kearns1aa287e2025-02-10 22:00:27 +01001074 \ contains=@vimContinue,@vimSpecialVar,vimVar
Doug Kearns274efcc2025-06-10 21:02:43 +02001075syn match vimLetVar contained "\<\%([bwglstav]:\)\=\h[a-zA-Z0-9#_]*\>\ze\%(\[.*]\)\=\s*=<<" skipwhite nextgroup=vimLetVarSubscript,vimLetHeredoc contains=vimVarScope,vimSubscript
1076hi link vimLetVar vimVar
1077syn region vimLetVarSubscript contained
1078 \ matchgroup=vimSubscriptBracket
1079 \ start="\S\@1<=\["
1080 \ end="]"
1081 \ skipwhite nextgroup=vimLetVarSubscript,vimLetHeredoc
1082 \ contains=@vimExprList
dkearnsf6869212023-12-11 01:53:24 +11001083
Doug Kearns1aa287e2025-02-10 22:00:27 +01001084VimL syn keyword vimUnlet unl[et] skipwhite nextgroup=vimUnletBang,vimUnletVars
1085syn match vimUnletBang contained "\a\@1<=!" skipwhite nextgroup=vimUnletVars
1086syn region vimUnletVars contained
1087 \ start="$\I\|\h" skip=+\n\s*\\\|\n\s*"\\ \|^\s*"\\ + end="$" end="\ze[|"]"
1088 \ nextgroup=vimCmdSep,vimComment
Doug Kearns3dca5122025-03-09 16:30:28 +01001089 \ contains=@vimContinue,vimEnvvar,vimVar,vimVimVar
dkearnsf6869212023-12-11 01:53:24 +11001090
Doug Kearns274efcc2025-06-10 21:02:43 +02001091" TODO: type error after register or environment variables (strings)
1092VimFoldh syn region vimLetHeredoc contained
1093 \ matchgroup=vimLetHeredocStart
1094 \ start="\%(^\z(\s*\)\S.*\)\@<==<<\s*trim\%(\s\+\)\@>\z(\L\S*\)"
1095 \ matchgroup=vimLetHeredocStop
1096 \ end="^\z1\=\z2$"
1097 \ extend
1098VimFoldh syn region vimLetHeredoc contained
1099 \ matchgroup=vimLetHeredocStart
1100 \ start="=<<\%(\s*\)\@>\z(\L\S*\)"
1101 \ matchgroup=vimLetHeredocStop end="^\z1$"
1102 \ extend
1103VimFoldh syn region vimLetHeredoc contained
1104 \ matchgroup=vimLetHeredocStart
1105 \ start="\%(^\z(\s*\)\S.*\)\@<==<<\s*\%(trim\s\+eval\|eval\s\+trim\)\%(\s\+\)\@>\z(\L\S*\)"
1106 \ matchgroup=vimLetHeredocStop
1107 \ end="^\z1\=\z2$"
1108 \ contains=@vimStringInterpolation
1109 \ extend
1110VimFoldh syn region vimLetHeredoc contained
1111 \ matchgroup=vimLetHeredocStart
1112 \ start="=<<\s*eval\%(\s\+\)\@>\z(\L\S*\)"
1113 \ matchgroup=vimLetHeredocStop
1114 \ end="^\z1$"
1115 \ contains=@vimStringInterpolation
1116 \ extend
Doug Kearnsd65e58f2024-07-17 19:34:14 +02001117
1118Vim9 syn keyword vim9Const const skipwhite nextgroup=vim9Variable,vim9VariableList
1119Vim9 syn keyword vim9Final final skipwhite nextgroup=vim9Variable,vim9VariableList
1120Vim9 syn keyword vim9Var var skipwhite nextgroup=vim9Variable,vim9VariableList
1121
Doug Kearns274efcc2025-06-10 21:02:43 +02001122syn match vim9Variable contained "\<\h\w*\>" skipwhite nextgroup=vim9VariableTypeSep,vimLetHeredoc,vimOper
1123syn region vim9VariableList contained start="\[" end="]" contains=@vimContinue,@vimSpecialVar,vim9Variable skipwhite nextgroup=vimLetHeredoc
1124
1125syn match vim9VariableTypeSep contained "\S\@1<=:\%(\s\|\n\)\@=" skipwhite nextgroup=@vim9VariableType
1126syn keyword vim9VariableType contained any blob bool channel float job number string void skipwhite nextgroup=vimLetHeredoc
1127syn match vim9VariableType contained "\<\%(func\)\>" skipwhite nextgroup=vimLetHeredoc
1128syn region vim9VariableCompoundType contained
1129 \ matchgroup=vim9VariableType
1130 \ start="\<func("
1131 \ end=")"
1132 \ skipwhite nextgroup=vim9VariableTypeSep,vimLetHeredoc
1133 \ contains=@vim9Continue,@vim9VariableType
1134 \ transparent
1135syn region vim9VariableCompoundType contained
1136 \ matchgroup=vim9VariableType
1137 \ start="\<tuple<"
1138 \ end=">"
1139 \ skipwhite nextgroup=vimLetHeredoc
1140 \ contains=@vim9Continue,@vim9VariableType
1141 \ transparent
1142syn region vim9VariableCompoundType contained
1143 \ matchgroup=vim9VariableType
1144 \ start="\<\%(list\|dict\)<"
1145 \ end=">"
1146 \ skipwhite nextgroup=vimLetHeredoc
1147 \ contains=@vim9VariableType
1148 \ oneline
1149 \ transparent
1150syn match vim9VariableUserType contained "\<\%(\h\w*\.\)*\u\w*\>" skipwhite nextgroup=vimLetHeredoc
1151
1152syn cluster vim9VariableType contains=vim9VariableType,vim9VariableCompoundType,vim9VariableUserType
Doug Kearns1aa287e2025-02-10 22:00:27 +01001153
1154" Lockvar and Unlockvar: {{{2
1155" =====================
1156syn keyword vimLockvar lockv[ar] skipwhite nextgroup=vimLockvarBang,vimLockvarDepth,vimLockvarVars
1157syn keyword vimUnlockvar unlo[ckvar] skipwhite nextgroup=vimLockvarBang,vimLockvarDepth,vimLockvarVars
1158syn match vimLockvarBang contained "\a\@1<=!" skipwhite nextgroup=vimLockvarVars
1159syn match vimLockvarDepth contained "\<[0-3]\>" skipwhite nextgroup=vimLockvarVars
1160syn region vimLockvarVars contained
1161 \ start="\h" skip=+\n\s*\\\|\n\s*"\\ \|^\s*"\\ + end="$" end="\ze[|"]"
1162 \ nextgroup=vimCmdSep,vimComment
1163 \ contains=@vimContinue,vimVar
1164
1165hi def link vimLockvar vimCommand
1166hi def link vimUnlockvar vimCommand
1167hi def link vimLockvarBang vimBang
1168hi def link vimLockvarDepth vimNumber
Bram Moolenaar071d4272004-06-13 20:20:40 +00001169
dkearnsf6869212023-12-11 01:53:24 +11001170" For: {{{2
1171" ===
Doug Kearns1aa287e2025-02-10 22:00:27 +01001172" handles Vim9 and legacy for now
1173syn region vimFor
1174 \ matchgroup=vimCommand
1175 \ start="\<for\>" end="\<in\>"
1176 \ skipwhite skipnl nextgroup=@vimForInContinue,vim9ForInComment,@vimExprList
1177 \ contains=@vimContinue,vimVar,vimVarList,vim9VariableList
1178 \ transparent
1179
1180syn match vim9ForInComment contained "#.*" skipwhite skipempty nextgroup=vimForInComment,@vimExprList
1181
1182syn match vimForInContinue contained "^\s*\zs\\" skipwhite skipnl nextgroup=@vimForInContinue,@vimExprList
1183syn match vimForInContinueComment contained '^\s*\zs["#]\\ .*' skipwhite skipnl nextgroup=@vimForInContinue,@vimExprList
1184syn cluster vimForInContinue contains=vimForInContinue,vimForInContinueComment
dkearns76d62982024-03-23 05:55:25 +11001185
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001186" Abbreviations: {{{2
Bram Moolenaare37d50a2008-08-06 17:06:04 +00001187" =============
h-east9b53c052024-02-13 21:09:22 +01001188" GEN_SYN_VIM: vimCommand abbrev, START_STR='syn keyword vimAbb', END_STR='skipwhite nextgroup=vimMapMod,vimMapLhs'
dkearns16249702024-02-23 05:45:05 +11001189syn 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 +11001190" GEN_SYN_VIM: vimCommand abclear, START_STR='syn keyword vimAbb', END_STR='skipwhite nextgroup=vimMapMod'
1191syn keyword vimAbb abc[lear] cabc[lear] iabc[lear] skipwhite nextgroup=vimMapMod
Bram Moolenaare37d50a2008-08-06 17:06:04 +00001192
Doug Kearnsfa3b1042025-04-22 19:48:13 +02001193" Filename Patterns: {{{2
1194" =================
1195
1196syn match vimWildcardQuestion contained "?"
1197syn match vimWildcardStar contained "*"
1198
1199syn match vimWildcardBraceComma contained ","
1200syn region vimWildcardBrace contained
1201 \ matchgroup=vimWildcard
1202 \ start="{"
1203 \ end="}"
1204 \ contains=vimWildcardEscape,vimWildcardBrace,vimWildcardBraceComma,vimWildcardQuestion,vimWildcardStar,vimWildcardBracket
1205 \ oneline
1206
1207syn match vimWildcardIntervalNumber contained "\d\+"
1208syn match vimWildcardInterval contained "\\\\\\{\d\+\%(,\d\+\)\=\\}" contains=vimWildcardIntervalNumber
1209
1210
1211syn match vimWildcardBracket contained "\[\%(\^\=]\=\%(\\.\|\[\([:.=]\)[^:.=]\+\1]\|[^][:space:]]\)*\)\@>]"
1212 \ contains=vimWildcardBracketStart,vimWildcardEscape
1213
1214syn match vimWildcardBracketCharacter contained "." nextgroup=@vimWildcardBracketCharacter,vimWildcardBracketHyphen,vimWildcardBracketEnd
1215syn match vimWildcardBracketRightBracket contained "]" nextgroup=@vimWildcardBracketCharacter,vimWildcardBracketEnd
1216syn match vimWildcardBracketHyphen contained "-]\@!" nextgroup=@vimWildcardBracketCharacter
1217syn match vimWildcardBracketEscape contained "\\." nextgroup=@vimWildcardBracketCharacter,vimWildcardBracketHyphen,vimWildcardBracketEnd
1218syn match vimWildcardBracketCharacterClass contained "\[:[^:]\+:]" nextgroup=@vimWildcardBracketCharacter,vimWildcardBracketEnd
1219syn match vimWildcardBracketEquivalenceClass contained "\[=[^=]\+=]" nextgroup=@vimWildcardBracketCharacter,vimWildcardBracketEnd
1220syn match vimWildcardBracketCollatingSymbol contained "\[\.[^.]\+\.]" nextgroup=@vimWildcardBracketCharacter,vimWildcardBracketEnd
1221
1222syn match vimWildcardBracketStart contained "\[" nextgroup=vimWildcardBracketCaret,vimWildcardBracketRightBracket,@vimWildcardBracketCharacter
Eisuke Kawashima6acca4b2025-06-07 17:55:58 +02001223syn match vimWildcardBracketCaret contained "\^" nextgroup=@vimWildcardBracketCharacter,vimWildcardBracketRightBracket
Doug Kearnsfa3b1042025-04-22 19:48:13 +02001224syn match vimWildcardBracketEnd contained "]"
1225
1226syn cluster vimWildcardBracketCharacter contains=vimWildcardBracketCharacter,vimWildcardBracketEscape,vimWildcardBracketCharacterClass,vimWildcardBracketEquivalenceClass,vimWildcardBracketCollatingSymbol
1227
1228syn match vimWildcardEscape contained "\\."
1229
1230syn cluster vimWildcard contains=vimWildcardQuestion,vimWildcardStar,vimWildcardBrace,vimWildcardBracket,vimWildcardInterval
1231
1232" Autocmd and Doauto{cmd,all}: {{{2
1233" ===========================
1234
1235" TODO: explicitly match the {cmd} arg rather than bailing out to TOP
1236syn region vimAutocmdBlock contained matchgroup=vimSep start="{" end="^\s*\zs}" contains=@vimDefBodyList
1237
1238syn match vimAutocmdGroup contained "\%(\\["|[:space:]]\|[^"|[:space:]]\)\+" skipwhite nextgroup=vimAutoEvent,vimAutoEventGlob
1239syn match vimAutocmdBang contained "\a\@1<=!" skipwhite nextgroup=vimAutocmdGroup,vimAutoEvent,vimAutoEventGlob
1240
1241" TODO: cleaner handling of | in pattern position
1242" : match pattern items in addition to wildcards
1243syn region vimAutocmdPattern contained
1244 \ start="|\@!\S"
1245 \ skip="\\\\\|\\[,[:space:]]"
1246 \ end="\ze[,[:space:]]"
1247 \ end="$"
1248 \ skipwhite nextgroup=vimAutocmdPatternSep,vimAutocmdMod,vimAutocmdBlock
1249 \ contains=vimEnvvar,@vimWildcard,vimAutocmdPatternEscape
1250syn match vimAutocmdBufferPattern contained "<buffer\%(=\%(\d\+\|abuf\)\)\=>" skipwhite nextgroup=vimAutocmdPatternSep,vimAutocmdMod,vimAutocmdBlock
1251" trailing pattern separator comma allowed
1252syn match vimAutocmdPatternSep contained "," skipwhite nextgroup=@vimAutocmdPattern,vimAutocmdMod,vimAutocmdBlock
1253syn match vimAutocmdPatternEscape contained "\\."
1254syn cluster vimAutocmdPattern contains=vimAutocmdPattern,vimAutocmdBufferPattern
1255
1256" TODO: Vim9 requires '++' prefix
1257syn match vimAutocmdMod contained "\%(++\)\=\<nested\>" skipwhite nextgroup=vimAutocmdMod,vimAutocmdBlock
1258syn match vimAutocmdMod contained "++once\>" skipwhite nextgroup=vimAutocmdMod,vimAutocmdBlock
1259
1260" higher priority than vimAutocmdGroup, assume no group is so named
1261syn match vimAutoEventGlob contained "*" skipwhite nextgroup=@vimAutocmdPattern
1262syn match vimAutoEventSep contained "\a\@1<=," nextgroup=vimAutoEvent
zeertzjq8311e7d2025-06-18 18:02:47 +02001263syn match vimUserAutoEventSep contained "\a\@1<=," nextgroup=vimUserAutoEvent
Doug Kearnsfa3b1042025-04-22 19:48:13 +02001264
1265syn match vimAutocmd "\<au\%[tocmd]\>" skipwhite nextgroup=vimAutocmdBang,vimAutocmdGroup,vimAutoEvent,vimAutoEventGlob
1266
1267
1268syn match vimDoautocmdMod contained "<nomodeline>" skipwhite nextgroup=vimAutocmdGroup,vimAutoEvent
1269syn match vimDoautocmd "\<do\%[autocmd]\>" skipwhite nextgroup=vimDoautocmdMod,vimAutocmdGroup,vimAutoEvent
1270syn match vimDoautocmd "\<doautoa\%[ll]\>" skipwhite nextgroup=vimDoautocmdMod,vimAutocmdGroup,vimAutoEvent
Bram Moolenaar071d4272004-06-13 20:20:40 +00001271
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001272" Echo And Execute: -- prefer strings! {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001273" ================
dkearns61887b32024-03-15 23:45:48 +11001274" NOTE: No trailing comments
dkearnsb1427b42024-02-28 05:59:30 +11001275
dkearns61887b32024-03-15 23:45:48 +11001276syn region vimEcho
1277 \ matchgroup=vimCommand
1278 \ start="\<ec\%[ho]\>"
1279 \ start="\<echoe\%[rr]\>"
1280 \ start="\<echom\%[sg]\>"
1281 \ start="\<echoc\%[onsole]\>"
1282 \ start="\<echon\>"
1283 \ start="\<echow\%[indow]\>"
1284 \ skip=+\\|\|\n\s*\\\|\n\s*"\\ +
1285 \ matchgroup=vimCmdSep end="|" excludenl end="$" contains=@vimContinue,@vimExprList transparent
1286
1287syn match vimEchohl "\<echohl\=\>" skipwhite nextgroup=vimGroup,vimHLGroup,vimEchohlNone
Bram Moolenaar071d4272004-06-13 20:20:40 +00001288syn case ignore
dkearns61887b32024-03-15 23:45:48 +11001289syn keyword vimEchohlNone contained none
Bram Moolenaar071d4272004-06-13 20:20:40 +00001290syn case match
1291
dkearns35e6f4c2024-03-22 06:41:10 +11001292syn cluster vimEcho contains=vimEcho,vimEchohl
dkearns61887b32024-03-15 23:45:48 +11001293
1294syn 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 +11001295
Doug Kearns9b171bd2025-04-10 19:59:22 +02001296" Filter: {{{2
1297" ======
1298syn match vimExFilter "\<filt\%[er]\>" skipwhite nextgroup=vimExFilterBang,vimExFilterPattern
1299syn match vimExFilterBang contained "\a\@1<=!" skipwhite nextgroup=vimExFilterPattern
1300syn region vimExFilterPattern contained
Eisuke Kawashima6acca4b2025-06-07 17:55:58 +02001301 \ start="[[:ident:]]"
Doug Kearns9b171bd2025-04-10 19:59:22 +02001302 \ end="\ze[[:space:]\n]"
1303 \ skipwhite nextgroup=@vimCmdList
1304 \ contains=@vimSubstList
1305 \ oneline
1306syn region vimExFilterPattern contained
1307 \ matchgroup=Delimiter
1308 \ start="\z([^[:space:][:ident:]|"]\)"
1309 \ skip="\\\\\|\\\z1"
1310 \ end="\z1"
1311 \ skipwhite nextgroup=@vimCmdList
1312 \ contains=@vimSubstList
1313 \ oneline
1314
1315" Grep and Make: {{{2
1316" =============
1317" | is the command separator, escaped with \| all other backslashes are passed through literally, no tail comments
1318syn match vimGrep "\<l\=gr\%[ep]\>" skipwhite nextgroup=vimGrepBang,vimGrepArgs,vimCmdSep
1319syn match vimGrepadd "\<l\=grepa\%[dd]\>" skipwhite nextgroup=vimGrepBang,vimGrepArgs,vimCmdSep
1320syn region vimGrepArgs contained
1321 \ start="|\@!\S"
1322 \ skip=+\n\s*\%(\\\|[#"]\\ \)+
1323 \ matchgroup=vimCmdSep
1324 \ end="|"
1325 \ end="$"
1326 "\ TODO: include vimSpecFile
1327 \ contains=vimGrepBarEscape
1328syn match vimGrepBarEscape contained "\\|"
1329syn match vimGrepBang contained "\a\@1<=!" skipwhite nextgroup=vimGrepArgs,vimCmdSep
1330
1331syn match vimMake "\<l\=make\=\>" skipwhite nextgroup=vimMakeBang,vimMakeArgs,vimCmdSep
1332syn region vimMakeArgs contained
1333 \ start="|\@!\S"
1334 \ skip=+\n\s*\%(\\\|[#"]\\ \)+
1335 \ matchgroup=vimCmdSep
1336 \ end="|"
1337 \ end="$"
1338 "\ TODO: include vimSpecFile
1339 \ contains=vimMakeBarEscape
1340syn match vimMakeBarEscape contained "\\|"
1341syn match vimMakeBang contained "\a\@1<=!" skipwhite nextgroup=vimMakeArgs,vimCmdSep
1342
1343syn match vimHelpgrep "\<l\=helpg\%[rep]\>" skipwhite nextgroup=vimHelpgrepBang,vimHelpgrepPattern
1344syn region vimHelpgrepPattern contained
1345 \ start="\S"
1346 \ matchgroup=Special
1347 \ end="@\w\w\>"
1348 \ end="$"
1349 \ contains=@vimSubstList
1350 \ oneline
1351
1352" Vimgrep: {{{2
1353" =======
1354syn match vimVimgrep "\<l\=vim\%[grep]\>" skipwhite nextgroup=vimVimgrepBang,vimVimgrepPattern
1355syn match vimVimgrepadd "\<l\=vimgrepa\%[dd]\>" skipwhite nextgroup=vimVimgrepBang,vimVimgrepPattern
1356syn match vimVimgrepBang contained "\a\@1<=!" skipwhite nextgroup=vimVimgrepPattern
1357syn region vimVimgrepPattern contained
Eisuke Kawashima6acca4b2025-06-07 17:55:58 +02001358 \ start="[[:ident:]]"
Doug Kearns9b171bd2025-04-10 19:59:22 +02001359 \ end="\ze[[:space:]\n]"
1360 \ skipwhite nextgroup=vimVimgrepFile,vimCmdSep
1361 \ contains=@vimSubstList
1362 \ oneline
1363syn region vimVimgrepPattern contained
1364 \ matchgroup=Delimiter
1365 \ start="\z([^[:space:][:ident:]|"]\)"
1366 \ skip="\\\\\|\\\z1"
1367 \ end="\z1"
1368 \ skipwhite nextgroup=vimVimgrepFlags,vimVimgrepFile,vimCmdSep
1369 \ contains=@vimSubstList
1370 \ oneline
1371syn match vimVimgrepEscape contained "\\\%(\\|\|.\)"
1372syn match vimVimgrepBarEscape contained "\\|"
1373syn region vimVimgrepFile contained
1374 \ start="|\@!\S"
1375 \ matchgroup=vimCmdSep
1376 \ end="|"
1377 \ end="\ze\s"
1378 \ end="$"
1379 \ skipwhite nextgroup=vimVimgrepFile
1380 \ contains=vimSpecFile,vimVimgrepEscape,vimVimgrepBarEscape
1381syn match vimVimgrepFlags contained "\<[gjf]\{,3\}\>" skipwhite nextgroup=vimVimgrepfile
1382
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001383" Maps: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001384" ====
Doug Kearns99984fc2024-07-18 20:45:19 +02001385" GEN_SYN_VIM: vimCommand map, START_STR='syn keyword vimMap', END_STR='skipwhite nextgroup=vimMapMod,vimMapLhs'
1386syn 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
1387syn match vimMap "\<map\>" skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
1388syn keyword vimMap no[remap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
dkearns16249702024-02-23 05:45:05 +11001389" GEN_SYN_VIM: vimCommand mapclear, START_STR='syn keyword vimMap', END_STR='skipwhite nextgroup=vimMapMod'
1390syn 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 +02001391syn keyword vimMap mapc[lear] skipwhite nextgroup=vimMapBang,vimMapMod
1392" GEN_SYN_VIM: vimCommand unmap, START_STR='syn keyword vimUnmap', END_STR='skipwhite nextgroup=vimMapMod,vimMapLhs'
1393syn keyword vimUnmap cu[nmap] iu[nmap] lu[nmap] nun[map] ou[nmap] sunm[ap] tunma[p] vu[nmap] xu[nmap] skipwhite nextgroup=vimMapMod,vimMapLhs
1394syn keyword vimUnmap unm[ap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
1395
Doug Kearns6bdfeb02025-03-07 18:49:11 +01001396syn match vimMapLhs contained "\%(.\|\S\)\+" contains=vimCtrlChar,vimNotation,vimMapLeader skipwhite nextgroup=vimMapRhs
1397syn match vimMapLhs contained "\%(.\|\S\)\+\ze\s*$" contains=vimCtrlChar,vimNotation,vimMapLeader skipwhite skipnl nextgroup=vimMapRhsContinue
dkearns5d67aef2024-03-10 04:01:22 +11001398syn match vimMapBang contained "\a\@1<=!" skipwhite nextgroup=vimMapMod,vimMapLhs
Doug Kearns6bdfeb02025-03-07 18:49:11 +01001399syn match vimMapMod contained "\%#=1<\%(buffer\|expr\|nowait\|script\|silent\|special\|unique\)\+>" contains=vimMapModKey,vimMapModErr skipwhite nextgroup=vimMapMod,vimMapLhs
1400syn 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 +11001401" assume a continuation comment introduces the RHS
Doug Kearns6bdfeb02025-03-07 18:49:11 +01001402syn region vimMapRhsContinue contained start=+^\s*\%(\\\|"\\ \)+ skip=+\\|\|\@1<=|\|\n\s*\\\|\n\s*"\\ + end="|" end="$" contains=@vimContinue,vimCtrlChar,vimNotation,vimMapLeader
1403syn match vimMapLeader contained "\%#=1\c<\%(local\)\=leader>" contains=vimMapLeaderKey
1404syn keyword vimMapModKey contained buffer expr nowait script silent special unique
Bram Moolenaar071d4272004-06-13 20:20:40 +00001405syn case ignore
Doug Kearns6bdfeb02025-03-07 18:49:11 +01001406syn keyword vimMapLeaderKey contained leader localleader
Bram Moolenaar071d4272004-06-13 20:20:40 +00001407syn case match
1408
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001409" Menus: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001410" =====
dkearns62b26042024-03-10 03:43:28 +11001411" NOTE: tail comments disallowed
1412" GEN_SYN_VIM: vimCommand menu, START_STR='syn keyword vimMenu', END_STR='skipwhite nextgroup=vimMenuBang,vimMenuMod,vimMenuName,vimMenuPriority,vimMenuStatus'
1413syn 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
1414syn keyword vimMenu popu[p] skipwhite nextgroup=vimMenuBang,vimMenuName
1415syn region vimMenuRhs contained contains=@vimContinue,vimNotation start="|\@!\S" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + end="$" matchgroup=vimSep end="|"
1416syn region vimMenuRhsContinue contained contains=@vimContinue,vimNotation start=+^\s*\%(\\\|"\\ \)+ skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + end="$" matchgroup=vimSep end="|"
dkearnsec21baf2024-03-20 04:04:42 +11001417syn match vimMenuName "\.\@!\%(\\\s\|\S\)\+" contained contains=vimMenuNotation,vimNotation skipwhite nextgroup=vimCmdSep,vimMenuRhs
1418syn match vimMenuName "\.\@!\%(\\\s\|\S\)\+\ze\s*$" contained contains=vimMenuNotation,vimNotation skipwhite skipnl nextgroup=vimCmdSep,vimMenuRhsContinue
dkearns62b26042024-03-10 03:43:28 +11001419syn match vimMenuNotation "&\a\|&&\|\\\s\|\\\." contained
1420syn match vimMenuPriority "\<\d\+\%(\.\d\+\)*\>" contained skipwhite nextgroup=vimMenuName
1421syn match vimMenuMod "\c<\%(script\|silent\|special\)>" contained skipwhite nextgroup=vimMenuName,vimMenuPriority,vimMenuMod contains=vimMapModKey,vimMapModErr
1422syn keyword vimMenuStatus enable disable nextgroup=vimMenuName skipwhite
1423syn match vimMenuBang "\a\@1<=!" contained skipwhite nextgroup=vimMenuName,vimMenuMod
1424
1425syn region vimMenutranslate
1426 \ matchgroup=vimCommand start="\<menut\%[ranslate]\>"
1427 \ skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ +
1428 \ end="$" matchgroup=vimCmdSep end="|" matchgroup=vimMenuClear end="\<clear\ze\s*\%(["#|]\|$\)"
1429 \ contains=@vimContinue,vimMenutranslateName keepend transparent
1430" oneline is sufficient to match the current formatting in runtime/lang/*.vim
1431syn match vimMenutranslateName "\%(\\\s\|\S\)\+" contained contains=vimMenuNotation,vimNotation
1432syn match vimMenutranslateComment +".*+ contained containedin=vimMenutranslate
Bram Moolenaar071d4272004-06-13 20:20:40 +00001433
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001434" Angle-Bracket Notation: (tnx to Michael Geddes) {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001435" ======================
1436syn case ignore
Doug Kearns68ba6c22025-02-16 16:40:12 +01001437syn 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 +11001438
Doug Kearns68ba6c22025-02-16 16:40:12 +01001439syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}\%(net\|dec\|jsb\|pterm\|urxvt\|sgr\)mouse>" contains=vimBracket
1440syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}\%(left\|middle\|right\)\%(mouse\|drag\|release\)>" contains=vimBracket
1441syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}left\%(mouse\|release\)nm>" contains=vimBracket
1442syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}x[12]\%(mouse\|drag\|release\)>" contains=vimBracket
1443syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}sgrmouserelease>" contains=vimBracket
1444syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}mouse\%(up\|down\|move\)>" contains=vimBracket
1445syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}scrollwheel\%(up\|down\|right\|left\)>" contains=vimBracket
dkearnse3e39342024-02-02 07:44:26 +11001446
Doug Kearns68ba6c22025-02-16 16:40:12 +01001447syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%(sid\|nop\|nul\|lt\|drop\)>" contains=vimBracket
1448syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%(snr\|plug\|cursorhold\|ignore\|cmd\|scriptcmd\|focus\%(gained\|lost\)\)>" contains=vimBracket
Doug Kearnsc29b5332025-04-26 20:14:15 +02001449" syn match vimNotation contained '\%(\\\|<lt>\)\=<C-R>[0-9a-z"%#:.\-=]'he=e-1 contains=vimBracket
Doug Kearns68ba6c22025-02-16 16:40:12 +01001450syn match vimNotation contained '\%#=1\%(\\\|<lt>\)\=<\%(q-\)\=\%(line[12]\|count\|bang\|reg\|args\|mods\|f-args\|f-mods\|lt\)>' contains=vimBracket
1451syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([cas]file\|abuf\|amatch\|cexpr\|cword\|cWORD\|client\|stack\|script\|sf\=lnum\)>" contains=vimBracket
1452syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd]-\)\{0,4}char-\%(\d\+\|0\o\+\|0x\x\+\)>" contains=vimBracket
dkearnse3e39342024-02-02 07:44:26 +11001453
Bram Moolenaar5c736222010-01-06 20:54:52 +01001454syn match vimBracket contained "[\\<>]"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001455syn case match
1456
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001457" User Function Highlighting: {{{2
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00001458" (following Gautam Iyer's suggestion)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001459" ==========================
Doug Kearns1aa287e2025-02-10 22:00:27 +01001460syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" skipwhite nextgroup=vimOperParen contains=vimFuncEcho,vimFuncName,vimUserFunc,vimExecute
1461syn 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 +11001462syn keyword vimFuncEcho contained ec ech echo
1463
Doug Kearns99984fc2024-07-18 20:45:19 +02001464syn match vimMap "\<map\%(\s\+(\)\@=" skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
1465
Bram Moolenaar2547aa92020-07-26 17:00:44 +02001466" User Command Highlighting: {{{2
Bram Moolenaard2ea7cf2021-05-30 20:54:13 +02001467syn match vimUsrCmd '^\s*\zs\u\%(\w*\)\@>\%([(#[]\|\s\+\%([-+*/%]\=\|\.\.\)=\)\@!'
Bram Moolenaar2547aa92020-07-26 17:00:44 +02001468
Doug Kearns025dc482025-02-23 15:48:52 +01001469" Vim user commands
1470
1471" Compiler plugins
Doug Kearns6bdfeb02025-03-07 18:49:11 +01001472syn match vimCompilerSet "\<CompilerSet\>" skipwhite nextgroup=vimSetArgs
Doug Kearns025dc482025-02-23 15:48:52 +01001473
1474" runtime/makemenu.vim
1475syn match vimSynMenu "\<SynMenu\>" skipwhite nextgroup=vimSynMenuPath
1476syn match vimSynMenuPath contained ".*\ze:" nextgroup=vimSynMenuColon contains=vimMenuNotation
1477syn match vimSynMenuColon contained ":" nextgroup=vimSynMenuName
1478syn match vimSynMenuName contained "\w\+"
1479
1480syn cluster vimExUserCmdList contains=vimCompilerSet,vimSynMenu
1481
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00001482" Errors And Warnings: {{{2
1483" ====================
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001484if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimfunctionerror")
Doug Kearns51289202025-06-11 21:16:14 +02001485 syn match vimFunctionError contained "[[:space:]!]\@1<=\<[a-z0-9]\w\{-}\ze\s*("
1486 syn match vimFunctionError contained "\%(<[sS][iI][dD]>\|[sg]:\)\d\w\{-}\ze\s*("
Bram Moolenaar5c736222010-01-06 20:54:52 +01001487 syn match vimElseIfErr "\<else\s\+if\>"
1488 syn match vimBufnrWarn /\<bufnr\s*(\s*["']\.['"]\s*)/
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00001489endif
1490
Doug Kearnsc29b5332025-04-26 20:14:15 +02001491" If, While and Return: {{{2
1492" ====================
Doug Kearns68ba6c22025-02-16 16:40:12 +01001493syn match vimNotFunc "\%#=1\<\%(if\|el\%[seif]\|retu\%[rn]\|while\)\>" skipwhite nextgroup=@vimExprList,vimNotation
Doug Kearnsc29b5332025-04-26 20:14:15 +02001494syn match vimElse "\<el\%[se]\>" skipwhite nextgroup=vimComment,vim9Comment
1495syn match vimEndif "\<en\%[dif]\>" skipwhite nextgroup=vimComment,vim9Comment
Bram Moolenaar6c1e1572019-06-22 02:13:00 +02001496
Doug Kearnse85fdc72024-07-07 20:45:37 +02001497" Match: {{{2
1498" =====
1499syn match vimMatch "\<[23]\=mat\%[ch]\>" skipwhite nextgroup=vimMatchGroup,vimMatchNone
1500syn match vimMatchGroup contained "[[:alnum:]._-]\+" skipwhite nextgroup=vimMatchPattern
1501syn case ignore
1502syn keyword vimMatchNone contained none
1503syn case match
1504syn region vimMatchPattern contained matchgroup=Delimiter start="\z([!#$%&'()*+,-./:;<=>?@[\]^_`{}~]\)" skip="\\\\\|\\\z1" end="\z1" contains=@vimSubstList oneline
1505
Doug Kearnsbbe52522024-11-09 19:11:25 +01001506" Normal: {{{2
1507" ======
1508syn match vimNormal "\<norm\%[al]\>!\=" skipwhite nextgroup=vimNormalArg contains=vimBang
1509syn region vimNormalArg contained start="\S" skip=+\n\s*\\\|\n\s*["#]\\ + end="$" contains=@vimContinue
Bram Moolenaar05159a02005-02-26 23:04:13 +00001510
Doug Kearns0aaf6f82025-06-01 18:26:39 +02001511" Profile: {{{2
1512" =======
1513syn match vimProfileBang contained "\a\@1<=!" skipwhite nextgroup=vimProfileArg
1514syn keyword vimProfileArg contained start skipwhite nextgroup=vimProfilePattern
1515syn keyword vimProfileArg contained func skipwhite nextgroup=vimProfilePattern
1516syn keyword vimProfileArg contained file skipwhite nextgroup=vimProfilePattern
1517syn keyword vimProfileArg contained stop pause skipwhite nextgroup=vimCmdSep,@vimComment
1518syn keyword vimProfileArg contained continue dump skipwhite nextgroup=vimCmdSep,@vimComment
1519" TODO: match file pattern
1520syn region vimProfilePattern contained
1521 \ start="\S"
1522 \ skip=+\\[|"#]+
1523 \ end="$" end=+\ze\s*[|"#]+
1524 \ skipwhite nextgroup=vimCmdSep,vimComment,vim9Comment
1525syn match vimProfile "\<prof\%[ile]\>" skipwhite nextgroup=vimProfileBang,vimProfileArg
1526
Doug Kearns3993cd62025-06-02 19:31:10 +02001527syn keyword vimProfdelArg contained func skipwhite nextgroup=vimProfilePattern
1528syn keyword vimProfdelArg contained file skipwhite nextgroup=vimProfilePattern
1529syn keyword vimProfdelArg contained here skipwhite nextgroup=vimCmdSep,@vimComment
Doug Kearns0aaf6f82025-06-01 18:26:39 +02001530syn match vimProfdel "\<profd\%[el]\>" skipwhite nextgroup=vimProfdelArg
1531
Doug Kearns2f5a8c02025-04-05 15:55:36 +02001532" Redir: {{{2
1533" =====
1534syn match vimRedir "\<redir\=\>" skipwhite nextgroup=vimRedirBang,vimRedirFileOperator,vimRedirVariableOperator,vimRedirRegister,vimRedirEnd
1535syn match vimRedirBang contained "\a\@1<=!" skipwhite nextgroup=vimRedirFileOperator
1536
1537syn match vimRedirFileOperator contained ">>\=" skipwhite nextgroup=vimRedirFile
1538syn region vimRedirFile contained
1539 \ start="\S"
1540 \ matchgroup=Normal
1541 \ end="\s*$"
1542 \ end="\s*\ze[|"]"
1543 \ nextgroup=vimCmdSep,vimComment
1544 \ contains=vimSpecFile
1545syn match vimRedirRegisterOperator contained ">>\="
1546syn match vimRedirRegister contained "@[a-zA-Z*+"]" nextgroup=vimRedirRegisterOperator
1547syn match vimRedirVariableOperator contained "=>>\=" skipwhite nextgroup=vimVar
1548syn keyword vimRedirEnd contained END
1549
Doug Kearns262e25e2024-06-14 20:16:35 +02001550" Sleep: {{{2
1551" =====
1552syn keyword vimSleep sl[eep] skipwhite nextgroup=vimSleepBang,vimSleepArg
1553syn match vimSleepBang contained "\a\@1<=!" skipwhite nextgroup=vimSleepArg
1554syn match vimSleepArg contained "\<\%(\d\+\)\=m\=\>"
1555
Doug Kearns9b171bd2025-04-10 19:59:22 +02001556" Sort: {{{2
1557" ====
1558syn match vimSort "\<sort\=\>" skipwhite nextgroup=vimSortBang,@vimSortOptions,vimSortPattern,vimCmdSep
1559syn match vimSortBang contained "\a\@1<=!" skipwhite nextgroup=@vimSortOptions,vimSortPattern,vimCmdSep
1560syn match vimSortOptionsError contained "\a\+"
1561syn match vimSortOptions contained "\<[ilur]*[nfxob]\=[ilur]*\>" skipwhite nextgroup=vimSortPattern,vimCmdSep
1562syn region vimSortPattern contained
1563 \ matchgroup=Delimiter
1564 \ start="\z([^[:space:][:alpha:]|]\)"
1565 \ skip="\\\\\|\\\z1"
1566 \ end="\z1"
1567 \ skipwhite nextgroup=@vimSortOptions,vimCmdSep
1568 \ contains=@vimSubstList
1569 \ oneline
1570
1571syn cluster vimSortOptions contains=vimSortOptions,vimSortOptionsError
1572
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001573" Syntax: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001574"=======
dkearns21ce1592024-01-29 04:54:08 +11001575syn match vimGroupList contained "[^[:space:],]\+\%(\s*,\s*[^[:space:],]\+\)*" contains=vimGroupSpecial
1576syn 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
1577syn keyword vimGroupSpecial contained ALL ALLBUT CONTAINED TOP
1578
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001579if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsynerror")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001580 syn match vimSynError contained "\i\+"
1581 syn match vimSynError contained "\i\+=" nextgroup=vimGroupList
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001582endif
dkearns21ce1592024-01-29 04:54:08 +11001583syn match vimSynContains contained "\<contain\%(s\|edin\)=" skipwhite skipnl nextgroup=vimGroupList
1584syn match vimSynKeyContainedin contained "\<containedin=" skipwhite skipnl nextgroup=vimGroupList
1585syn match vimSynNextgroup contained "\<nextgroup=" skipwhite skipnl nextgroup=vimGroupList
dkearnsc79646d2024-01-05 08:58:48 +11001586if has("conceal")
dkearns21ce1592024-01-29 04:54:08 +11001587 " no whitespace allowed after '='
dkearnsc79646d2024-01-05 08:58:48 +11001588 syn match vimSynCchar contained "\<cchar=" nextgroup=vimSynCcharValue
1589 syn match vimSynCcharValue contained "\S"
1590endif
1591
dkearns04e53632024-04-11 06:18:37 +10001592syn match vimSyntax "\<sy\%[ntax]\>" contains=vimCommand skipwhite nextgroup=vimSynType,@vimComment
Doug Kearns51289202025-06-11 21:16:14 +02001593syn cluster vimFunctionBodyList add=vimSyntax
Bram Moolenaar071d4272004-06-13 20:20:40 +00001594
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001595" Syntax: case {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +01001596syn keyword vimSynType contained case skipwhite nextgroup=vimSynCase,vimSynCaseError
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001597if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsyncaseerror")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001598 syn match vimSynCaseError contained "\i\+"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001599endif
Bram Moolenaar5c736222010-01-06 20:54:52 +01001600syn keyword vimSynCase contained ignore match
Bram Moolenaar071d4272004-06-13 20:20:40 +00001601
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001602" Syntax: clear {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +01001603syn keyword vimSynType contained clear skipwhite nextgroup=vimGroupList
Bram Moolenaar071d4272004-06-13 20:20:40 +00001604
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001605" Syntax: cluster {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +01001606syn keyword vimSynType contained cluster skipwhite nextgroup=vimClusterName
dkearns21ce1592024-01-29 04:54:08 +11001607syn region vimClusterName contained keepend matchgroup=vimGroupName start="\h\w*\>" skip=+\\\\\|\\\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="$\||" contains=@vimContinue,vimGroupAdd,vimGroupRem,vimSynContains,vimSynError
1608syn match vimGroupAdd contained keepend "\<add=" skipwhite skipnl nextgroup=vimGroupList
1609syn match vimGroupRem contained keepend "\<remove=" skipwhite skipnl nextgroup=vimGroupList
Bram Moolenaar071d4272004-06-13 20:20:40 +00001610
Doug Kearns0fab8912025-03-10 21:04:53 +01001611" Syntax: conceal {{{2
1612syn match vimSynType contained "\<conceal\>" skipwhite nextgroup=vimSynConceal,vimSynConcealError
1613if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsynconcealerror")
1614 syn match vimSynConcealError contained "\i\+"
Brad Kingd4634a22024-01-03 10:17:24 -05001615endif
Doug Kearns0fab8912025-03-10 21:04:53 +01001616syn keyword vimSynConceal contained on off
1617
1618" Syntax: foldlevel {{{2
1619syn keyword vimSynType contained foldlevel skipwhite nextgroup=vimSynFoldlevel,vimSynFoldlevelError
1620if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsynfoldlevelerror")
1621 syn match vimSynFoldlevelError contained "\i\+"
1622endif
1623syn keyword vimSynFoldlevel contained start minimum
Brad Kingd4634a22024-01-03 10:17:24 -05001624
Bram Moolenaar13d5aee2016-01-21 23:36:05 +01001625" Syntax: iskeyword {{{2
Doug Kearns0fab8912025-03-10 21:04:53 +01001626syn keyword vimSynType contained iskeyword skipwhite nextgroup=vimSynIskeyword
1627syn keyword vimSynIskeyword contained clear
1628syn match vimSynIskeyword contained "\S\+" contains=vimSynIskeywordSep
1629syn match vimSynIskeywordSep contained ","
Bram Moolenaar13d5aee2016-01-21 23:36:05 +01001630
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001631" Syntax: include {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +01001632syn keyword vimSynType contained include skipwhite nextgroup=vimGroupList
Bram Moolenaar071d4272004-06-13 20:20:40 +00001633
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001634" Syntax: keyword {{{2
dkearns21ce1592024-01-29 04:54:08 +11001635syn cluster vimSynKeyGroup contains=@vimContinue,vimSynCchar,vimSynNextgroup,vimSynKeyOpt,vimSynKeyContainedin
Bram Moolenaar5c736222010-01-06 20:54:52 +01001636syn keyword vimSynType contained keyword skipwhite nextgroup=vimSynKeyRegion
dkearns21ce1592024-01-29 04:54:08 +11001637syn 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 +01001638syn match vimSynKeyOpt contained "\%#=1\<\%(conceal\|contained\|transparent\|skipempty\|skipwhite\|skipnl\)\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001639
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001640" Syntax: match {{{2
dkearns21ce1592024-01-29 04:54:08 +11001641syn cluster vimSynMtchGroup contains=@vimContinue,vimSynCchar,vimSynContains,vimSynError,vimSynMtchOpt,vimSynNextgroup,vimSynRegPat,vimNotation,vimMtchComment
Bram Moolenaar5c736222010-01-06 20:54:52 +01001642syn keyword vimSynType contained match skipwhite nextgroup=vimSynMatchRegion
dkearns21ce1592024-01-29 04:54:08 +11001643syn 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 +01001644syn match vimSynMtchOpt contained "\%#=1\<\%(conceal\|transparent\|contained\|excludenl\|keepend\|skipempty\|skipwhite\|display\|extend\|skipnl\|fold\)\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001645
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001646" Syntax: off and on {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +01001647syn keyword vimSynType contained enable list manual off on reset
Bram Moolenaar071d4272004-06-13 20:20:40 +00001648
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001649" Syntax: region {{{2
dkearns21ce1592024-01-29 04:54:08 +11001650syn cluster vimSynRegPatGroup contains=@vimContinue,vimPatSep,vimNotPatSep,vimSynPatRange,vimSynNotPatRange,vimSubstSubstr,vimPatRegion,vimPatSepErr,vimNotation
1651syn cluster vimSynRegGroup contains=@vimContinue,vimSynCchar,vimSynContains,vimSynNextgroup,vimSynRegOpt,vimSynReg,vimSynMtchGrp
Bram Moolenaar5c736222010-01-06 20:54:52 +01001652syn keyword vimSynType contained region skipwhite nextgroup=vimSynRegion
Doug Kearns0fab8912025-03-10 21:04:53 +01001653syn region vimSynRegion contained keepend matchgroup=vimGroupName start="\h\w*" skip=+\\\\\|\\\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|\|$" contains=@vimSynRegGroup
1654syn match vimSynRegOpt contained "\%#=1\<\%(conceal\%(ends\)\=\|transparent\|contained\|excludenl\|skipempty\|skipwhite\|display\|keepend\|oneline\|extend\|skipnl\|fold\)\>"
dkearns21ce1592024-01-29 04:54:08 +11001655syn match vimSynReg contained "\<\%(start\|skip\|end\)=" nextgroup=vimSynRegPat
Bram Moolenaar5c736222010-01-06 20:54:52 +01001656syn match vimSynMtchGrp contained "matchgroup=" nextgroup=vimGroup,vimHLGroup
dkearns21ce1592024-01-29 04:54:08 +11001657syn 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 +01001658syn match vimSynPatMod contained "\%#=1\%(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\%([-+]\d\+\)\="
1659syn match vimSynPatMod contained "\%#=1\%(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\%([-+]\d\+\)\=," nextgroup=vimSynPatMod
Bram Moolenaar5c736222010-01-06 20:54:52 +01001660syn match vimSynPatMod contained "lc=\d\+"
1661syn match vimSynPatMod contained "lc=\d\+," nextgroup=vimSynPatMod
1662syn region vimSynPatRange contained start="\[" skip="\\\\\|\\]" end="]"
1663syn match vimSynNotPatRange contained "\\\\\|\\\["
1664syn match vimMtchComment contained '"[^"]\+$'
Bram Moolenaar071d4272004-06-13 20:20:40 +00001665
Doug Kearns0fab8912025-03-10 21:04:53 +01001666" Syntax: spell {{{2
1667syn keyword vimSynType contained spell skipwhite nextgroup=vimSynSpell,vimSynSpellError
1668if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsynspellerror")
1669 syn match vimSynSpellError contained "\i\+"
1670endif
1671syn keyword vimSynSpell contained default notoplevel toplevel
1672
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001673" Syntax: sync {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001674" ============
Doug Kearns0fab8912025-03-10 21:04:53 +01001675syn keyword vimSynType contained sync skipwhite nextgroup=vimSyncClear,vimSyncMatch,vimSyncError,vimSyncRegion,vimSyncArgs
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001676if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsyncerror")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001677 syn match vimSyncError contained "\i\+"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001678endif
Doug Kearns0fab8912025-03-10 21:04:53 +01001679
1680syn region vimSyncArgs contained start="\S" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|\|$" contains=vimSyncLines,vimSyncLinebreak,vimSyncLinecont,vimSyncFromstart,vimSyncCcomment
1681
1682syn keyword vimSyncCcomment contained ccomment skipwhite nextgroup=vimGroupName
1683syn keyword vimSyncClear contained clear skipwhite nextgroup=vimSyncGroupName
1684syn keyword vimSyncFromstart contained fromstart
Bram Moolenaar5c736222010-01-06 20:54:52 +01001685syn keyword vimSyncMatch contained match skipwhite nextgroup=vimSyncGroupName
Doug Kearnsb55f0222025-03-15 09:29:31 +01001686syn keyword vimSyncRegion contained region skipwhite nextgroup=vimSynRegion
Doug Kearns0fab8912025-03-10 21:04:53 +01001687syn match vimSyncLinebreak contained "\<linebreaks=" nextgroup=vimNumber
Bram Moolenaar5c736222010-01-06 20:54:52 +01001688syn keyword vimSyncLinecont contained linecont skipwhite nextgroup=vimSynRegPat
Doug Kearns0fab8912025-03-10 21:04:53 +01001689syn match vimSyncLines contained "\<lines=" nextgroup=vimNumber
1690syn match vimSyncLines contained "\<minlines=" nextgroup=vimNumber
1691syn match vimSyncLines contained "\<maxlines=" nextgroup=vimNumber
1692syn match vimSyncGroupName contained "\<\h\w*\>" skipwhite nextgroup=vimSyncKey
1693syn match vimSyncKey contained "\<grouphere\>" skipwhite nextgroup=vimSyncGroup
1694syn match vimSyncKey contained "\<groupthere\>" skipwhite nextgroup=vimSyncGroup
1695syn match vimSyncGroup contained "\<\h\w*\>" skipwhite nextgroup=vimSynRegPat,vimSyncNone
Bram Moolenaar5c736222010-01-06 20:54:52 +01001696syn keyword vimSyncNone contained NONE
Bram Moolenaar071d4272004-06-13 20:20:40 +00001697
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001698" Additional IsCommand: here by reasons of precedence {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001699" ====================
Bram Moolenaar5c736222010-01-06 20:54:52 +01001700syn match vimIsCommand "<Bar>\s*\a\+" transparent contains=vimCommand,vimNotation
Bram Moolenaar071d4272004-06-13 20:20:40 +00001701
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001702" Highlighting: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001703" ============
dkearns04e53632024-04-11 06:18:37 +10001704syn cluster vimHighlightCluster contains=vimHiLink,vimHiClear,vimHiKeyList,@vimComment
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001705if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimhictermerror")
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001706 syn match vimHiCtermError contained "\D\i*"
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001707endif
Bram Moolenaar5c736222010-01-06 20:54:52 +01001708syn match vimHighlight "\<hi\%[ghlight]\>" skipwhite nextgroup=vimHiBang,@vimHighlightCluster
dkearns9530fe42024-03-19 05:19:51 +11001709syn match vimHiBang contained "\a\@1<=!" skipwhite nextgroup=@vimHighlightCluster
Bram Moolenaard960d762011-09-21 19:22:10 +02001710
Bram Moolenaar5c736222010-01-06 20:54:52 +01001711syn match vimHiGroup contained "\i\+"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001712syn case ignore
Doug Kearns0fab8912025-03-10 21:04:53 +01001713syn keyword vimHiNone contained NONE
dkearnsb614b282024-02-12 03:13:34 +11001714syn keyword vimHiAttrib contained none bold inverse italic nocombine reverse standout strikethrough underline undercurl underdashed underdotted underdouble
Bram Moolenaar5c736222010-01-06 20:54:52 +01001715syn keyword vimFgBgAttrib contained none bg background fg foreground
Bram Moolenaar071d4272004-06-13 20:20:40 +00001716syn case match
Bram Moolenaar5c736222010-01-06 20:54:52 +01001717syn match vimHiAttribList contained "\i\+" contains=vimHiAttrib
1718syn match vimHiAttribList contained "\i\+,"he=e-1 contains=vimHiAttrib nextgroup=vimHiAttribList
Bram Moolenaar071d4272004-06-13 20:20:40 +00001719syn case ignore
Bram Moolenaard2ea7cf2021-05-30 20:54:13 +02001720syn 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 +01001721syn match vimHiCtermColor contained "\<color\d\{1,3}\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001722syn case match
Doug Kearns0fab8912025-03-10 21:04:53 +01001723
Bram Moolenaar5c736222010-01-06 20:54:52 +01001724syn match vimHiFontname contained "[a-zA-Z\-*]\+"
1725syn match vimHiGuiFontname contained "'[a-zA-Z\-* ]\+'"
1726syn match vimHiGuiRgb contained "#\x\{6}"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001727
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001728" Highlighting: hi group key=arg ... {{{2
Eisuke Kawashima834bb852025-06-07 17:59:11 +02001729syn cluster vimHiCluster contains=vimGroup,vimHLGroup,vimHiGroup,vimHiNone,vimHiTerm,vimHiCTerm,vimHiStartStop,vimHiCtermFgBg,vimHiCtermul,vimHiCtermfont,vimHiGui,vimHiGuiFont,vimHiGuiFgBg,vimHiKeyError,vimNotation,vimComment,vim9comment
dkearns9530fe42024-03-19 05:19:51 +11001730syn 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 +01001731if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_vimhikeyerror")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001732 syn match vimHiKeyError contained "\i\+="he=e-1
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001733endif
Bram Moolenaar5c736222010-01-06 20:54:52 +01001734syn match vimHiTerm contained "\cterm="he=e-1 nextgroup=vimHiAttribList
dkearns9530fe42024-03-19 05:19:51 +11001735syn match vimHiStartStop contained "\c\%(start\|stop\)="he=e-1 nextgroup=vimHiTermcap,vimOption
Bram Moolenaar5c736222010-01-06 20:54:52 +01001736syn match vimHiCTerm contained "\ccterm="he=e-1 nextgroup=vimHiAttribList
Bram Moolenaar83d1b192015-04-13 14:22:40 +02001737syn match vimHiCtermFgBg contained "\ccterm[fb]g="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
Bram Moolenaar2547aa92020-07-26 17:00:44 +02001738syn match vimHiCtermul contained "\cctermul="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
PMuncha606f3a2023-11-15 15:35:49 +01001739syn match vimHiCtermfont contained "\cctermfont="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
Bram Moolenaar5c736222010-01-06 20:54:52 +01001740syn match vimHiGui contained "\cgui="he=e-1 nextgroup=vimHiAttribList
1741syn match vimHiGuiFont contained "\cfont="he=e-1 nextgroup=vimHiFontname
1742syn match vimHiGuiFgBg contained "\cgui\%([fb]g\|sp\)="he=e-1 nextgroup=vimHiGroup,vimHiGuiFontname,vimHiGuiRgb,vimFgBgAttrib
1743syn match vimHiTermcap contained "\S\+" contains=vimNotation
Bram Moolenaar83d1b192015-04-13 14:22:40 +02001744syn match vimHiNmbr contained '\d\+'
Bram Moolenaar071d4272004-06-13 20:20:40 +00001745
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001746" Highlight: clear {{{2
Eisuke Kawashima834bb852025-06-07 17:59:11 +02001747syn keyword vimHiClear contained clear skipwhite nextgroup=vimGroup,vimHLGroup,vimHiGroup
Bram Moolenaar071d4272004-06-13 20:20:40 +00001748
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001749" Highlight: link {{{2
Bram Moolenaard2855f52018-07-31 22:23:58 +02001750" see tst24 (hi def vs hi) (Jul 06, 2018)
1751"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 +11001752" TODO: simplify and allow line continuations --djk
1753syn 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 +00001754
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001755" Control Characters: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001756" ==================
Bram Moolenaar5c736222010-01-06 20:54:52 +01001757syn match vimCtrlChar "[- -]"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001758
Doug Kearnsa577e422025-05-17 16:29:13 +02001759" Embedded Scripts: {{{2
1760" ================
1761" perl,ruby : Benoit Cerrina
1762" python,tcl : Johannes Zellner
1763" mzscheme, lua : Charles Campbell
1764
1765" Allows users to specify the type of embedded script highlighting
1766" they want: (lua/mzscheme/perl/python/ruby/tcl support)
1767" g:vimsyn_embed == 0 : don't embed any scripts
1768" g:vimsyn_embed =~# 'l' : embed Lua
1769" g:vimsyn_embed =~# 'm' : embed MzScheme
1770" g:vimsyn_embed =~# 'p' : embed Perl
1771" g:vimsyn_embed =~# 'P' : embed Python
1772" g:vimsyn_embed =~# 'r' : embed Ruby
1773" g:vimsyn_embed =~# 't' : embed Tcl
1774
1775let s:interfaces = get(g:, "vimsyn_embed", "lP")
1776
1777" [-- lua --] {{{3
1778if s:interfaces =~# 'l'
1779 syn include @vimLuaScript syntax/lua.vim
1780 unlet b:current_syntax
Doug Kearnsa577e422025-05-17 16:29:13 +02001781endif
1782
1783syn keyword vimLua lua skipwhite nextgroup=vimLuaHeredoc,vimLuaStatement
1784syn keyword vimLua luado skipwhite nextgroup=vimLuaStatement
1785syn keyword vimLua luafile
1786
1787syn region vimLuaStatement contained
1788 \ start="\S"
1789 \ skip=+\n\s*\%(\\\|["#]\\ \)+
1790 \ end="$"
1791 \ contains=@vimLuaScript,@vimContinue
1792VimFoldl syn region vimLuaHeredoc contained
1793 \ matchgroup=vimScriptHeredocStart
1794 \ start=+<<\s*\z(\S\+\)\ze\s*$+
1795 \ matchgroup=vimScriptHeredocStop
1796 \ end=+^\z1$+
1797 \ contains=@vimLuaScript
1798VimFoldl syn region vimLuaHeredoc contained
1799 \ matchgroup=vimScriptHeredocStart
1800 \ start=+<<\ze\s*$+
1801 \ matchgroup=vimScriptHeredocStop
1802 \ end=+^\.$+
1803 \ contains=@vimLuaScript
1804VimFoldl syn region vimLuaHeredoc contained
1805 \ matchgroup=vimScriptHeredocStart
1806 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\s\+\z(\S\+\)\ze\s*$+
1807 \ matchgroup=vimScriptHeredocStop
1808 \ end=+^\z1\=\z2$+
1809 \ contains=@vimLuaScript
1810VimFoldl syn region vimLuaHeredoc contained
1811 \ matchgroup=vimScriptHeredocStart
1812 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\ze\s*$+
1813 \ matchgroup=vimScriptHeredocStop
1814 \ end=+^\z1\=\.$+
1815 \ contains=@vimLuaScript
1816
1817" [-- mzscheme --] {{{3
1818if s:interfaces =~# 'm'
1819 let s:iskKeep = &isk
1820 syn include @vimMzSchemeScript syntax/scheme.vim
1821 unlet b:current_syntax
1822 let &isk = s:iskKeep
1823endif
1824
1825syn keyword vimMzScheme mz[scheme] skipwhite nextgroup=vimMzSchemeHeredoc,vimMzSchemeStatement
1826syn keyword vimMzScheme mzf[ile]
1827
1828syn region vimMzSchemeStatement contained
1829 \ start="\S"
1830 \ skip=+\n\s*\%(\\\|["#]\\ \)+
1831 \ end="$"
1832 \ contains=@vimMzSchemeScript,@vimContinue
1833VimFoldm syn region vimMzSchemeHeredoc contained
1834 \ matchgroup=vimScriptHeredocStart
1835 \ start=+<<\s*\z(\S\+\)\ze\s*$+
1836 \ matchgroup=vimScriptHeredocStop
1837 \ end=+^\z1$+
1838 \ contains=@vimMzSchemeScript
1839VimFoldm syn region vimMzSchemeHeredoc contained
1840 \ matchgroup=vimScriptHeredocStart
1841 \ start=+<<\ze\s*$+
1842 \ matchgroup=vimScriptHeredocStop
1843 \ end=+^\.$+
1844 \ contains=@vimMzSchemeScript
1845VimFoldm syn region vimMzSchemeHeredoc contained
1846 \ matchgroup=vimScriptHeredocStart
1847 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\s\+\z(\S\+\)\ze\s*$+
1848 \ matchgroup=vimScriptHeredocStop
1849 \ end=+^\z1\=\z2$+
1850 \ contains=@vimMzSchemeScript
1851VimFoldm syn region vimMzSchemeHeredoc contained
1852 \ matchgroup=vimScriptHeredocStart
1853 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\ze\s*$+
1854 \ matchgroup=vimScriptHeredocStop
1855 \ end=+^\z1\=\.$+
1856 \ contains=@vimMzSchemeScript
1857
1858" [-- perl --] {{{3
1859if s:interfaces =~# 'p'
1860 syn include @vimPerlScript syntax/perl.vim
1861 unlet b:current_syntax
1862endif
1863
1864syn keyword vimPerl pe[rl] skipwhite nextgroup=vimPerlHeredoc,vimPerlStatement
1865syn keyword vimPerl perld[o] skipwhite nextgroup=vimPerlStatement
1866
1867syn region vimPerlStatement contained
1868 \ start="\S"
1869 \ skip=+\n\s*\%(\\\|["#]\\ \)+
1870 \ end="$"
1871 \ contains=@vimPerlScript,@vimContinue
1872VimFoldp syn region vimPerlHeredoc contained
1873 \ matchgroup=vimScriptHeredocStart
1874 \ start=+<<\s*\z(\S\+\)\ze\s*$+
1875 \ matchgroup=vimScriptHeredocStop
1876 \ end=+^\z1$+ contains=@vimPerlScript
1877VimFoldp syn region vimPerlHeredoc contained
1878 \ matchgroup=vimScriptHeredocStart
1879 \ start=+<<\ze\s*$+ matchgroup=vimScriptHeredocStop
1880 \ end=+^\.$+
1881 \ contains=@vimPerlScript
1882VimFoldp syn region vimPerlHeredoc contained
1883 \ matchgroup=vimScriptHeredocStart
1884 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\s\+\z(\S\+\)\ze\s*$+
1885 \ matchgroup=vimScriptHeredocStop
1886 \ end=+^\z1\=\z2$+
1887 \ contains=@vimPerlScript
1888VimFoldp syn region vimPerlHeredoc contained
1889 \ matchgroup=vimScriptHeredocStart
1890 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\ze\s*$+
1891 \ matchgroup=vimScriptHeredocStop
1892 \ end=+^\z1\=\.$+
1893 \ contains=@vimPerlScript
1894
1895" [-- python --] {{{3
1896if s:interfaces =~# 'P'
1897 syn include @vimPythonScript syntax/python2.vim
1898 unlet b:current_syntax
1899endif
1900
1901syn keyword vimPython py[thon] skipwhite nextgroup=vimPythonHeredoc,vimPythonStatement
1902syn keyword vimPython pydo skipwhite nextgroup=vimPythonStatement
1903syn keyword vimPython pyfile
1904
1905syn region vimPythonStatement contained
1906 \ start="\S"
1907 \ skip=+\n\s*\%(\\\|["#]\\ \)+
1908 \ end="$"
1909 \ contains=@vimPythonScript,@vimContinue
1910VimFoldP syn region vimPythonHeredoc contained
1911 \ matchgroup=vimScriptHeredocStart
1912 \ start=+<<\s*\z(\S\+\)\ze\s*$+
1913 \ matchgroup=vimScriptHeredocStop
1914 \ end=+^\z1$+
1915 \ contains=@vimPythonScript
1916VimFoldP syn region vimPythonHeredoc contained
1917 \ matchgroup=vimScriptHeredocStart
1918 \ start=+<<\ze\s*$+
1919 \ matchgroup=vimScriptHeredocStop
1920 \ end=+^\.$+
1921 \ contains=@vimPythonScript
1922VimFoldP syn region vimPythonHeredoc contained
1923 \ matchgroup=vimScriptHeredocStart
1924 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\s\+\z(\S\+\)\ze\s*$+
1925 \ matchgroup=vimScriptHeredocStop
1926 \ end=+^\z1\=\z2$+
1927 \ contains=@vimPythonScript
1928VimFoldP syn region vimPythonHeredoc contained
1929 \ matchgroup=vimScriptHeredocStart
1930 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\ze\s*$+
1931 \ matchgroup=vimScriptHeredocStop
1932 \ end=+^\z1\=\.$+
1933 \ contains=@vimPythonScript
1934
1935" [-- python3 --] {{{3
1936if s:interfaces =~# 'P'
1937 syn include @vimPython3Script syntax/python.vim
1938 unlet b:current_syntax
1939endif
1940
1941syn keyword vimPython3 python3 py3 skipwhite nextgroup=vimPython3Heredoc,vimPython3Statement
1942syn keyword vimPython3 py3do skipwhite nextgroup=vimPython3Statement
1943syn keyword vimPython3 py3file
1944
1945syn region vimPython3Statement contained
1946 \ start="\S"
1947 \ skip=+\n\s*\%(\\\|["#]\\ \)+
1948 \ end="$"
1949 \ contains=@vimPython3Script,@vimContinue
1950VimFoldP syn region vimPython3Heredoc contained
1951 \ matchgroup=vimScriptHeredocStart
1952 \ start=+<<\s*\z(\S\+\)\ze\s*$+
1953 \ matchgroup=vimScriptHeredocStop
1954 \ end=+^\z1$+
1955 \ contains=@vimPython3Script
1956VimFoldP syn region vimPython3Heredoc contained
1957 \ matchgroup=vimScriptHeredocStart
1958 \ start=+<<\ze\s*$+
1959 \ matchgroup=vimScriptHeredocStop
1960 \ end=+^\.$+
1961 \ contains=@vimPython3Script
1962VimFoldP syn region vimPython3Heredoc contained
1963 \ matchgroup=vimScriptHeredocStart
1964 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\s\+\z(\S\+\)\ze\s*$+
1965 \ matchgroup=vimScriptHeredocStop
1966 \ end=+^\z1\=\z2$+
1967 \ contains=@vimPython3Script
1968VimFoldP syn region vimPython3Heredoc contained
1969 \ matchgroup=vimScriptHeredocStart
1970 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\ze\s*$+
1971 \ matchgroup=vimScriptHeredocStop
1972 \ end=+^\z1\=\.$+
1973 \ contains=@vimPython3Script
1974
1975" [-- pythonx --] {{{3
1976if s:interfaces =~# 'P'
1977 if &pyxversion == 2
1978 syn cluster vimPythonXScript contains=@vimPythonScript
1979 else
1980 syn cluster vimPythonXScript contains=@vimPython3Script
1981 endif
1982endif
1983
1984syn keyword vimPythonX pythonx pyx skipwhite nextgroup=vimPythonXHeredoc,vimPythonXStatement
1985syn keyword vimPythonX pyxdo skipwhite nextgroup=vimPythonXStatement
1986syn keyword vimPythonX pyxfile
1987
1988syn region vimPythonXStatement contained
1989 \ start="\S"
1990 \ skip=+\n\s*\%(\\\|["#]\\ \)+
1991 \ end="$"
1992 \ contains=@vimPythonXScript,@vimContinue
1993VimFoldP syn region vimPythonXHeredoc contained
1994 \ matchgroup=vimScriptHeredocStart
1995 \ start=+<<\s*\z(\S\+\)\ze\s*$+
1996 \ matchgroup=vimScriptHeredocStop
1997 \ end=+^\z1$+
1998 \ contains=@vimPythonXScript
1999VimFoldP syn region vimPythonXHeredoc contained
2000 \ matchgroup=vimScriptHeredocStart
2001 \ start=+<<\ze\s*$+
2002 \ matchgroup=vimScriptHeredocStop
2003 \ end=+^\.$+
2004 \ contains=@vimPythonXScript
2005VimFoldP syn region vimPythonXHeredoc contained
2006 \ matchgroup=vimScriptHeredocStart
2007 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\s\+\z(\S\+\)\ze\s*$+
2008 \ matchgroup=vimScriptHeredocStop
2009 \ end=+^\z1\=\z2$+
2010 \ contains=@vimPythonXScript
2011VimFoldP syn region vimPythonXHeredoc contained
2012 \ matchgroup=vimScriptHeredocStart
2013 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\ze\s*$+
2014 \ matchgroup=vimScriptHeredocStop
2015 \ end=+^\z1\=\.$+
2016 \ contains=@vimPythonXScript
2017
2018" [-- ruby --] {{{3
2019if s:interfaces =~# 'r'
2020 syn include @vimRubyScript syntax/ruby.vim
2021 unlet b:current_syntax
2022endif
2023
2024syn keyword vimRuby rub[y] skipwhite nextgroup=vimRubyHeredoc,vimRubyStatement
2025syn keyword vimRuby rubyd[o] skipwhite nextgroup=vimRubyStatement
2026syn keyword vimRuby rubyf[ile]
2027
2028syn region vimRubyStatement contained
2029 \ start="\S"
2030 \ skip=+\n\s*\%(\\\|["#]\\ \)+
2031 \ end="$"
2032 \ contains=@vimRubyScript,@vimContinue
2033VimFoldr syn region vimRubyHeredoc contained
2034 \ matchgroup=vimScriptHeredocStart
2035 \ start=+<<\s*\z(\S\+\)\ze\s*$+
2036 \ matchgroup=vimScriptHeredocStop
2037 \ end=+^\z1$+
2038 \ contains=@vimRubyScript
2039VimFoldr syn region vimRubyHeredoc contained
2040 \ matchgroup=vimScriptHeredocStart
2041 \ start=+<<\ze\s*$+ matchgroup=vimScriptHeredocStop
2042 \ end=+^\.$+
2043 \ contains=@vimRubyScript
2044VimFoldr syn region vimRubyHeredoc contained
2045 \ matchgroup=vimScriptHeredocStart
2046 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\s\+\z(\S\+\)\ze\s*$+
2047 \ matchgroup=vimScriptHeredocStop
2048 \ end=+^\z1\=\z2$+
2049 \ contains=@vimRubyScript
2050VimFoldr syn region vimRubyHeredoc contained
2051 \ matchgroup=vimScriptHeredocStart
2052 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\ze\s*$+
2053 \ matchgroup=vimScriptHeredocStop
2054 \ end=+^\z1\.$+
2055 \ contains=@vimRubyScript
2056
2057" [-- tcl --] {{{3
2058if s:interfaces =~# 't'
2059 syn include @vimTclScript syntax/tcl.vim
2060 unlet b:current_syntax
2061endif
2062
2063syn keyword vimTcl tcl skipwhite nextgroup=vimTclHeredoc,vimTclStatement
2064syn keyword vimTcl tcld[o] skipwhite nextgroup=vimTclStatement
2065syn keyword vimTcl tclf[ile]
2066syn region vimTclStatement contained
2067 \ start="\S"
2068 \ skip=+\n\s*\%(\\\|["#]\\ \)+
2069 \ end="$"
2070 \ contains=@vimTclScript,@vimContinue
2071VimFoldt syn region vimTclHeredoc contained
2072 \ matchgroup=vimScriptHeredocStart
2073 \ start=+<<\s*\z(\S\+\)\ze\s*$+
2074 \ matchgroup=vimScriptHeredocStop
2075 \ end=+^\z1$+
2076 \ contains=@vimTclScript
2077VimFoldt syn region vimTclHeredoc contained
2078 \ matchgroup=vimScriptHeredocStart
2079 \ start=+<<\ze\s*$+
2080 \ matchgroup=vimScriptHeredocStop
2081 \ end=+^\.$+
2082 \ contains=@vimTclScript
2083VimFoldt syn region vimTclHeredoc contained
2084 \ matchgroup=vimScriptHeredocStart
2085 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\s\+\z(\S\+\)\ze\s*$+
2086 \ matchgroup=vimScriptHeredocStop
2087 \ end=+^\z1\=\z2$+
2088 \ contains=@vimTclScript
2089VimFoldt syn region vimTclHeredoc contained
2090 \ matchgroup=vimScriptHeredocStart
2091 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\ze\s*$+
2092 \ matchgroup=vimScriptHeredocStop
2093 \ end=+^\z1\=\.$+
2094 \ contains=@vimTclScript
2095
2096unlet s:interfaces
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00002097" Beginners - Patterns that involve ^ {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00002098" =========
Doug Kearns35699f12024-09-19 19:51:59 +02002099Vim9 syn region vim9LineComment start=+^[ \t:]*\zs#.*$+ skip=+\n\s*\\\|\n\s*#\\ + end="$" contains=@vimCommentGroup,vimCommentString,vim9CommentTitle extend
2100VimL syn region vimLineComment start=+^[ \t:]*\zs".*$+ skip=+\n\s*\\\|\n\s*"\\ + end="$" contains=@vimCommentGroup,vimCommentString,vimCommentTitle extend
Doug Kearnsd65e58f2024-07-17 19:34:14 +02002101
Bram Moolenaar5c736222010-01-06 20:54:52 +01002102syn 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 +10002103syn 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 +10002104
dkearnsae321b52024-06-15 23:06:17 +10002105" allowed anywhere in the file
2106if !s:vim9script
2107 syn match vimShebangError "^\s*\zs#!.*" display
2108endif
2109syn match vimShebang "\%^#!.*" display
2110
dkearns21ce1592024-01-29 04:54:08 +11002111syn match vimContinue "^\s*\zs\\"
Doug Kearns4f010c92025-02-13 20:24:42 +01002112syn match vimContinueComment '^\s*\zs["#]\\ .*' extend
2113syn match vim9ContinueComment "^\s*\zs#\\ .*" extend
Doug Kearns818c6412024-10-06 17:00:48 +02002114syn cluster vimContinue contains=vimContinue,vimContinueComment
2115syn cluster vim9Continue contains=vimContinue,vim9ContinueComment
2116
Doug Kearnsc29b5332025-04-26 20:14:15 +02002117syn region vimString start='^\s*\\"' end='"' oneline keepend contains=@vimStringGroup,vimContinue
2118syn region vimString start="^\s*\\'" end="'" oneline keepend contains=vimQuoteEscape,vimContinue
2119
Bram Moolenaar5c736222010-01-06 20:54:52 +01002120syn match vimCommentTitleLeader '"\s\+'ms=s+1 contained
dkearns04e53632024-04-11 06:18:37 +10002121syn match vim9CommentTitleLeader '#\s\+'ms=s+1 contained
Bram Moolenaar071d4272004-06-13 20:20:40 +00002122
Bram Moolenaar18144c82006-04-12 21:52:12 +00002123" Searches And Globals: {{{2
2124" ====================
Doug Kearnsc273f1a2025-01-20 21:53:01 +01002125VimL syn match vimSearch '^\s*[/?].*' contains=vimSearchDelim
Bram Moolenaar5c736222010-01-06 20:54:52 +01002126syn match vimSearchDelim '^\s*\zs[/?]\|[/?]$' contained
Doug Kearnsc273f1a2025-01-20 21:53:01 +01002127Vim9 syn match vim9Search '^\s*:[/?].*' contains=vim9SearchDelim
2128syn match vim9SearchDelim '^\s*\zs:[/?]\|[/?]$' contained contains=vimCmdSep
dkearns2c51e152024-02-27 07:10:18 +11002129syn region vimGlobal matchgroup=Statement start='\<g\%[lobal]!\=/' skip='\\.' end='/' skipwhite nextgroup=vimSubst1
2130syn region vimGlobal matchgroup=Statement start='\<v\%[global]!\=/' skip='\\.' end='/' skipwhite nextgroup=vimSubst1
Bram Moolenaare2f98b92006-03-29 21:18:24 +00002131
Hirohito Higashifbe4a8f2025-04-27 15:28:30 +02002132" Vim9 script Regions: {{{2
dkearns04e53632024-04-11 06:18:37 +10002133" ==================
2134
2135if s:vim9script
Doug Kearnsce064932024-04-13 18:24:01 +02002136 syn cluster vimLegacyTop contains=TOP,vim9LegacyHeader,vim9Comment,vim9LineComment
2137 VimFoldH syn region vim9LegacyHeader start="\%^" end="^\ze\s*vim9s\%[cript]\>" contains=@vimLegacyTop,vimComment,vimLineComment
dkearns04e53632024-04-11 06:18:37 +10002138
Doug Kearnsce064932024-04-13 18:24:01 +02002139 syn keyword vim9Vim9ScriptArg noclear contained
2140 syn keyword vim9Vim9Script vim9s[cript] nextgroup=vim9Vim9ScriptArg skipwhite
dkearns04e53632024-04-11 06:18:37 +10002141endif
2142
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00002143" Synchronize (speed) {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00002144"============
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00002145if exists("g:vimsyn_minlines")
2146 exe "syn sync minlines=".g:vimsyn_minlines
Bram Moolenaar071d4272004-06-13 20:20:40 +00002147endif
Bram Moolenaar03413f42016-04-12 21:07:15 +02002148exe "syn sync maxlines=".s:vimsyn_maxlines
Bram Moolenaar071d4272004-06-13 20:20:40 +00002149syn sync linecont "^\s\+\\"
Doug Kearns7b5550f2025-05-18 20:37:34 +02002150syn sync linebreaks=2
Bram Moolenaar071d4272004-06-13 20:20:40 +00002151syn sync match vimAugroupSyncA groupthere NONE "\<aug\%[roup]\>\s\+[eE][nN][dD]"
2152
Bram Moolenaar5c736222010-01-06 20:54:52 +01002153" ====================
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00002154" Highlighting Settings {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00002155" ====================
2156
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002157if !exists("skip_vim_syntax_inits")
2158 if !exists("g:vimsyn_noerror")
2159 hi def link vimBehaveError vimError
2160 hi def link vimCollClassErr vimError
2161 hi def link vimErrSetting vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002162 hi def link vimFTError vimError
2163 hi def link vimFunctionError vimError
2164 hi def link vimFunc vimError
2165 hi def link vimHiAttribList vimError
2166 hi def link vimHiCtermError vimError
2167 hi def link vimHiKeyError vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002168 hi def link vimMapModErr vimError
Doug Kearns086b3b52025-05-31 17:52:48 +02002169 hi def link vimMarkArgError vimError
dkearnsae321b52024-06-15 23:06:17 +10002170 hi def link vimShebangError vimError
Doug Kearns9b171bd2025-04-10 19:59:22 +02002171 hi def link vimSortOptionsError Error
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002172 hi def link vimSubstFlagErr vimError
2173 hi def link vimSynCaseError vimError
Doug Kearns0fab8912025-03-10 21:04:53 +01002174 hi def link vimSyncError vimError
2175 hi def link vimSynConcealError vimError
2176 hi def link vimSynError vimError
2177 hi def link vimSynFoldlevelError vimError
2178 hi def link vimSynIskeywordError vimError
2179 hi def link vimSynSpellError vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002180 hi def link vimBufnrWarn vimWarn
Doug Kearns818c6412024-10-06 17:00:48 +02002181
2182 hi def link vim9TypeAliasError vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002183 endif
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00002184
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002185 hi def link vimAbb vimCommand
2186 hi def link vimAddress vimMark
dkearnsc4aef9a2024-03-04 02:42:47 +11002187 hi def link vimAugroupBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002188 hi def link vimAugroupError vimError
2189 hi def link vimAugroupKey vimCommand
Doug Kearnsfa3b1042025-04-22 19:48:13 +02002190 hi def link vimAutocmd vimCommand
2191 hi def link vimAutocmdBang vimBang
2192 hi def link vimAutocmdPatternEscape Special
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002193 hi def link vimAutoEvent Type
Doug Kearnsfa3b1042025-04-22 19:48:13 +02002194 hi def link vimAutoEventGlob Type
2195 hi def link vimAutocmdBufferPattern Special
2196 hi def link vimAutocmdMod Special
2197 hi def link vimAutocmdPatternSep vimSep
dkearnsb614b282024-02-12 03:13:34 +11002198 hi def link vimBang vimOper
dkearns2c51e152024-02-27 07:10:18 +11002199 hi def link vimBehaveBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002200 hi def link vimBehaveModel vimBehave
2201 hi def link vimBehave vimCommand
2202 hi def link vimBracket Delimiter
Doug Kearns99984fc2024-07-18 20:45:19 +02002203 hi def link vimCall vimCommand
dkearnsa3bddb72024-06-14 01:48:10 +10002204 hi def link vimCatch vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002205 hi def link vimCmplxRepeat SpecialChar
2206 hi def link vimCommand Statement
2207 hi def link vimComment Comment
Doug Kearnsfc64ac02024-06-22 11:20:36 +02002208 hi def link vimCommentError vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002209 hi def link vimCommentString vimString
2210 hi def link vimCommentTitle PreProc
2211 hi def link vimCondHL vimCommand
dkearnsf6869212023-12-11 01:53:24 +11002212 hi def link vimConst vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002213 hi def link vimContinue Special
dkearns21ce1592024-01-29 04:54:08 +11002214 hi def link vimContinueComment vimComment
Doug Kearnsc29b5332025-04-26 20:14:15 +02002215 hi def link vimContinueString vimString
Doug Kearns4a530a62025-02-03 18:59:09 +01002216 hi def link vimCount Number
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002217 hi def link vimCtrlChar SpecialChar
Doug Kearns4a530a62025-02-03 18:59:09 +01002218 hi def link vimDebuggreedy vimCommand
Doug Kearns51289202025-06-11 21:16:14 +02002219 hi def link vimDef vimCommand
2220 hi def link vimDefBang vimBang
Doug Kearnsfc64ac02024-06-22 11:20:36 +02002221 hi def link vimDefComment vim9Comment
Doug Kearns1aa287e2025-02-10 22:00:27 +01002222 hi def link vimDefParam vimVar
Doug Kearns3c07eb02024-09-02 10:03:37 +02002223 hi def link vimDelcommand vimCommand
2224 hi def link vimDelcommandAttr vimUserCmdAttr
Doug Kearns51289202025-06-11 21:16:14 +02002225 hi def link vimDelfunction vimCommand
2226 hi def link vimDelfunctionBang vimBang
Doug Kearnsfa3b1042025-04-22 19:48:13 +02002227 hi def link vimDoautocmd vimCommand
2228 hi def link vimDoautocmdMod Special
dkearnsb1427b42024-02-28 05:59:30 +11002229 hi def link vimEcho vimCommand
dkearns61887b32024-03-15 23:45:48 +11002230 hi def link vimEchohlNone vimGroup
2231 hi def link vimEchohl vimCommand
Doug Kearnsc29b5332025-04-26 20:14:15 +02002232 hi def link vimElse vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002233 hi def link vimElseIfErr Error
dkearns35e6f4c2024-03-22 06:41:10 +11002234 hi def link vimEndfunction vimCommand
2235 hi def link vimEnddef vimCommand
Doug Kearnsc29b5332025-04-26 20:14:15 +02002236 hi def link vimEndif vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002237 hi def link vimEnvvar PreProc
2238 hi def link vimError Error
Bram Moolenaar6ba83ba2022-06-12 22:15:57 +01002239 hi def link vimEscape Special
Doug Kearns9b171bd2025-04-10 19:59:22 +02002240 hi def link vimExFilter vimCommand
2241 hi def link vimExFilterBang vimCommand
Doug Kearns086b3b52025-05-31 17:52:48 +02002242 hi def link vimExMark vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002243 hi def link vimFBVar vimVar
2244 hi def link vimFgBgAttrib vimHiAttrib
Bram Moolenaarcbaff5e2022-04-08 17:45:08 +01002245 hi def link vimFuncEcho vimCommand
dkearns1c97b5c2023-12-13 02:47:43 +11002246 hi def link vimFor vimCommand
Doug Kearns1aa287e2025-02-10 22:00:27 +01002247 hi def link vimForInContinue vimContinue
2248 hi def link vimForInContinueComment vimContinueComment
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002249 hi def link vimFTCmd vimCommand
2250 hi def link vimFTOption vimSynType
Doug Kearns51289202025-06-11 21:16:14 +02002251 hi def link vimFunction vimCommand
2252 hi def link vimFunctionBang vimBang
2253 hi def link vimFunctionComment vimComment
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002254 hi def link vimFuncName Function
Doug Kearns51289202025-06-11 21:16:14 +02002255 hi def link vimFunctionMod Special
2256 hi def link vimFunctionParam vimVar
2257 hi def link vimFunctionParamEquals vimOper
2258 hi def link vimFunctionScope vimVarScope
2259 hi def link vimFunctionSID vimNotation
Doug Kearns9b171bd2025-04-10 19:59:22 +02002260 hi def link vimGrep vimCommand
2261 hi def link vimGrepadd vimCommand
2262 hi def link vimGrepBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002263 hi def link vimGroupAdd vimSynOption
Doug Kearns0fab8912025-03-10 21:04:53 +01002264 hi def link vimGroupName Normal
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002265 hi def link vimGroupRem vimSynOption
2266 hi def link vimGroupSpecial Special
2267 hi def link vimGroup Type
Doug Kearns9b171bd2025-04-10 19:59:22 +02002268 hi def link vimHelpgrep vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002269 hi def link vimHiAttrib PreProc
dkearnsb614b282024-02-12 03:13:34 +11002270 hi def link vimHiBang vimBang
dkearns9530fe42024-03-19 05:19:51 +11002271 hi def link vimHiClear Type
2272 hi def link vimHiCtermColor Constant
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002273 hi def link vimHiCtermFgBg vimHiTerm
dkearns9530fe42024-03-19 05:19:51 +11002274 hi def link vimHiCtermfont vimHiTerm
2275 hi def link vimHiCtermul vimHiTerm
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002276 hi def link vimHiCTerm vimHiTerm
2277 hi def link vimHighlight vimCommand
2278 hi def link vimHiGroup vimGroupName
2279 hi def link vimHiGuiFgBg vimHiTerm
2280 hi def link vimHiGuiFont vimHiTerm
2281 hi def link vimHiGuiRgb vimNumber
2282 hi def link vimHiGui vimHiTerm
2283 hi def link vimHiNmbr Number
Doug Kearns0fab8912025-03-10 21:04:53 +01002284 hi def link vimHiNone vimGroup
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002285 hi def link vimHiStartStop vimHiTerm
2286 hi def link vimHiTerm Type
2287 hi def link vimHLGroup vimGroup
Doug Kearns7b5550f2025-05-18 20:37:34 +02002288 hi def link vimImport vimCommand
2289 hi def link vimImportAutoload Special
2290 hi def link vimImportAs vimImport
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002291 hi def link vimInsert vimString
dkearns04e53632024-04-11 06:18:37 +10002292 hi def link vim9KeymapLineComment vimKeymapLineComment
dkearns69866442023-11-22 05:43:40 +11002293 hi def link vimKeymapLineComment vimComment
2294 hi def link vimKeymapTailComment vimComment
Doug Kearns722fbd12025-03-28 19:36:37 +01002295 hi def link vimLambdaBrace Delimiter
Doug Kearns1aa287e2025-02-10 22:00:27 +01002296 hi def link vimLambdaOperator vimOper
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002297 hi def link vimLet vimCommand
Doug Kearnsa577e422025-05-17 16:29:13 +02002298 hi def link vimLetHeredoc vimString
2299 hi def link vimLetHeredocStart Special
2300 hi def link vimLetHeredocStop Special
Doug Kearns2f5a8c02025-04-05 15:55:36 +02002301 hi def link vimLetRegister vimRegister
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002302 hi def link vimLineComment vimComment
Doug Kearnsa577e422025-05-17 16:29:13 +02002303 hi def link vimLua vimCommand
Doug Kearns9b171bd2025-04-10 19:59:22 +02002304 hi def link vimMake vimCommand
2305 hi def link vimMakeadd vimCommand
2306 hi def link vimMakeBang vimBang
dkearnsb614b282024-02-12 03:13:34 +11002307 hi def link vimMapBang vimBang
Doug Kearns6bdfeb02025-03-07 18:49:11 +01002308 hi def link vimMapLeader vimBracket
2309 hi def link vimMapLeaderKey vimNotation
Doug Kearns51289202025-06-11 21:16:14 +02002310 hi def link vimMapModKey vimFunctionSID
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002311 hi def link vimMapMod vimBracket
2312 hi def link vimMap vimCommand
2313 hi def link vimMark Number
2314 hi def link vimMarkNumber vimNumber
Doug Kearnse85fdc72024-07-07 20:45:37 +02002315 hi def link vimMatch vimCommand
2316 hi def link vimMatchGroup vimGroup
2317 hi def link vimMatchNone vimGroup
dkearnsb614b282024-02-12 03:13:34 +11002318 hi def link vimMenuBang vimBang
dkearns62b26042024-03-10 03:43:28 +11002319 hi def link vimMenuClear Special
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002320 hi def link vimMenuMod vimMapMod
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002321 hi def link vimMenuName PreProc
dkearns62b26042024-03-10 03:43:28 +11002322 hi def link vimMenu vimCommand
2323 hi def link vimMenuNotation vimNotation
2324 hi def link vimMenuPriority Number
2325 hi def link vimMenuStatus Special
2326 hi def link vimMenutranslateComment vimComment
Doug Kearns818c6412024-10-06 17:00:48 +02002327 hi def link vim9MethodName vimFuncName
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002328 hi def link vimMtchComment vimComment
Doug Kearnsa577e422025-05-17 16:29:13 +02002329 hi def link vimMzScheme vimCommand
2330 hi def link vimNonText NonText
Doug Kearnsbbe52522024-11-09 19:11:25 +01002331 hi def link vimNormal vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002332 hi def link vimNotation Special
2333 hi def link vimNotFunc vimCommand
2334 hi def link vimNotPatSep vimString
2335 hi def link vimNumber Number
2336 hi def link vimOperError Error
2337 hi def link vimOper Operator
Doug Kearns1aa287e2025-02-10 22:00:27 +01002338 hi def link vimOperContinue vimContinue
2339 hi def link vimOperContinueComment vimContinueComment
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002340 hi def link vimOption PreProc
Doug Kearns1aa287e2025-02-10 22:00:27 +01002341 hi def link vimOptionVar Identifier
Doug Kearns3dca5122025-03-09 16:30:28 +01002342 hi def link vimOptionVarName Identifier
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002343 hi def link vimParenSep Delimiter
Bram Moolenaard2855f52018-07-31 22:23:58 +02002344 hi def link vimPatSepErr vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002345 hi def link vimPatSepR vimPatSep
2346 hi def link vimPatSep SpecialChar
2347 hi def link vimPatSepZone vimString
2348 hi def link vimPatSepZ vimPatSep
2349 hi def link vimPattern Type
Doug Kearnsa577e422025-05-17 16:29:13 +02002350 hi def link vimPerl vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002351 hi def link vimPlainMark vimMark
2352 hi def link vimPlainRegister vimRegister
Doug Kearns0aaf6f82025-06-01 18:26:39 +02002353 hi def link vimProfile vimCommand
2354 hi def link vimProfileArg vimSpecial
2355 hi def link vimProfileBang vimBang
2356 hi def link vimProfdel vimCommand
2357 hi def link vimProfdelArg vimSpecial
Doug Kearnsa577e422025-05-17 16:29:13 +02002358 hi def link vimPython vimCommand
2359 hi def link vimPython3 vimCommand
2360 hi def link vimPythonX vimCommand
Doug Kearns695522d2025-01-10 20:02:17 +01002361 hi def link vimQuoteEscape vimEscape
Doug Kearns2f5a8c02025-04-05 15:55:36 +02002362 hi def link vimRedir vimCommand
2363 hi def link vimRedirBang vimBang
2364 hi def link vimRedirFileOperator vimOper
2365 hi def link vimRedirRegisterOperator vimOper
2366 hi def link vimRedirVariableOperator vimOper
2367 hi def link vimRedirEnd Special
2368 hi def link vimRedirRegister vimRegister
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002369 hi def link vimRegister SpecialChar
Doug Kearnsa577e422025-05-17 16:29:13 +02002370 hi def link vimRuby vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002371 hi def link vimScriptDelim Comment
Doug Kearnsa577e422025-05-17 16:29:13 +02002372 hi def link vimScriptHeredocStart vimLetHeredocStart
2373 hi def link vimScriptHeredocStop vimLetHeredocStop
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002374 hi def link vimSearch vimString
Doug Kearnsc273f1a2025-01-20 21:53:01 +01002375 hi def link vimSearchDelim Delimiter
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002376 hi def link vimSep Delimiter
Doug Kearnsddbb6fe2024-07-24 20:21:22 +02002377 hi def link vimSet vimCommand
2378 hi def link vimSetAll vimOption
2379 hi def link vimSetBang vimBang
Doug Kearns2a6be832025-04-03 21:39:24 +02002380 hi def link vimSetComment vimComment
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002381 hi def link vimSetMod vimOption
Doug Kearnsddbb6fe2024-07-24 20:21:22 +02002382 hi def link vimSetSep vimSep
Doug Kearnsddbb6fe2024-07-24 20:21:22 +02002383 hi def link vimSetTermcap vimOption
dkearnsae321b52024-06-15 23:06:17 +10002384 hi def link vimShebang PreProc
Doug Kearns262e25e2024-06-14 20:16:35 +02002385 hi def link vimSleep vimCommand
2386 hi def link vimSleepArg Constant
2387 hi def link vimSleepBang vimBang
Doug Kearns9b171bd2025-04-10 19:59:22 +02002388 hi def link vimSort vimCommand
2389 hi def link vimSortBang vimBang
2390 hi def link vimSortOptions Special
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002391 hi def link vimSpecFile Identifier
2392 hi def link vimSpecFileMod vimSpecFile
2393 hi def link vimSpecial Type
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002394 hi def link vimStringCont vimString
2395 hi def link vimString String
Bram Moolenaard2855f52018-07-31 22:23:58 +02002396 hi def link vimStringEnd vimString
thincacf8695d2024-01-28 18:57:23 +01002397 hi def link vimStringInterpolationBrace vimEscape
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002398 hi def link vimSubst1 vimSubst
Doug Kearns086b3b52025-05-31 17:52:48 +02002399 hi def link vimSubstCount Number
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002400 hi def link vimSubstDelim Delimiter
2401 hi def link vimSubstFlags Special
2402 hi def link vimSubstSubstr SpecialChar
2403 hi def link vimSubstTwoBS vimString
2404 hi def link vimSubst vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002405 hi def link vimSynCase Type
Doug Kearns0fab8912025-03-10 21:04:53 +01002406 hi def link vimSyncCcomment Type
dkearnsc79646d2024-01-05 08:58:48 +11002407 hi def link vimSynCchar vimSynOption
2408 hi def link vimSynCcharValue Character
Doug Kearns0fab8912025-03-10 21:04:53 +01002409 hi def link vimSyncClear Type
2410 hi def link vimSyncFromstart Type
2411 hi def link vimSyncGroup vimGroupName
2412 hi def link vimSyncGroupName vimGroupName
2413 hi def link vimSyncKey Type
2414 hi def link vimSyncLinebreak Type
2415 hi def link vimSyncLinecont Type
2416 hi def link vimSyncLines Type
2417 hi def link vimSyncMatch Type
2418 hi def link vimSyncNone Type
2419 hi def link vimSynConceal Type
2420 hi def link vimSynContains vimSynOption
2421 hi def link vimSyncRegion Type
2422 hi def link vimSynFoldlevel Type
2423 hi def link vimSynIskeyword Type
2424 hi def link vimSynIskeywordSep Delimiter
2425 hi def link vimSynKeyContainedin vimSynContains
2426 hi def link vimSynKeyOpt vimSynOption
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002427 hi def link vimSynMtchGrp vimSynOption
2428 hi def link vimSynMtchOpt vimSynOption
2429 hi def link vimSynNextgroup vimSynOption
2430 hi def link vimSynNotPatRange vimSynRegPat
2431 hi def link vimSynOption Special
2432 hi def link vimSynPatRange vimString
Doug Kearns0fab8912025-03-10 21:04:53 +01002433 hi def link vimSynReg Type
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002434 hi def link vimSynRegOpt vimSynOption
2435 hi def link vimSynRegPat vimString
Doug Kearns0fab8912025-03-10 21:04:53 +01002436 hi def link vimSynSpell Type
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002437 hi def link vimSyntax vimCommand
2438 hi def link vimSynType vimSpecial
Doug Kearnsa577e422025-05-17 16:29:13 +02002439 hi def link vimTcl vimCommand
dkearnsa3bddb72024-06-14 01:48:10 +10002440 hi def link vimThrow vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002441 hi def link vimTodo Todo
Bram Moolenaar4d8f4762021-06-27 15:18:56 +02002442 hi def link vimType Type
dkearnsf6869212023-12-11 01:53:24 +11002443 hi def link vimUnlet vimCommand
dkearnsb614b282024-02-12 03:13:34 +11002444 hi def link vimUnletBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002445 hi def link vimUnmap vimMap
Doug Kearns520a2c72025-04-08 20:50:00 +02002446 hi def link vimUserCmd vimCommand
Doug Kearns3c07eb02024-09-02 10:03:37 +02002447 hi def link vimUserCmdAttrAddr vimSpecial
Doug Kearns520a2c72025-04-08 20:50:00 +02002448 hi def link vimUserCmdAttrComplete vimSpecial
2449 hi def link vimUserCmdAttrCompleteFunc vimVar
Doug Kearns3c07eb02024-09-02 10:03:37 +02002450 hi def link vimUserCmdAttrNargs vimSpecial
2451 hi def link vimUserCmdAttrRange vimSpecial
2452 hi def link vimUserCmdAttrKey vimUserCmdAttr
2453 hi def link vimUserCmdAttr Special
2454 hi def link vimUserCmdAttrError Error
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002455 hi def link vimUserCmdError Error
Doug Kearns3c07eb02024-09-02 10:03:37 +02002456 hi def link vimUserCmdKey vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002457 hi def link vimUserFunc Normal
Doug Kearns1aa287e2025-02-10 22:00:27 +01002458 hi def link vimVar Normal
Doug Kearns3dca5122025-03-09 16:30:28 +01002459 hi def link vimVarScope Identifier
Doug Kearns9b171bd2025-04-10 19:59:22 +02002460 hi def link vimVimgrep vimCommand
2461 hi def link vimVimgrepadd vimCommand
2462 hi def link vimVimgrepBang vimBang
2463 hi def link vimVimgrepFlags Special
Doug Kearns3dca5122025-03-09 16:30:28 +01002464 hi def link vimVimVar Identifier
2465 hi def link vimVimVarName Identifier
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002466 hi def link vimWarn WarningMsg
Doug Kearnsfa3b1042025-04-22 19:48:13 +02002467 hi def link vimWildcard Special
2468 hi def link vimWildcardBraceComma vimWildcard
2469 hi def link vimWildcardBracket vimWildcard
2470 hi def link vimWildcardBracketCaret vimWildcard
2471 hi def link vimWildcardBracketCharacter Normal
2472 hi def link vimWildcardBracketCharacter Normal
2473 hi def link vimWildcardBracketCharacterClass vimWildCard
2474 hi def link vimWildcardBracketCollatingSymbol vimWildCard
2475 hi def link vimWildcardBracketEnd vimWildcard
2476 hi def link vimWildcardBracketEquivalenceClass vimWildCard
2477 hi def link vimWildcardBracketEscape vimWildcard
2478 hi def link vimWildcardBracketHyphen vimWildcard
2479 hi def link vimWildcardBracketRightBracket vimWildcardBracketCharacter
2480 hi def link vimWildcardBracketStart vimWildcard
2481 hi def link vimWildcardEscape vimWildcard
2482 hi def link vimWildcardInterval vimWildcard
2483 hi def link vimWildcardQuestion vimWildcard
2484 hi def link vimWildcardStar vimWildcard
Doug Kearnsd65e58f2024-07-17 19:34:14 +02002485
Doug Kearns818c6412024-10-06 17:00:48 +02002486 hi def link vim9Abstract vimCommand
Doug Kearnsd65e58f2024-07-17 19:34:14 +02002487 hi def link vim9Boolean Boolean
Doug Kearns818c6412024-10-06 17:00:48 +02002488 hi def link vim9Class vimCommand
Doug Kearnsd65e58f2024-07-17 19:34:14 +02002489 hi def link vim9Comment Comment
2490 hi def link vim9CommentError vimError
2491 hi def link vim9CommentTitle PreProc
Doug Kearns1aa287e2025-02-10 22:00:27 +01002492 hi def link vim9ConstructorDefParam vimVar
Doug Kearnsd65e58f2024-07-17 19:34:14 +02002493 hi def link vim9Const vimCommand
Doug Kearns818c6412024-10-06 17:00:48 +02002494 hi def link vim9ContinueComment vimContinueComment
2495 hi def link vim9Enum vimCommand
Doug Kearns1c580192025-05-01 17:43:17 +02002496 hi def link vim9EnumImplementedInterfaceComment vim9Comment
2497 hi def link vim9EnumImplements vim9Implements
2498 hi def link vim9EnumNameComment vim9Comment
2499 hi def link vim9EnumNameContinue vimContinue
2500 hi def link vim9EnumNameContinueComment vim9Comment
2501 hi def link vim9EnumValueListCommaComment vim9Comment
Doug Kearns818c6412024-10-06 17:00:48 +02002502 hi def link vim9Export vimCommand
2503 hi def link vim9Extends Keyword
Doug Kearnsd65e58f2024-07-17 19:34:14 +02002504 hi def link vim9Final vimCommand
2505 hi def link vim9For vimCommand
Doug Kearns1aa287e2025-02-10 22:00:27 +01002506 hi def link vim9ForInComment vim9Comment
Doug Kearns818c6412024-10-06 17:00:48 +02002507 hi def link vim9Implements Keyword
2508 hi def link vim9AbstractDef vimCommand
2509 hi def link vim9Interface vimCommand
Doug Kearns1aa287e2025-02-10 22:00:27 +01002510 hi def link vim9LambdaOperator vimOper
2511 hi def link vim9LambdaOperatorComment vim9Comment
Doug Kearns722fbd12025-03-28 19:36:37 +01002512 hi def link vim9LambdaParen vimParenSep
Doug Kearns1aa287e2025-02-10 22:00:27 +01002513 hi def link vim9LhsRegister vimLetRegister
2514 hi def link vim9LhsVariable vimVar
Doug Kearnsd65e58f2024-07-17 19:34:14 +02002515 hi def link vim9LineComment vimComment
Doug Kearns818c6412024-10-06 17:00:48 +02002516 hi def link vim9MethodDef vimCommand
Doug Kearnsdd3f1c02025-03-17 20:27:13 +01002517 hi def link vim9MethodDefComment vimDefComment
Doug Kearns818c6412024-10-06 17:00:48 +02002518 hi def link vim9MethodNameError vimFunctionError
Doug Kearnsd65e58f2024-07-17 19:34:14 +02002519 hi def link vim9Null Constant
Doug Kearns818c6412024-10-06 17:00:48 +02002520 hi def link vim9Public vimCommand
Doug Kearnsc273f1a2025-01-20 21:53:01 +01002521 hi def link vim9Search vimString
2522 hi def link vim9SearchDelim Delimiter
Doug Kearns818c6412024-10-06 17:00:48 +02002523 hi def link vim9Static vimCommand
2524 hi def link vim9Super Identifier
2525 hi def link vim9This Identifier
2526 hi def link vim9Type vimCommand
2527 hi def link vim9TypeEquals vimOper
Doug Kearnsd65e58f2024-07-17 19:34:14 +02002528 hi def link vim9Variable vimVar
Doug Kearns274efcc2025-06-10 21:02:43 +02002529 hi def link vim9VariableType vimType
Doug Kearns818c6412024-10-06 17:00:48 +02002530 hi def link vim9Var vimCommand
Doug Kearnsd65e58f2024-07-17 19:34:14 +02002531 hi def link vim9Vim9ScriptArg Special
Doug Kearns818c6412024-10-06 17:00:48 +02002532 hi def link vim9Vim9Script vimCommand
Doug Kearns025dc482025-02-23 15:48:52 +01002533
2534 hi def link vimCompilerSet vimCommand
2535 hi def link vimSynMenu vimCommand
2536 hi def link vimSynMenuPath vimMenuName
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002537endif
Bram Moolenaar071d4272004-06-13 20:20:40 +00002538
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00002539" Current Syntax Variable: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00002540let b:current_syntax = "vim"
Bram Moolenaar6be7f872012-01-20 21:08:56 +01002541
2542" ---------------------------------------------------------------------
2543" Cleanup: {{{1
Doug Kearnsd65e58f2024-07-17 19:34:14 +02002544delc Vim9
2545delc VimL
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002546delc VimFolda
Doug Kearns818c6412024-10-06 17:00:48 +02002547delc VimFoldc
2548delc VimFolde
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002549delc VimFoldf
Doug Kearnsce064932024-04-13 18:24:01 +02002550delc VimFoldh
2551delc VimFoldH
Doug Kearns818c6412024-10-06 17:00:48 +02002552delc VimFoldi
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002553delc VimFoldl
2554delc VimFoldm
2555delc VimFoldp
2556delc VimFoldP
2557delc VimFoldr
2558delc VimFoldt
Bram Moolenaar6be7f872012-01-20 21:08:56 +01002559let &cpo = s:keepcpo
dkearns04e53632024-04-11 06:18:37 +10002560unlet s:keepcpo s:vim9script
dkearns5d67aef2024-03-10 04:01:22 +11002561" vim:ts=18 fdm=marker ft=vim