blob: e83c9b2ef9b4e0bceeec275a9f845c823f72d54f [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>
glepnirf31cfa22025-03-06 21:59:13 +01005" Last Change: 2025 Mar 06
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
Bram Moolenaar071d4272004-06-13 20:20:40 +000012" Automatically generated keyword lists: {{{1
13
14" Quit when a syntax file was already loaded {{{2
15if exists("b:current_syntax")
16 finish
17endif
Bram Moolenaar113cb512021-11-07 20:27:04 +000018let s:keepcpo= &cpo
Bram Moolenaar6be7f872012-01-20 21:08:56 +010019set cpo&vim
Bram Moolenaar071d4272004-06-13 20:20:40 +000020
dkearns04e53632024-04-11 06:18:37 +100021let s:vim9script = "\n" .. getline(1, 32)->join("\n") =~# '\n\s*vim9\%[script]\>'
22
Bram Moolenaar071d4272004-06-13 20:20:40 +000023" vimTodo: contains common special-notices for comments {{{2
24" Use the vimCommentGroup cluster to add your own.
Bram Moolenaare2719092015-01-10 15:09:25 +010025syn keyword vimTodo contained COMBAK FIXME TODO XXX
Bram Moolenaar217ad922005-03-20 22:37:15 +000026syn cluster vimCommentGroup contains=vimTodo,@Spell
Bram Moolenaar071d4272004-06-13 20:20:40 +000027
28" regular vim commands {{{2
Doug Kearns1718e7d2025-01-08 18:20:47 +010029" GEN_SYN_VIM: vimCommand normal, START_STR='syn keyword vimCommand contained', END_STR='nextgroup=vimBang'
30syn 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 Kearns4a530a62025-02-03 18:59:09 +010031syn keyword vimCommand contained cons[t] cope[n] cp[revious] cpf[ile] cq[uit] cr[ewind] cs[cope] cst[ag] cw[indow] d[elete] delm[arks] deb[ug] defc[ompile] defe[r] delf[unction] di[splay] dif[fupdate] diffg[et] diffo[ff] diffp[atch] diffpu[t] diffs[plit] difft[his] dig[raphs] disa[ssemble] dj[ump] dli[st] dr[op] ds[earch] dsp[lit] e[dit] ea[rlier] el[se] em[enu] en[dif] endfo[r] endt[ry] endw[hile] ene[w] ev[al] ex exi[t] exu[sage] f[ile] files filet[ype] filt[er] fin[d] fina[lly] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] foldd[oopen] folddoc[losed] foldo[pen] g[lobal] go[to] gr[ep] grepa[dd] gu[i] gv[im] h[elp] helpc[lose] helpf[ind] helpg[rep] helpt[ags] ha[rdcopy] hi[ghlight] hid[e] his[tory] hor[izontal] ij[ump] il[ist] imp[ort] int[ro] is[earch] isp[lit] nextgroup=vimBang
32syn keyword vimCommand contained j[oin] ju[mps] k kee[pmarks] keepj[umps] keepp[atterns] keepa[lt] l[ist] lN[ext] lNf[ile] la[st] lab[ove] lan[guage] lad[dexpr] laddb[uffer] laddf[ile] laf[ter] lat[er] lb[uffer] lbe[fore] lbel[ow] lbo[ttom] lc[d] lch[dir] lcl[ose] lcs[cope] ld[o] le[ft] lefta[bove] lex[pr] leg[acy] lf[ile] lfd[o] lfir[st] lg[etfile] lgetb[uffer] lgete[xpr] lgr[ep] lgrepa[dd] lh[elpgrep] lhi[story] ll lla[st] lli[st] lmak[e] lne[xt] lnew[er] lnf[ile] lo[adview] loc[kmarks] lockv[ar] lol[der] lop[en] lp[revious] lpf[ile] lr[ewind] lt[ag] lua luad[o] luaf[ile] lv[imgrep] lvimgrepa[dd] lw[indow] ls m[ove] ma[rk] mak[e] marks menut[ranslate] mes[sages] mk[exrc] mks[ession] mksp[ell] mkv[imrc] mkvie[w] mod[e] mz[scheme] mzf[ile] n[ext] nb[key] nbc[lose] nextgroup=vimBang
33syn keyword vimCommand contained 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] pe[rl] perld[o] ped[it] po[p] pp[op] pre[serve] prev[ious] pro[mptfind] promptr[epl] prof[ile] profd[el] ps[earch] pt[ag] ptN[ext] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] py[thon] pyd[o] pyf[ile] py3 py3d[o] python3 py3f[ile] pyx pyxd[o] pythonx pyxf[ile] q[uit] quita[ll] qa[ll] r[ead] rec[over] red[o] redi[r] redr[aw] redraws[tatus] redrawt[abline] reg[isters] res[ize] ret[ab] rew[ind] ri[ght] rightb[elow] ru[ntime] rub[y] rubyd[o] rubyf[ile] rund[o] rv[iminfo] sN[ext] sa[rgument] sal[l] san[dbox] sav[eas] sb[uffer] sbN[ext] sba[ll] nextgroup=vimBang
34syn keyword vimCommand contained 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] sor[t] sp[lit] spe[llgood] spelld[ump] spelli[nfo] spellr[epall] spellra[re] spellu[ndo] spellw[rong] spr[evious] sre[wind] st[op] sta[g] star[tinsert] startg[replace] startr[eplace] stopi[nsert] stj[ump] sts[elect] sun[hide] sus[pend] sv[iew] sw[apname] synti[me] sync[bind] smi[le] t tN[ext] ta[g] tags tab tabc[lose] tabd[o] tabe[dit] tabf[ind] tabfir[st] tabm[ove] tabl[ast] tabn[ext] tabnew tabo[nly] tabp[revious] tabN[ext] tabr[ewind] tabs tc[d] tch[dir] tcl tcld[o] tclf[ile] te[aroff] ter[minal] tf[irst] tj[ump] tl[ast] nextgroup=vimBang
35syn keyword vimCommand contained 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] vim[grep] vimgrepa[dd] vim9[cmd] viu[sage] vne[w] vs[plit] w[rite] wN[ext] wa[ll] wi[nsize] winc[md] wind[o] winp[os] wn[ext] wp[revious] wq wqa[ll] wu[ndo] wv[iminfo] x[it] xa[ll] xr[estore] y[ank] z dl dell delel deletl deletel dp dep delp delep deletp deletep a i nextgroup=vimBang
h-east9b53c052024-02-13 21:09:22 +010036
Aliaksei Budaveidfcef892024-02-18 21:02:14 +030037" Lower priority for _new_ to distinguish constructors from the command.
38syn match vimCommand contained "\<new\>(\@!"
Bram Moolenaare2719092015-01-10 15:09:25 +010039syn match vimCommand contained "\<z[-+^.=]\=\>"
h-east9b53c052024-02-13 21:09:22 +010040syn 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 +000041
42" vimOptions are caught only when contained in a vimSet {{{2
Doug Kearnsddbb6fe2024-07-24 20:21:22 +020043" GEN_SYN_VIM: vimOption normal, START_STR='syn keyword vimOption contained', END_STR='skipwhite nextgroup=vimSetEqual,vimSetMod'
44syn 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 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 +010045syn 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
46syn 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
47syn keyword vimOption contained imc imcmdline imd imdisable imi iminsert ims imsearch imsf imstatusfunc imst imstyle inc include inex includeexpr is incsearch inde indentexpr indk indentkeys inf infercase im insertmode isf isfname isi isident isk iskeyword isp isprint js joinspaces jop jumpoptions key kmp keymap km keymodel kpc keyprotocol kp keywordprg lmap langmap lm langmenu lnr langnoremap lrm langremap ls laststatus lz lazyredraw lbr linebreak lines lsp linespace lisp lop lispoptions lw lispwords list lcs listchars lpl loadplugins luadll magic mef makeef menc makeencoding mp makeprg mps matchpairs mat matchtime mco maxcombine mfd maxfuncdepth mmd maxmapdepth mm maxmem mmp maxmempattern mmt maxmemtot mis menuitems mopt messagesopt msm mkspellmem ml modeline skipwhite nextgroup=vimSetEqual,vimSetMod
48syn keyword vimOption contained 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 pw pumwidth pythondll pythonhome pythonthreedll pythonthreehome pyx pyxversion qftf quickfixtextfunc qe quoteescape skipwhite nextgroup=vimSetEqual,vimSetMod
49syn keyword vimOption contained ro readonly rdt redrawtime re regexpengine rnu relativenumber remap rop renderoptions report rs restorescreen ri revins rl rightleft rlc rightleftcmd rubydll ru ruler ruf rulerformat rtp runtimepath scr scroll scb scrollbind scf scrollfocus sj scrolljump so scrolloff sbo scrollopt sect sections secure sel selection slm selectmode ssop sessionoptions sh shell shcf shellcmdflag sp shellpipe shq shellquote srr shellredir ssl shellslash stmp shelltemp st shelltype sxe shellxescape sxq shellxquote sr shiftround sw shiftwidth shm shortmess sn shortname sbr showbreak sc showcmd sloc showcmdloc sft showfulltag sm showmatch smd showmode stal showtabline ss sidescroll siso sidescrolloff scl signcolumn scs smartcase si smartindent sta smarttab skipwhite nextgroup=vimSetEqual,vimSetMod
50syn keyword vimOption contained sms smoothscroll sts softtabstop spell spc spellcapcheck spf spellfile spl spelllang spo spelloptions sps spellsuggest sb splitbelow spk splitkeep spr splitright sol startofline stl statusline su suffixes sua suffixesadd swf swapfile sws swapsync swb switchbuf smc synmaxcol syn syntax tcl tabclose tal tabline tpm tabpagemax ts tabstop tbs tagbsearch tc tagcase tfu tagfunc tl taglength tr tagrelative tag tags tgst tagstack tcldll term tbidi termbidi tenc termencoding tgc termguicolors twk termwinkey twsl termwinscroll tws termwinsize twt termwintype terse ta textauto tx textmode tw textwidth tsr thesaurus tsrfu thesaurusfunc top tildeop to timeout tm timeoutlen title titlelen titleold titlestring tb toolbar tbis toolbariconsize ttimeout skipwhite nextgroup=vimSetEqual,vimSetMod
51syn keyword vimOption contained ttm ttimeoutlen tbi ttybuiltin tf ttyfast ttym ttymouse tsl ttyscroll tty ttytype udir undodir udf undofile ul undolevels ur undoreload uc updatecount ut updatetime vsts varsofttabstop vts vartabstop vbs verbose vfile verbosefile vdir viewdir vop viewoptions vi viminfo vif viminfofile ve virtualedit vb visualbell warn wiv weirdinvert ww whichwrap wc wildchar wcm wildcharm wig wildignore wic wildignorecase wmnu wildmenu wim wildmode wop wildoptions wak winaltkeys wcr wincolor wi window wfb winfixbuf wfh winfixheight wfw winfixwidth wh winheight wmh winminheight wmw winminwidth winptydll wiw winwidth wrap wm wrapmargin ws wrapscan write wa writeany wb writebackup wd writedelay xtermcodes skipwhite nextgroup=vimSetEqual,vimSetMod
Bram Moolenaar071d4272004-06-13 20:20:40 +000052
53" vimOptions: These are the turn-off setting variants {{{2
h-east9b53c052024-02-13 21:09:22 +010054" GEN_SYN_VIM: vimOption turn-off, START_STR='syn keyword vimOption contained', END_STR=''
55syn 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
56syn 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 +110057syn 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
58syn keyword vimOption contained nowb nowritebackup noxtermcodes
Bram Moolenaar071d4272004-06-13 20:20:40 +000059
60" vimOptions: These are the invertible variants {{{2
h-east9b53c052024-02-13 21:09:22 +010061" GEN_SYN_VIM: vimOption invertible, START_STR='syn keyword vimOption contained', END_STR=''
62syn 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
63syn 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
64syn 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 +110065syn 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 +000066
67" termcap codes (which can also be set) {{{2
Doug Kearnsddbb6fe2024-07-24 20:21:22 +020068" GEN_SYN_VIM: vimOption term output code, START_STR='syn keyword vimOption contained', END_STR='skipwhite nextgroup=vimSetEqual,vimSetMod'
69syn 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 +010070" term key codes
71syn 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 +010072syn match vimOption contained "t_%1"
Bram Moolenaar071d4272004-06-13 20:20:40 +000073syn match vimOption contained "t_#2"
74syn match vimOption contained "t_#4"
Bram Moolenaar6d5ad4c2016-10-27 17:00:16 +020075syn match vimOption contained "t_@7"
Bram Moolenaarb0d45e72017-11-05 18:19:24 +010076syn match vimOption contained "t_*7"
77syn match vimOption contained "t_&8"
78syn match vimOption contained "t_%i"
Bram Moolenaar071d4272004-06-13 20:20:40 +000079syn match vimOption contained "t_k;"
80
Bram Moolenaar03413f42016-04-12 21:07:15 +020081" unsupported settings: some were supported by vi but don't do anything in vim {{{2
h-east9b53c052024-02-13 21:09:22 +010082" GEN_SYN_VIM: Missing vimOption, START_STR='syn keyword vimErrSetting contained', END_STR=''
83syn 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
84syn 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
85syn 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 +000086
Bram Moolenaar80a94a52006-02-23 21:26:58 +000087" AutoCmd Events {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +000088syn case ignore
h-east9b53c052024-02-13 21:09:22 +010089" GEN_SYN_VIM: vimAutoEvent, START_STR='syn keyword vimAutoEvent contained', END_STR=''
Doug Kearnse85fdc72024-07-07 20:45:37 +020090syn keyword vimAutoEvent contained BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre CmdlineChanged CmdlineEnter CmdlineLeave CmdUndefined CmdwinEnter CmdwinLeave ColorScheme ColorSchemePre CompleteChanged CompleteDone CompleteDonePre CursorHold CursorHoldI CursorMoved CursorMovedC CursorMovedI DiffUpdated DirChanged DirChangedPre EncodingChanged ExitPre FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost
Ernie Rael05124252024-07-11 22:10:45 +020091syn keyword vimAutoEvent contained FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave InsertLeavePre KeyInputPre MenuPopup ModeChanged OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SafeState SafeStateAgain SessionLoadPost SessionWritePost ShellCmdPost ShellFilterPost SigUSR1 SourceCmd SourcePost SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabClosed TabEnter TabLeave TabNew TermChanged TerminalOpen TerminalWinOpen TermResponse TermResponseAll TextChanged TextChangedI TextChangedP TextChangedT TextYankPost User VimEnter VimLeave VimLeavePre VimResized VimResume VimSuspend WinClosed WinEnter WinLeave WinNew WinNewPre WinResized WinScrolled
Bram Moolenaar071d4272004-06-13 20:20:40 +000092
93" Highlight commonly used Groupnames {{{2
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +020094syn 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 +000095
96" Default highlighting groups {{{2
h-east9b53c052024-02-13 21:09:22 +010097" GEN_SYN_VIM: vimHLGroup, START_STR='syn keyword vimHLGroup contained', END_STR=''
Doug Kearns025dc482025-02-23 15:48:52 +010098syn keyword vimHLGroup contained ErrorMsg IncSearch ModeMsg NonText StatusLine StatusLineNC EndOfBuffer VertSplit VisualNOS DiffText PmenuSbar TabLineSel TabLineFill Cursor lCursor QuickFixLine CursorLineSign CursorLineFold CurSearch PmenuKind PmenuKindSel PmenuMatch PmenuMatchSel PmenuExtra PmenuExtraSel PopupSelected MessageWindow PopupNotification Normal Directory LineNr CursorLineNr MoreMsg Question Search SpellBad SpellCap SpellRare SpellLocal PmenuThumb Pmenu PmenuSel SpecialKey Title WarningMsg WildMenu Folded FoldColumn SignColumn Visual DiffAdd DiffChange DiffDelete TabLine CursorColumn CursorLine ColorColumn MatchParen StatusLineTerm StatusLineTermNC ToolbarLine ToolbarButton Menu Tooltip Scrollbar CursorIM LineNrAbove LineNrBelow
Christian Brabandt393708c2024-05-27 15:50:07 +020099syn match vimHLGroup contained "\<Conceal\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000100syn case match
101
102" Function Names {{{2
h-east9b53c052024-02-13 21:09:22 +0100103" GEN_SYN_VIM: vimFuncName, START_STR='syn keyword vimFuncName contained', END_STR=''
Doug Kearns8dec6c22025-01-19 14:02:06 +0100104syn 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
105syn keyword vimFuncName contained char2nr charclass charcol charidx chdir cindent clearmatches col complete complete_add complete_check complete_info confirm copy cos cosh count cscope_connection cursor debugbreak deepcopy delete deletebufline did_filetype diff diff_filler diff_hlID digraph_get digraph_getlist digraph_set digraph_setlist echoraw empty environ err_teapot escape eval eventhandler executable execute exepath exists exists_compiled exp expand expandcmd extend extendnew feedkeys filecopy filereadable filewritable filter finddir findfile flatten flattennew float2nr floor fmod fnameescape fnamemodify foldclosed foldclosedend foldlevel foldtext foldtextresult foreach foreground fullcommand funcref function garbagecollect get getbufinfo getbufline getbufoneline
h-east61397662025-01-03 17:32:54 +0100106syn keyword vimFuncName contained getbufvar getcellpixels getcellwidths getchangelist getchar getcharmod getcharpos getcharsearch getcharstr getcmdcomplpat getcmdcompltype getcmdline getcmdpos getcmdprompt getcmdscreenpos getcmdtype getcmdwintype getcompletion getcurpos getcursorcharpos getcwd getenv getfontname getfperm getfsize getftime getftype getimstatus getjumplist getline getloclist getmarklist getmatches getmousepos getmouseshape getpid getpos getqflist getreg getreginfo getregion getregionpos getregtype getscriptinfo getstacktrace gettabinfo gettabvar gettabwinvar gettagstack gettext getwininfo getwinpos getwinposx getwinposy getwinvar glob glob2regpat globpath has has_key haslocaldir hasmapto histadd histdel histget histnr hlID hlexists hlget hlset hostname
Doug Kearns4a530a62025-02-03 18:59:09 +0100107syn keyword vimFuncName contained iconv id indent index indexof input inputdialog inputlist inputrestore inputsave inputsecret insert instanceof interrupt invert isabsolutepath isdirectory isinf islocked isnan items job_getchannel job_info job_setoptions job_start job_status job_stop join js_decode js_encode json_decode json_encode keys keytrans len libcall libcallnr line line2byte lispindent list2blob list2str listener_add listener_flush listener_remove localtime log log10 luaeval map maparg mapcheck maplist mapnew mapset match matchadd matchaddpos matcharg matchbufline matchdelete matchend matchfuzzy matchfuzzypos matchlist matchstr matchstrlist matchstrpos max menu_info min mkdir mode mzeval nextnonblank ngettext nr2char or pathshorten perleval popup_atcursor
108syn keyword vimFuncName contained popup_beval popup_clear popup_close popup_create popup_dialog popup_filter_menu popup_filter_yesno popup_findecho popup_findinfo popup_findpreview popup_getoptions popup_getpos popup_hide popup_list popup_locate popup_menu popup_move popup_notification popup_setbuf popup_setoptions popup_settext popup_show pow prevnonblank printf prompt_getprompt prompt_setcallback prompt_setinterrupt prompt_setprompt prop_add prop_add_list prop_clear prop_find prop_list prop_remove prop_type_add prop_type_change prop_type_delete prop_type_get prop_type_list pum_getpos pumvisible py3eval pyeval pyxeval rand range readblob readdir readdirex readfile reduce reg_executing reg_recording reltime reltimefloat reltimestr remote_expr remote_foreground
109syn keyword vimFuncName contained remote_peek remote_read remote_send remote_startserver remove rename repeat resolve reverse round rubyeval screenattr screenchar screenchars screencol screenpos screenrow screenstring search searchcount searchdecl searchpair searchpairpos searchpos server2client serverlist setbufline setbufvar setcellwidths setcharpos setcharsearch setcmdline setcmdpos setcursorcharpos setenv setfperm setline setloclist setmatches setpos setqflist setreg settabvar settabwinvar settagstack setwinvar sha256 shellescape shiftwidth sign_define sign_getdefined sign_getplaced sign_jump sign_place sign_placelist sign_undefine sign_unplace sign_unplacelist simplify sin sinh slice sort sound_clear sound_playevent sound_playfile sound_stop soundfold spellbadword
110syn keyword vimFuncName contained spellsuggest split sqrt srand state str2blob str2float str2list str2nr strcharlen strcharpart strchars strdisplaywidth strftime strgetchar stridx string strlen strpart strptime strridx strtrans strutf16len strwidth submatch substitute swapfilelist swapinfo swapname synID synIDattr synIDtrans synconcealed synstack system systemlist tabpagebuflist tabpagenr tabpagewinnr tagfiles taglist tan tanh tempname term_dumpdiff term_dumpload term_dumpwrite term_getaltscreen term_getansicolors term_getattr term_getcursor term_getjob term_getline term_getscrolled term_getsize term_getstatus term_gettitle term_gettty term_list term_scrape term_sendkeys term_setansicolors term_setapi term_setkill term_setrestore term_setsize term_start term_wait
111syn keyword vimFuncName contained terminalprops test_alloc_fail test_autochdir test_feedinput test_garbagecollect_now test_garbagecollect_soon test_getvalue test_gui_event test_ignore_error test_mswin_event test_null_blob test_null_channel test_null_dict test_null_function test_null_job test_null_list test_null_partial test_null_string test_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 type typename undofile undotree uniq utf16idx values virtcol virtcol2col visualmode wildmenumode win_execute win_findbuf win_getid win_gettype win_gotoid win_id2tabwin win_id2win win_move_separator win_move_statusline win_screenpos
112syn keyword vimFuncName contained win_splitmove winbufnr wincol windowsversion winheight winlayout winline winnr winrestcmd winrestview winsaveview winwidth wordcount writefile xor
Bram Moolenaar071d4272004-06-13 20:20:40 +0000113
Bram Moolenaarac7bd632013-03-19 11:35:58 +0100114"--- syntax here and above generated by mkvimvim ---
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000115" Special Vim Highlighting (not automatic) {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000116
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200117" Set up commands for this syntax highlighting file {{{2
118
119com! -nargs=* Vim9 execute <q-args> s:vim9script ? "" : "contained"
120com! -nargs=* VimL execute <q-args> s:vim9script ? "contained" : ""
121
Doug Kearns818c6412024-10-06 17:00:48 +0200122if exists("g:vimsyn_folding") && g:vimsyn_folding =~# '[acefhiHlmpPrt]'
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200123 if g:vimsyn_folding =~# 'a'
124 com! -nargs=* VimFolda <args> fold
125 else
126 com! -nargs=* VimFolda <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100127 endif
Doug Kearns818c6412024-10-06 17:00:48 +0200128 if g:vimsyn_folding =~# 'c'
129 com! -nargs=* VimFoldc <args> fold
130 else
131 com! -nargs=* VimFoldc <args>
132 endif
133 if g:vimsyn_folding =~# 'e'
134 com! -nargs=* VimFolde <args> fold
135 else
136 com! -nargs=* VimFolde <args>
137 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200138 if g:vimsyn_folding =~# 'f'
139 com! -nargs=* VimFoldf <args> fold
140 else
141 com! -nargs=* VimFoldf <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100142 endif
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100143 if g:vimsyn_folding =~# 'h'
144 com! -nargs=* VimFoldh <args> fold
145 else
146 com! -nargs=* VimFoldh <args>
147 endif
Doug Kearnsce064932024-04-13 18:24:01 +0200148 if g:vimsyn_folding =~# 'H'
149 com! -nargs=* VimFoldH <args> fold
150 else
151 com! -nargs=* VimFoldH <args>
152 endif
Doug Kearns818c6412024-10-06 17:00:48 +0200153 if g:vimsyn_folding =~# 'i'
154 com! -nargs=* VimFoldi <args> fold
155 else
156 com! -nargs=* VimFoldi <args>
157 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200158 if g:vimsyn_folding =~# 'l'
159 com! -nargs=* VimFoldl <args> fold
160 else
161 com! -nargs=* VimFoldl <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100162 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200163 if g:vimsyn_folding =~# 'm'
164 com! -nargs=* VimFoldm <args> fold
165 else
166 com! -nargs=* VimFoldm <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100167 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200168 if g:vimsyn_folding =~# 'p'
169 com! -nargs=* VimFoldp <args> fold
170 else
171 com! -nargs=* VimFoldp <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100172 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200173 if g:vimsyn_folding =~# 'P'
174 com! -nargs=* VimFoldP <args> fold
175 else
176 com! -nargs=* VimFoldP <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100177 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200178 if g:vimsyn_folding =~# 'r'
179 com! -nargs=* VimFoldr <args> fold
180 else
181 com! -nargs=* VimFoldr <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100182 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200183 if g:vimsyn_folding =~# 't'
184 com! -nargs=* VimFoldt <args> fold
185 else
186 com! -nargs=* VimFoldt <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100187 endif
188else
189 com! -nargs=* VimFolda <args>
Doug Kearns818c6412024-10-06 17:00:48 +0200190 com! -nargs=* VimFoldc <args>
191 com! -nargs=* VimFolde <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100192 com! -nargs=* VimFoldf <args>
Doug Kearns818c6412024-10-06 17:00:48 +0200193 com! -nargs=* VimFoldi <args>
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100194 com! -nargs=* VimFoldh <args>
Doug Kearnsce064932024-04-13 18:24:01 +0200195 com! -nargs=* VimFoldH <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100196 com! -nargs=* VimFoldl <args>
197 com! -nargs=* VimFoldm <args>
198 com! -nargs=* VimFoldp <args>
199 com! -nargs=* VimFoldP <args>
200 com! -nargs=* VimFoldr <args>
201 com! -nargs=* VimFoldt <args>
202endif
203
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000204" Deprecated variable options {{{2
205if exists("g:vim_minlines")
206 let g:vimsyn_minlines= g:vim_minlines
207endif
208if exists("g:vim_maxlines")
209 let g:vimsyn_maxlines= g:vim_maxlines
210endif
211if exists("g:vimsyntax_noerror")
212 let g:vimsyn_noerror= g:vimsyntax_noerror
213endif
214
Bram Moolenaar03413f42016-04-12 21:07:15 +0200215" Variable options {{{2
216if exists("g:vim_maxlines")
217 let s:vimsyn_maxlines= g:vim_maxlines
218else
219 let s:vimsyn_maxlines= 60
220endif
221
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200222" Nulls {{{2
223" =====
224Vim9 syn keyword vim9Null null null_blob null_channel null_class null_dict null_function null_job null_list null_object null_partial null_string
225
226" Booleans {{{2
227" ========
228Vim9 syn keyword vim9Boolean true false
229
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000230" Numbers {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000231" =======
dkearns5cd86c62024-03-12 07:40:58 +1100232syn case ignore
Doug Kearns1aa287e2025-02-10 22:00:27 +0100233syn match vimNumber '\<\d\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment,vimSubscript
234syn match vimNumber '\<\d\+\.\d\+\%(e[+-]\=\d\+\)\=' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment
235syn match vimNumber '\<0b[01]\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment,vimSubscript
236syn match vimNumber '\<0o\=\o\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment,vimSubscript
237syn match vimNumber '\<0x\x\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment,vimSubscript
Doug Kearns8dec6c22025-01-19 14:02:06 +0100238syn match vimNumber '\<0z\>' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment
Doug Kearns1aa287e2025-02-10 22:00:27 +0100239syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment,vimSubscript
dkearns5cd86c62024-03-12 07:40:58 +1100240syn case match
Bram Moolenaar071d4272004-06-13 20:20:40 +0000241
Bram Moolenaar6c1e1572019-06-22 02:13:00 +0200242" All vimCommands are contained by vimIsCommand. {{{2
Doug Kearns025dc482025-02-23 15:48:52 +0100243syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutoCmd,vimAugroup,vimBehave,vimCall,vimCatch,vimConst,vimDebuggreedy,vimDef,vimDefFold,vimDelcommand,@vimEcho,vimEnddef,vimEndfunction,vimExecute,vimIsCommand,vimExtCmd,vimFor,vimFunction,vimFuncFold,vimGlobal,vimHighlight,vimLet,vimLoadkeymap,vimLockvar,vimMap,vimMark,vimMatch,vimNotFunc,vimNormal,vimSet,vimSleep,vimSyntax,vimThrow,vimUnlet,vimUnlockvar,vimUnmap,vimUserCmd,vimMenu,vimMenutranslate,@vim9CmdList,@vimExUserCmdList
h-east61397662025-01-03 17:32:54 +0100244syn cluster vim9CmdList contains=vim9Abstract,vim9Class,vim9Const,vim9Enum,vim9Export,vim9Final,vim9For,vim9Interface,vim9Type,vim9Var
Doug Kearns60bd1402025-02-27 19:15:20 +0100245syn match vimCmdSep "\\\@1<!|" skipwhite nextgroup=@vimCmdList,vimSubst1,vimFunc
246syn match vimCmdSep ":\+" skipwhite nextgroup=@vimCmdList,vimSubst1
Doug Kearns4a530a62025-02-03 18:59:09 +0100247syn match vimCount contained "\d\+"
Doug Kearns1718e7d2025-01-08 18:20:47 +0100248syn match vimIsCommand "\<\%(\h\w*\|[23]mat\%[ch]\)\>" nextgroup=vimBang contains=vimCommand
Doug Kearns3c07eb02024-09-02 10:03:37 +0200249syn match vimBang contained "!"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000250
Doug Kearns1aa287e2025-02-10 22:00:27 +0100251syn region vimSubscript contained matchgroup=vimSubscriptBracket start="\[" end="]" nextgroup=vimSubscript contains=@vimExprList
252
253syn match vimVar contained "\<\h[a-zA-Z0-9#_]*\>" nextgroup=vimSubscript contains=vim9Super,vim9This
254syn match vimVar "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>" nextgroup=vimSubscript
255syn match vimVar "\<a:\%(000\|\d\+\)\>" nextgroup=vimSubscript
256syn match vimFBVar contained "\<[bwglsta]:\h[a-zA-Z0-9#_]*\>" nextgroup=vimSubscript
257
258syn match vimVimVar "\<v:\h\w*\>" nextgroup=vimSubscript
259syn match vimOptionVar "&\%([lg]:\)\=\a\+\>" nextgroup=vimSubscript
260syn match vimOptionVar "&t_\S[a-zA-Z0-9]\>" nextgroup=vimSubscript
261syn match vimOptionVar "&t_k;" nextgroup=vimSubscript
262syn cluster vimSpecialVar contains=vimEnvvar,vimLetRegister,vimOptionVar,vimVimVar
263
264Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s\+[-+/*%]\=="
265Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s\+\.\.="
266Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s\+=<<"
267Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s*->" contains=vim9Super,vim9This
268Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\[" nextgroup=vimSubscript
269Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\." nextgroup=vimOper contains=vim9Super,vim9This
270
271Vim9 syn match vim9LhsVariableList "\[\_[^]]\+]\ze\s\+[-+/*%]\==" contains=vimVar,@vimSpecialVar
272Vim9 syn match vim9LhsVariableList "\[\_[^]]\+]\ze\s\+\.\.=" contains=vimVar,@vimSpecialVar
273
274Vim9 syn match vim9LhsRegister "@["0-9\-a-zA-Z#=*+_/]\ze\s\+\%(\.\.\)\=="
275
276syn cluster vimExprList contains=@vimSpecialVar,vimFunc,vimNumber,vimOper,vimOperParen,vimLambda,vimString,vimVar,@vim9ExprList
277syn cluster vim9ExprList contains=vim9Boolean,vim9LambdaParams,vim9Null
dkearnsb1427b42024-02-28 05:59:30 +1100278
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000279" Insertions And Appends: insert append {{{2
Bram Moolenaar519cc552021-11-16 19:18:26 +0000280" (buftype != nofile test avoids having append, change, insert show up in the command window)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000281" =======================
Bram Moolenaar519cc552021-11-16 19:18:26 +0000282if &buftype != 'nofile'
dkearns4ba70ca2024-04-15 04:32:56 +1000283 syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=a\%[ppend]$" matchgroup=vimCommand end="^\.$" extend
284 syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=c\%[hange]$" matchgroup=vimCommand end="^\.$" extend
285 syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=i\%[nsert]$" matchgroup=vimCommand end="^\.$" extend
Bram Moolenaar519cc552021-11-16 19:18:26 +0000286endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000287
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000288" Behave! {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000289" =======
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100290if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_nobehaveerror")
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000291 syn match vimBehaveError contained "[^ ]\+"
292endif
Doug Kearnsfe6d5b02024-02-14 21:17:43 +0100293syn match vimBehave "\<be\%[have]\>" nextgroup=vimBehaveBang,vimBehaveModel,vimBehaveError skipwhite
294syn match vimBehaveBang contained "\a\@1<=!" nextgroup=vimBehaveModel skipwhite
295syn keyword vimBehaveModel contained mswin xterm
Bram Moolenaar071d4272004-06-13 20:20:40 +0000296
Doug Kearns99984fc2024-07-18 20:45:19 +0200297" Call {{{2
298" ====
299syn match vimCall "\<call\=\>" skipwhite nextgroup=vimFunc
300
Doug Kearnsa9c06422025-02-12 20:44:17 +0100301" Debuggreedy {{{2
Doug Kearns4a530a62025-02-03 18:59:09 +0100302" ===========
303" TODO: special-cased until generalised range/count support is implemented
304syn match vimDebuggreedy "\<0\=debugg\%[reedy]\>" contains=vimCount
305
dkearnsa3bddb72024-06-14 01:48:10 +1000306" Exception Handling {{{2
307syn keyword vimThrow th[row] skipwhite nextgroup=@vimExprList
308syn keyword vimCatch cat[ch] skipwhite nextgroup=vimCatchPattern
309syn region vimCatchPattern contained matchgroup=Delimiter start="\z([!#$%&'()*+,-./:;<=>?@[\]^_`{}~]\)" skip="\\\\\|\\\z1" end="\z1" contains=@vimSubstList oneline
310
Doug Kearns818c6412024-10-06 17:00:48 +0200311" Export {{{2
312" ======
313if s:vim9script
314 syn keyword vim9Export export skipwhite nextgroup=vim9Abstract,vim9ClassBody,vim9Const,vim9Def,vim9EnumBody,vim9Final,vim9InterfaceBody,vim9Type,vim9Var
315endif
316
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000317" Filetypes {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000318" =========
Bram Moolenaar293ee4d2004-12-09 21:34:53 +0000319syn match vimFiletype "\<filet\%[ype]\(\s\+\I\i*\)*" skipwhite contains=vimFTCmd,vimFTOption,vimFTError
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100320if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_vimFTError")
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000321 syn match vimFTError contained "\I\i*"
322endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000323syn keyword vimFTCmd contained filet[ype]
324syn keyword vimFTOption contained detect indent off on plugin
325
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000326" Augroup : vimAugroupError removed because long augroups caused sync'ing problems. {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000327" ======= : Trade-off: Increasing synclines with slower editing vs augroup END error checking.
Doug Kearns1aa287e2025-02-10 22:00:27 +0100328syn cluster vimAugroupList contains=@vimCmdList,vimFilter,vimFunc,vimLineComment,vimSpecFile,vimOper,vimNumber,vimOperParen,@vimComment,vimString,vimSubst,vimRegister,vimCmplxRepeat,vimNotation,vimCtrlChar,vimContinue
dkearnsc4aef9a2024-03-04 02:42:47 +1100329syn match vimAugroup "\<aug\%[roup]\>" contains=vimAugroupKey,vimAugroupBang skipwhite nextgroup=vimAugroupBang,vimAutoCmdGroup
Bram Moolenaarf3913272016-02-25 00:00:01 +0100330if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'a'
dkearnsc4aef9a2024-03-04 02:42:47 +1100331 syn region vimAugroup fold start="\<aug\%[roup]\>\ze\s\+\%([eE][nN][dD]\)\@!\S\+" matchgroup=vimAugroupKey end="\<aug\%[roup]\>\ze\s\+[eE][nN][dD]\>" contains=vimAutoCmd,@vimAugroupList,vimAugroupkey skipwhite nextgroup=vimAugroupEnd
Bram Moolenaarb4ff5182015-11-10 21:15:48 +0100332else
dkearnsc4aef9a2024-03-04 02:42:47 +1100333 syn region vimAugroup start="\<aug\%[roup]\>\ze\s\+\%([eE][nN][dD]\)\@!\S\+" matchgroup=vimAugroupKey end="\<aug\%[roup]\>\ze\s\+[eE][nN][dD]\>" contains=vimAutoCmd,@vimAugroupList,vimAugroupkey skipwhite nextgroup=vimAugroupEnd
Bram Moolenaarb4ff5182015-11-10 21:15:48 +0100334endif
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100335if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noaugrouperror")
dkearnsc4aef9a2024-03-04 02:42:47 +1100336 syn match vimAugroupError "\<aug\%[roup]\>\s\+[eE][nN][dD]\>"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000337endif
dkearnsc4aef9a2024-03-04 02:42:47 +1100338
339syn match vimAutoCmdGroup contained "\S\+"
340syn match vimAugroupEnd contained "\c\<END\>"
341syn match vimAugroupBang contained "\a\@1<=!" skipwhite nextgroup=vimAutoCmdGroup
342syn keyword vimAugroupKey contained aug[roup] skipwhite nextgroup=vimAugroupBang,vimAutoCmdGroup,vimAugroupEnd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000343
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000344" Operators: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000345" =========
Doug Kearnsa9c06422025-02-12 20:44:17 +0100346syn cluster vimOperGroup contains=@vimContinue,@vimExprList,vim9Comment
Doug Kearns1aa287e2025-02-10 22:00:27 +0100347syn match vimOper "\a\@<!!" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimSpecFile
348syn match vimOper "||\|&&\|[-+*/%.]" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimSpecFile
349syn match vimOper "?" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList
Doug Kearnsc273f1a2025-01-20 21:53:01 +0100350" distinguish ternary : from ex-colon
Doug Kearns1aa287e2025-02-10 22:00:27 +0100351syn match vimOper "\s\@1<=:\ze\s\|\s\@1<=:$" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList
352syn match vimOper "??" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList
353syn match vimOper "=" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimSpecFile
354syn match vimOper "\%#=1\%(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\)[?#]\=" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimSpecFile
355syn match vimOper "\<is\%(not\)\=\>" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimSpecFile
356syn match vimOper "\<is\%(not\)\=[?#]" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimSpecFile
357syn region vimOperParen matchgroup=vimParenSep start="(" end=")" contains=@vimOperGroup nextgroup=vimSubscript
358syn region vimOperParen matchgroup=vimSep start="#\={" end="}" contains=@vimOperGroup nextgroup=vimSubscript,vimVar
359syn region vimOperParen contained matchgroup=vimSep start="\[" end="]" contains=@vimOperGroup nextgroup=vimSubscript,vimVar
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100360if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noopererror")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100361 syn match vimOperError ")"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000362endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000363
Doug Kearns1aa287e2025-02-10 22:00:27 +0100364syn match vimOperContinue contained "^\s*\zs\\" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList
365syn match vimOperContinueComment contained '^\s*\zs["#]\\ .*' skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList
366syn cluster vimOperContinue contains=vimOperContinue,vimOperContinueComment
367
368" Lambda Expressions: {{{2
369" ==================
370syn match vimLambdaOperator contained "->" skipwhite nextgroup=@vimExprList
371syn region vimLambda contained matchgroup=Delimiter start="{\ze[[:space:][:alnum:]_.,]*->" end="}" end="$" skip=+\s*\n\s*\\\|\s*\n\s*"\\ + contains=@vimContinue,@vimExprList,vimLambdaParams
372syn match vimLambdaParams contained "{\@1<=.\{-}\%(->\)\@=" nextgroup=vimLambdaOperator contains=vimFuncParam
373
374syn match vim9LambdaOperator contained "=>" skipwhite skipempty nextgroup=@vimExprList,vim9LambdaBlock,vim9LambdaOperatorComment
375syn match vim9LambdaParamsParen contained "[()]"
376syn region vim9LambdaParams contained
377 \ matchgroup=vim9LambdaParamsParen
378 \ start="(\ze\s*\(\.\.\.\)\=\h\w*[,:]\%(\s\|$\)"
379 \ start="(\ze\s*\n
380 "\ line continuations
381 \\%(\s*\%(#\\ .*\|\\\s*\)\n\)*\s*\\\s*
382 "\ parameter names
383 \\(\.\.\.\)\=\h\w*[,:]\%(\s\|$\)"
384 \ end=")\ze\%(:\s\|\s\+=>\)"
385 \ matchgroup=vimContinue
386 \ end="^\s*\\\ze\s\+=>"
387 \ skipwhite nextgroup=vim9LambdaReturnType,vim9LambdaOperator
388 \ contains=@vim9Continue,vimDefParam,vim9LambdaParamsParen
389syn match vim9LambdaParams contained "(\s*)\|(\s*\(\.\.\.\)\=\h\w*\s*)\ze\%(:\s\|\s\+=>\)" skipwhite nextgroup=vim9LambdaReturnType,vim9LambdaOperator contains=vimDefParam,vim9LambdaParamsParen
390
391syn region vim9LambdaReturnType contained start=":\s" end="$" end="\ze#" end="\ze=>" skipwhite skipempty nextgroup=vim9LambdaOperator,vim9LamdaOperatorComment contains=vimTypeSep transparent
392syn region vim9LambdaBlock contained matchgroup=vimSep start="{" end="^\s*\zs}" contains=@vimDefBodyList
393
394syn match vim9LambdaOperatorComment contained "#.*" skipwhite skipempty nextgroup=@vimExprList,vim9LambdaBlock,vim9LambdaOperatorComment
395
dkearns4ba70ca2024-04-15 04:32:56 +1000396" Functions: Tag is provided for those who wish to highlight tagged functions {{{2
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000397" =========
Doug Kearns1aa287e2025-02-10 22:00:27 +0100398syn cluster vimFuncList contains=vimFuncBang,vimFunctionError,vimFuncKey,vimFuncScope,vimFuncSID,Tag
399syn cluster vimDefList contains=vimFuncBang,vimFunctionError,vimDefKey,vimFuncScope,vimFuncSID,Tag
dkearns4ba70ca2024-04-15 04:32:56 +1000400
Doug Kearns68ba6c22025-02-16 16:40:12 +0100401syn cluster vimFuncBodyCommon contains=@vimCmdList,vimCmplxRepeat,vimContinue,vimCtrlChar,vimDef,vimFBVar,vimFunc,vimFunction,vimLetHereDoc,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegister,vimSpecFile,vimString,vimSubst,vimFuncFold,vimDefFold
Doug Kearns1aa287e2025-02-10 22:00:27 +0100402syn cluster vimFuncBodyList contains=@vimFuncBodyCommon,vimComment,vimLineComment,vimInsert,vimConst,vimLet,vimSearch
403syn cluster vimDefBodyList contains=@vimFuncBodyCommon,vim9Comment,vim9LineComment,vim9Block,vim9Const,vim9Final,vim9Var,vim9Null,vim9Boolean,vim9For,vim9LhsVariable,vim9LhsVariableList,vim9LhsRegister,vim9Search,@vimSpecialVar
dkearns35e6f4c2024-03-22 06:41:10 +1100404
405syn region vimFuncPattern contained matchgroup=vimOper start="/" end="$" contains=@vimSubstList
406syn match vimFunction "\<fu\%[nction]\>" skipwhite nextgroup=vimCmdSep,vimComment,vimFuncPattern contains=vimFuncKey
407syn match vimDef "\<def\>" skipwhite nextgroup=vimCmdSep,vimComment,vimFuncPattern contains=vimDefKey
408
409syn match vimFunction "\<fu\%[nction]\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+" contains=@vimFuncList skipwhite nextgroup=vimFuncParams
Doug Kearns818c6412024-10-06 17:00:48 +0200410syn match vimDef "\<def\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+" contains=@vimDefList nextgroup=vimDefParams
dkearns35e6f4c2024-03-22 06:41:10 +1100411
Doug Kearns35699f12024-09-19 19:51:59 +0200412syn match vimFuncComment contained +".*+ skipwhite skipempty nextgroup=vimFuncBody,vimEndfunction
413syn match vimDefComment contained "#.*" skipwhite skipempty nextgroup=vimDefBody,vimEnddef
dkearns35e6f4c2024-03-22 06:41:10 +1100414
415syn match vimFuncBang contained "!"
416syn match vimFuncSID contained "\c<sid>"
Doug Kearns1aa287e2025-02-10 22:00:27 +0100417syn match vimFuncScope contained "\<[sg]:"
dkearns35e6f4c2024-03-22 06:41:10 +1100418syn keyword vimFuncKey contained fu[nction]
419syn keyword vimDefKey contained def
420
Doug Kearns9b67a2e2024-12-26 10:13:45 +0100421syn region vimFuncParams contained matchgroup=Delimiter start="(" skip=+\n\s*\\\|\n\s*"\\ + end=")" skipwhite skipempty nextgroup=vimFuncBody,vimFuncComment,vimEndfunction,vimFuncMod,vim9CommentError contains=vimFuncParam,vimOperParen,@vimContinue
422syn region vimDefParams contained matchgroup=Delimiter start="(" end=")" skipwhite skipempty nextgroup=vimDefBody,vimDefComment,vimEnddef,vimReturnType,vimCommentError contains=vimDefParam,vim9Comment,vimFuncParamEquals,vimOperParen
dkearns35e6f4c2024-03-22 06:41:10 +1100423syn match vimFuncParam contained "\<\h\w*\>\|\.\.\." skipwhite nextgroup=vimFuncParamEquals
424syn match vimDefParam contained "\<\h\w*\>" skipwhite nextgroup=vimParamType,vimFuncParamEquals
425
Doug Kearns35699f12024-09-19 19:51:59 +0200426syn match vimFuncParamEquals contained "=" skipwhite nextgroup=@vimExprList
427syn match vimFuncMod contained "\<\%(abort\|closure\|dict\|range\)\>" skipwhite skipempty nextgroup=vimFuncBody,vimFuncComment,vimEndfunction,vimFuncMod,vim9CommentError
dkearns35e6f4c2024-03-22 06:41:10 +1100428
Doug Kearns35699f12024-09-19 19:51:59 +0200429syn region vimFuncBody contained start="^." matchgroup=vimCmdSep start="|" matchgroup=vimCommand end="\<endfu\%[nction]\>" contains=@vimFuncBodyList skipwhite nextgroup=vimCmdSep,vimComment,vim9CommentError
430syn region vimDefBody contained start="^." matchgroup=vimCmdSep start="|" matchgroup=vimCommand end="\<enddef\>" contains=@vimDefBodyList skipwhite nextgroup=vimCmdSep,vim9Comment,vimCommentError
dkearns35e6f4c2024-03-22 06:41:10 +1100431
Doug Kearnsfc64ac02024-06-22 11:20:36 +0200432syn match vimEndfunction "\<endf\%[unction]\>" skipwhite nextgroup=vimCmdSep,vimComment,vim9CommentError
433syn match vimEnddef "\<enddef\>" skipwhite nextgroup=vimCmdSep,vim9Comment,vimCommentError
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000434
Bram Moolenaarf3913272016-02-25 00:00:01 +0100435if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f'
Doug Kearns818c6412024-10-06 17:00:48 +0200436 syn region vimFuncFold start="\<fu\%[nction]\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+\s*(" end="\<endf\%[unction]\>" contains=vimFunction fold keepend extend transparent
437 syn region vimDefFold start="\<def\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\)\+(" end="\<enddef\>" contains=vimDef fold keepend extend transparent
Bram Moolenaarb4ff5182015-11-10 21:15:48 +0100438endif
dkearns35e6f4c2024-03-22 06:41:10 +1100439
Bram Moolenaar5c736222010-01-06 20:54:52 +0100440syn match vimFuncBlank contained "\s\+"
441
dkearns35e6f4c2024-03-22 06:41:10 +1100442" Types: {{{2
443" =====
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200444
Doug Kearns35699f12024-09-19 19:51:59 +0200445syn region vimReturnType contained start=":\s" end="$" matchgroup=vim9Comment end="\ze[#"]" skipwhite skipempty nextgroup=vimDefBody,vimDefComment,vimEnddef,vimCommentError contains=vimTypeSep transparent
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200446syn match vimParamType contained ":\s" skipwhite skipnl nextgroup=@vimType contains=vimTypeSep
dkearns35e6f4c2024-03-22 06:41:10 +1100447
448syn match vimTypeSep contained ":\s\@=" skipwhite nextgroup=@vimType
449syn keyword vimType contained any blob bool channel float job number string void
450syn match vimType contained "\<func\>"
451syn region vimCompoundType contained matchgroup=vimType start="\<func(" end=")" nextgroup=vimTypeSep contains=@vimType oneline transparent
452syn region vimCompoundType contained matchgroup=vimType start="\<\%(list\|dict\)<" end=">" contains=@vimType oneline transparent
453syn match vimUserType contained "\<\u\w*\>"
454
455syn cluster vimType contains=vimType,vimCompoundType,vimUserType
Bram Moolenaar4d8f4762021-06-27 15:18:56 +0200456
Doug Kearns818c6412024-10-06 17:00:48 +0200457" Classes, Enums And Interfaces: {{{2
458" =============================
459
460if s:vim9script
461 " Methods {{{3
Doug Kearns1aa287e2025-02-10 22:00:27 +0100462 syn match vim9MethodDef contained "\<def\>" skipwhite nextgroup=vim9MethodDefName,vim9ConstructorDefName
Doug Kearns818c6412024-10-06 17:00:48 +0200463 syn match vim9MethodDefName contained "\<\h\w*\>" nextgroup=vim9MethodDefParams contains=@vim9MethodName
464 syn region vim9MethodDefParams contained
465 \ matchgroup=Delimiter start="(" end=")"
466 \ skipwhite skipnl nextgroup=vim9MethodDefBody,vimDefComment,vimEnddef,vim9MethodDefReturnType,vimCommentError
467 \ contains=vimDefParam,vim9Comment,vimFuncParamEquals
Doug Kearns1aa287e2025-02-10 22:00:27 +0100468
469 syn match vim9ConstructorDefName contained "\<new\w*\>"
470 \ nextgroup=vim9ConstructorDefParams
471 \ contains=@vim9MethodName
472 syn match vim9ConstructorDefParam contained "\<\%(this\.\)\=\h\w*\>"
473 \ skipwhite nextgroup=vimParamType,vimFuncParamEquals
474 \ contains=vim9This,vimOper
475 syn region vim9ConstructorDefParams contained
476 \ matchgroup=Delimiter start="(" end=")"
477 \ skipwhite skipnl nextgroup=vim9MethodDefBody,vimDefComment,vimEnddef,vimCommentError
478 \ contains=vim9ConstructorDefParam,vim9Comment,vimFuncParamEquals
479
Doug Kearns818c6412024-10-06 17:00:48 +0200480 syn region vim9MethodDefReturnType contained
481 \ start=":\s" end="$" matchgroup=vim9Comment end="\ze[#"]"
482 \ skipwhite skipnl nextgroup=vim9MethodDefBody,vimDefComment,vimCommentError
483 \ contains=vimTypeSep
484 \ transparent
485 syn region vim9MethodDefBody contained
486 \ start="^.\=" matchgroup=vimCommand end="\<enddef\>"
487 \ skipwhite nextgroup=vimCmdSep,vim9Comment,vimCommentError
488 \ contains=@vim9MethodDefBodyList
489
490 syn cluster vim9MethodDefBodyList contains=@vimDefBodyList,vim9This,vim9Super
491
492 if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimfunctionerror")
493 syn match vim9MethodNameError contained "\<[a-z0-9]\i\>"
494 endif
Doug Kearns1aa287e2025-02-10 22:00:27 +0100495 syn match vim9MethodName contained "\<new\w*\>"
Doug Kearns818c6412024-10-06 17:00:48 +0200496 syn keyword vim9MethodName contained empty len string
497
498 syn cluster vim9MethodName contains=vim9MethodName,vim9MethodNameError
499
500 if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f'
501 syn region vim9MethodDefFold contained start="\%(^\s*\%(:\=static\s\+\)\=\)\@16<=:\=def\s\+\h\i*(" end="^\s*:\=enddef\>" contains=vim9MethodDef fold keepend extend transparent
502 syn region vim9MethodDefFold contained start="^\s*:\=def\s\+new\i*(" end="^\s*:\=enddef\>" contains=vim9MethodDef fold keepend extend transparent
503 endif
504
505 syn cluster vim9MethodDef contains=vim9MethodDef,vim9MethodDefFold
506
507 " Classes {{{3
508 syn cluster vim9ClassBodyList contains=vim9Abstract,vim9Class,vim9Comment,vim9LineComment,@vim9Continue,@vimExprList,vim9Extends,vim9Implements,@vim9MethodDef,vim9Public,vim9Static,vim9Const,vim9Final,vim9This,vim9Super,vim9Var
509
510 syn match vim9Class contained "\<class\>" skipwhite nextgroup=vim9ClassName
511 syn match vim9ClassName contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9Extends,vim9Implements
512 syn match vim9SuperClass contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9Implements
513 syn match vim9ImplementedInterface contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9InterfaceListComma,vim9Extends
514 syn match vim9InterfaceListComma contained "," skipwhite skipnl nextgroup=vim9ImplementedInterface
515 syn keyword vim9Abstract abstract skipwhite skipnl nextgroup=vim9ClassBody,vim9AbstractDef
516 syn keyword vim9Extends contained extends skipwhite skipnl nextgroup=vim9SuperClass
517 syn keyword vim9Implements contained implements skipwhite skipnl nextgroup=vim9ImplementedInterface
518 syn keyword vim9Public contained public
519 syn keyword vim9Static contained static
Doug Kearns1aa287e2025-02-10 22:00:27 +0100520 " FIXME: don't match as dictionary keys, remove when operators are not
521 " shared between Vim9 and legacy script
522 syn match vim9This contained "\.\@1<!\<this\>:\@!"
523 " super must be folowed by '.'
524 syn match vim9Super contained "\.\@1<!\<super\.\@="
Doug Kearns818c6412024-10-06 17:00:48 +0200525
526 VimFoldc syn region vim9ClassBody start="\<class\>" matchgroup=vimCommand end="\<endclass\>" contains=@vim9ClassBodyList transparent
527
528 " Enums {{{3
529 syn cluster vim9EnumBodyList contains=vim9Comment,vim9LineComment,@vim9Continue,vim9Enum,vim9Implements,@vim9MethodDef,vim9Const,vim9Final,vim9Var
530
531 syn match vim9Enum contained "\<enum\>" skipwhite nextgroup=vim9EnumName
532 syn match vim9EnumName contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9Implements
533
534 VimFolde syn region vim9EnumBody start="\<enum\>" matchgroup=vimCommand end="\<endenum\>" contains=@vim9EnumBodyList transparent
535
536 " Interfaces {{{3
537 " TODO: limit to decl only - no init values
538 syn cluster vim9InterfaceBodyList contains=vim9Comment,vim9LineComment,@vim9Continue,vim9Extends,vim9Interface,vim9AbstractDef,vim9Var
539
540 syn match vim9Interface contained "\<interface\>" skipwhite nextgroup=vim9InterfaceName
541 syn match vim9InterfaceName contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9Extends
542
543 syn keyword vim9AbstractDef contained def skipwhite nextgroup=vim9AbstractDefName
544 syn match vim9AbstractDefName contained "\<\h\w*\>" skipwhite nextgroup=vim9AbstractDefParams contains=@vim9MethodName
545 syn region vim9AbstractDefParams contained
546 \ matchgroup=Delimiter start="(" end=")"
547 \ skipwhite skipnl nextgroup=vimDefComment,vim9AbstractDefReturnType,vimCommentError
548 \ contains=vimDefParam,vim9Comment,vimFuncParamEquals
549 syn region vim9AbstractDefReturnType contained
550 \ start=":\s" end="$" matchgroup=vim9Comment end="\ze[#"]"
551 \ skipwhite skipnl nextgroup=vimDefComment,vimCommentError
552 \ contains=vimTypeSep
553 \ transparent
554
555 VimFoldi syn region vim9InterfaceBody start="\<interface\>" matchgroup=vimCommand end="\<endinterface\>" contains=@vim9InterfaceBodyList transparent
556
Doug Kearns1aa287e2025-02-10 22:00:27 +0100557 " Type Aliases {{{3
Doug Kearns818c6412024-10-06 17:00:48 +0200558 syn match vim9Type "\<ty\%[pe]\>" skipwhite nextgroup=vim9TypeAlias,vim9TypeAliasError
559 syn match vim9TypeAlias contained "\<\u\w*\>" skipwhite nextgroup=vim9TypeEquals
560 syn match vim9TypeEquals contained "=" skipwhite nextgroup=@vimType
561 if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_notypealiaserror")
Doug Kearns1aa287e2025-02-10 22:00:27 +0100562 syn match vim9TypeAliasError contained "\<\l\w*\>" skipwhite nextgroup=vim9TypeEquals
Doug Kearns818c6412024-10-06 17:00:48 +0200563 endif
564endif
565
Doug Kearns1aa287e2025-02-10 22:00:27 +0100566" Blocks: {{{2
567" ======
568Vim9 syn region vim9Block matchgroup=vimSep start="{" end="^\s*\zs}" contains=@vimDefBodyList
569
dkearns04e53632024-04-11 06:18:37 +1000570" Keymaps: {{{2
dkearns69866442023-11-22 05:43:40 +1100571" =======
572
dkearns04e53632024-04-11 06:18:37 +1000573syn match vimKeymapStart "^" contained skipwhite nextgroup=vimKeymapLhs,@vimKeymapLineComment
dkearns69866442023-11-22 05:43:40 +1100574syn match vimKeymapLhs "\S\+" contained skipwhite nextgroup=vimKeymapRhs contains=vimNotation
575syn match vimKeymapRhs "\S\+" contained skipwhite nextgroup=vimKeymapTailComment contains=vimNotation
576syn match vimKeymapTailComment "\S.*" contained
dkearns04e53632024-04-11 06:18:37 +1000577
578" TODO: remove when :" comment is matched in parts as "ex-colon comment" --djk
579if s:vim9script
580 syn match vim9KeymapLineComment "#.*" contained contains=@vimCommentGroup,vimCommentString,vim9CommentTitle
581else
582 syn match vimKeymapLineComment +".*+ contained contains=@vimCommentGroup,vimCommentString,vimCommentTitle
583endif
584syn cluster vimKeymapLineComment contains=vim9\=KeymapLineComment
dkearns69866442023-11-22 05:43:40 +1100585
Doug Kearns7866d542024-08-23 18:37:55 +0200586syn region vimLoadkeymap matchgroup=vimCommand start="\<loadk\%[eymap]\>" end="\%$" contains=vimKeymapStart
dkearns69866442023-11-22 05:43:40 +1100587
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000588" Special Filenames, Modifiers, Extension Removal: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000589" ===============================================
dkearns2c51e152024-02-27 07:10:18 +1100590syn match vimSpecFile "<c\(word\|WORD\)>" nextgroup=vimSpecFileMod,vimSubst1
591syn match vimSpecFile "<\([acs]file\|amatch\|abuf\)>" nextgroup=vimSpecFileMod,vimSubst1
592syn match vimSpecFile "\s%[ \t:]"ms=s+1,me=e-1 nextgroup=vimSpecFileMod,vimSubst1
593syn match vimSpecFile "\s%$"ms=s+1 nextgroup=vimSpecFileMod,vimSubst1
594syn match vimSpecFile "\s%<"ms=s+1,me=e-1 nextgroup=vimSpecFileMod,vimSubst1
595syn match vimSpecFile "#\d\+\|[#%]<\>" nextgroup=vimSpecFileMod,vimSubst1
Bram Moolenaar5c736222010-01-06 20:54:52 +0100596syn match vimSpecFileMod "\(:[phtre]\)\+" contained
Bram Moolenaar071d4272004-06-13 20:20:40 +0000597
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000598" User-Specified Commands: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000599" =======================
dkearns04e53632024-04-11 06:18:37 +1000600syn cluster vimUserCmdList contains=@vimCmdList,vimCmplxRepeat,@vimComment,vimCtrlChar,vimEscapeBrace,vimFunc,vimNotation,vimNumber,vimOper,vimRegister,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange
Doug Kearns3c07eb02024-09-02 10:03:37 +0200601syn keyword vimUserCmdKey contained com[mand]
602syn match vimUserCmdName contained "\<\u[[:alnum:]]*\>" skipwhite nextgroup=vimUserCmdBlock
603syn match vimUserCmd "\<com\%[mand]\>!\=.*$" contains=vimUserCmdKey,vimBang,vimUserCmdAttr,vimUserCmdAttrError,vimUserCmdName,@vimUserCmdList,vimComFilter
604syn match vimUserCmdAttrError contained "-\a\+\ze\%(\s\|=\)"
605syn match vimUserCmdAttr contained "-addr=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrAddr
606syn match vimUserCmdAttr contained "-bang\>" contains=vimUserCmdAttrKey
607syn match vimUserCmdAttr contained "-bar\>" contains=vimUserCmdAttrKey
608syn match vimUserCmdAttr contained "-buffer\>" contains=vimUserCmdAttrKey
609syn match vimUserCmdAttr contained "-complete=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrCmplt,vimUserCmdError
610syn match vimUserCmdAttr contained "-count\>" contains=vimUserCmdAttrKey
611syn match vimUserCmdAttr contained "-count=" contains=vimUserCmdAttrKey nextgroup=vimNumber
612syn match vimUserCmdAttr contained "-keepscript\>" contains=vimUserCmdAttrKey
613syn match vimUserCmdAttr contained "-nargs=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrNargs
614syn match vimUserCmdAttr contained "-range\>" contains=vimUserCmdAttrKey
615syn match vimUserCmdAttr contained "-range=" contains=vimUserCmdAttrKey nextgroup=vimNumber,vimUserCmdAttrRange
616syn match vimUserCmdAttr contained "-register\>" contains=vimUserCmdAttrKey
617
618syn match vimUserCmdAttrNargs contained "[01*?+]"
619syn match vimUserCmdAttrRange contained "%"
620
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100621if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_nousercmderror")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100622 syn match vimUserCmdError contained "\S\+\>"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000623endif
Bram Moolenaara93fa7e2006-04-17 22:14:47 +0000624
Doug Kearns3c07eb02024-09-02 10:03:37 +0200625syn case ignore
626syn keyword vimUserCmdAttrKey contained a[ddr] ban[g] bar bu[ffer] com[plete] cou[nt] k[eepscript] n[args] ra[nge] re[gister]
627" GEN_SYN_VIM: vimUserCmdAttrCmplt, START_STR='syn keyword vimUserCmdAttrCmplt contained', END_STR=''
Ruslan Russkikh0407d622024-10-08 22:21:05 +0200628syn keyword vimUserCmdAttrCmplt 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
Doug Kearns3c07eb02024-09-02 10:03:37 +0200629syn keyword vimUserCmdAttrCmplt contained custom customlist nextgroup=vimUserCmdAttrCmpltFunc,vimUserCmdError
630syn match vimUserCmdAttrCmpltFunc contained ",\%([sS]:\|<[sS][iI][dD]>\)\=\%(\h\w*\%([.#]\h\w*\)\+\|\h\w*\)"hs=s+1 nextgroup=vimUserCmdError
631" GEN_SYN_VIM: vimUserCmdAttrAddr, START_STR='syn keyword vimUserCmdAttrAddr contained', END_STR=''
632syn keyword vimUserCmdAttrAddr contained arguments arg buffers buf lines line loaded_buffers load other quickfix qf tabs tab windows win
633syn match vimUserCmdAttrAddr contained "?"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000634syn case match
Bram Moolenaar071d4272004-06-13 20:20:40 +0000635
Doug Kearns1aa287e2025-02-10 22:00:27 +0100636syn region vimUserCmdBlock contained matchgroup=vimSep start="{" end="^\s*\zs}" contains=@vimDefBodyList
dkearns04e53632024-04-11 06:18:37 +1000637
Doug Kearns3c07eb02024-09-02 10:03:37 +0200638syn match vimDelcommand "\<delc\%[ommand]\>" skipwhite nextgroup=vimDelcommandAttr
639syn match vimDelcommandAttr contained "-buffer\>"
640
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000641" Lower Priority Comments: after some vim commands... {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000642" =======================
dkearns959c3c82024-06-12 04:18:08 +1000643if get(g:, "vimsyn_comment_strings", 1)
Doug Kearns35699f12024-09-19 19:51:59 +0200644 syn region vimCommentString contained oneline start='\S\s\+"'ms=e end='"' extend
dkearns959c3c82024-06-12 04:18:08 +1000645endif
dkearns04e53632024-04-11 06:18:37 +1000646
647if s:vim9script
dkearns04e53632024-04-11 06:18:37 +1000648 syn cluster vimComment contains=vim9Comment
649else
dkearns04e53632024-04-11 06:18:37 +1000650 syn cluster vimComment contains=vimComment
651endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000652
Doug Kearns35699f12024-09-19 19:51:59 +0200653VimL syn match vimComment excludenl +\s"[^\-:.%#=*].*$+lc=1 contains=@vimCommentGroup,vimCommentString extend
654VimL syn match vimComment +\<endif\s\+".*$+lc=5 contains=@vimCommentGroup,vimCommentString extend
655VimL syn match vimComment +\<else\s\+".*$+lc=4 contains=@vimCommentGroup,vimCommentString extend
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200656" Vim9 comments - TODO: might be highlighted while they don't work
Doug Kearns35699f12024-09-19 19:51:59 +0200657Vim9 syn match vim9Comment excludenl +\s#[^{].*$+lc=1 contains=@vimCommentGroup,vimCommentString extend
658Vim9 syn match vim9Comment +\<endif\s\+#[^{].*$+lc=5 contains=@vimCommentGroup,vimCommentString extend
659Vim9 syn match vim9Comment +\<else\s\+#[^{].*$+lc=4 contains=@vimCommentGroup,vimCommentString extend
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200660" Vim9 comment inside expression
Doug Kearns35699f12024-09-19 19:51:59 +0200661Vim9 syn match vim9Comment +\s\zs#[^{].*$+ms=s+1 contains=@vimCommentGroup,vimCommentString contained extend
662Vim9 syn match vim9Comment +^\s*#[^{].*$+ contains=@vimCommentGroup,vimCommentString contained extend
663Vim9 syn match vim9Comment +^\s*#$+ contains=@vimCommentGroup,vimCommentString contained extend
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200664
Doug Kearnsfc64ac02024-06-22 11:20:36 +0200665syn match vim9CommentError contained "#.*"
666syn match vimCommentError contained +".*+
667
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000668" Environment Variables: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000669" =====================
Bram Moolenaar5c736222010-01-06 20:54:52 +0100670syn match vimEnvvar "\$\I\i*"
671syn match vimEnvvar "\${\I\i*}"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000672
Doug Kearns68ba6c22025-02-16 16:40:12 +0100673" Strings {{{2
674" =======
675
676" In-String Specials:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000677" Try to catch strings, if nothing else matches (therefore it must precede the others!)
678" vimEscapeBrace handles ["] []"] (ie. "s don't terminate string inside [])
Bram Moolenaar5c736222010-01-06 20:54:52 +0100679syn region vimEscapeBrace oneline contained transparent start="[^\\]\(\\\\\)*\[\zs\^\=\]\=" skip="\\\\\|\\\]" end="]"me=e-1
680syn match vimPatSepErr contained "\\)"
681syn match vimPatSep contained "\\|"
Bram Moolenaarb730f0c2018-11-25 03:56:26 +0100682syn region vimPatSepZone oneline contained matchgroup=vimPatSepZ start="\\%\=\ze(" skip="\\\\" end="\\)\|[^\\]['"]" contains=@vimStringGroup
Bram Moolenaar5c736222010-01-06 20:54:52 +0100683syn region vimPatRegion contained transparent matchgroup=vimPatSepR start="\\[z%]\=(" end="\\)" contains=@vimSubstList oneline
684syn match vimNotPatSep contained "\\\\"
Bram Moolenaar6ba83ba2022-06-12 22:15:57 +0100685syn cluster vimStringGroup contains=vimEscape,vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone,@Spell
Doug Kearns1aa287e2025-02-10 22:00:27 +0100686syn region vimString oneline keepend matchgroup=vimString start=+[^a-zA-Z>\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ nextgroup=vimSubscript contains=@vimStringGroup extend
687syn region vimString oneline matchgroup=vimString start=+[^a-zA-Z>\\@]'+lc=1 end=+'+ nextgroup=vimSubscript contains=vimQuoteEscape extend
Bram Moolenaaracc22402020-06-07 21:07:18 +0200688"syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup " see tst45.vim
Doug Kearns695522d2025-01-10 20:02:17 +0100689
Bram Moolenaar6ba83ba2022-06-12 22:15:57 +0100690syn match vimEscape contained "\\."
dkearnse3e39342024-02-02 07:44:26 +1100691" syn match vimEscape contained +\\[befnrt\"]+
692syn match vimEscape contained "\\\o\{1,3}\|\\[xX]\x\{1,2}\|\\u\x\{1,4}\|\\U\x\{1,8}"
693syn match vimEscape contained "\\<" contains=vimNotation
694syn match vimEscape contained "\\<\*[^>]*>\=>"
Doug Kearns695522d2025-01-10 20:02:17 +0100695syn match vimQuoteEscape contained "''"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000696
Doug Kearns1aa287e2025-02-10 22:00:27 +0100697syn region vimString oneline matchgroup=vimString start=+$'+ skip=+''+ end=+'+ nextgroup=vimSubscript contains=vimQuoteEscape,@vimStringInterpolation extend
698syn region vimString oneline matchgroup=vimString start=+$"+ end=+"+ nextgroup=vimSubscript contains=@vimStringGroup,@vimStringInterpolation extend
dkearnsb1427b42024-02-28 05:59:30 +1100699syn region vimStringInterpolationExpr oneline contained matchgroup=vimSep start=+{+ end=+}+ contains=@vimExprList
700syn match vimStringInterpolationBrace contained "{{"
701syn match vimStringInterpolationBrace contained "}}"
Doug Kearnsd164f2a2024-08-16 21:07:15 +0200702syn cluster vimStringInterpolation contains=vimStringInterpolationExpr,vimStringInterpolationBrace
thincacf8695d2024-01-28 18:57:23 +0100703
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000704" Substitutions: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000705" =============
Bram Moolenaar5c736222010-01-06 20:54:52 +0100706syn cluster vimSubstList contains=vimPatSep,vimPatRegion,vimPatSepErr,vimSubstTwoBS,vimSubstRange,vimNotation
707syn cluster vimSubstRepList contains=vimSubstSubstr,vimSubstTwoBS,vimNotation
708syn cluster vimSubstList add=vimCollection
Doug Kearns92f4e912024-06-05 19:45:43 +0200709syn match vimSubst "^\s*\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)\>" skipwhite nextgroup=vimSubstPat
710syn match vimSubst "^\s*\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)[_#]\@=" skipwhite nextgroup=vimSubstPat
711syn match vimSubst1 contained "\%(s\%[ubstitute]\|sm\%[agic]\>\|sno\%[magic]\)\>" skipwhite nextgroup=vimSubstPat
712syn match vimSubst1 contained "\%(s\%[ubstitute]\|sm\%[agic]\>\|sno\%[magic]\)[_#]\@=" skipwhite nextgroup=vimSubstPat
dkearns2c51e152024-02-27 07:10:18 +1100713" TODO: Vim9 illegal separators for abbreviated :s form are [-.:], :su\%[...] required
714" : # is allowed but "not recommended" (see :h pattern-delimiter)
715syn 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
716syn region vimSubstRep4 contained matchgroup=vimSubstDelim start="\z(.\)" skip="\\\\\|\\\z1" end="\z1" matchgroup=vimNotation end="<[cC][rR]>" contains=@vimSubstRepList nextgroup=vimSubstFlagErr oneline
717syn region vimCollection contained transparent start="\\\@<!\[" skip="\\\[" end="\]" contains=vimCollClass
718syn match vimCollClassErr contained "\[:.\{-\}:\]"
719syn match vimCollClass contained transparent "\%#=1\[:\(alnum\|alpha\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|xdigit\|retu\%[rn]\|tab\|escape\|backspace\):\]"
720syn match vimSubstSubstr contained "\\z\=\d"
721syn match vimSubstTwoBS contained "\\\\"
722syn match vimSubstFlagErr contained "[^< \t\r|]\+" contains=vimSubstFlags
723syn match vimSubstFlags contained "[&cegiIlnpr#]\+"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000724
Doug Kearns92f4e912024-06-05 19:45:43 +0200725" Vi compatibility
726syn match vimSubstDelim contained "\\"
727syn match vimSubstPat contained "\\\ze[/?&]" contains=vimSubstDelim nextgroup=vimSubstRep4
728
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000729" Marks, Registers, Addresses, Filters: {{{2
dkearns2c51e152024-02-27 07:10:18 +1100730syn match vimMark "'[a-zA-Z0-9]\ze[-+,!]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
Doug Kearnsd8176092024-08-31 16:57:32 +0200731syn match vimMark "'[[\]{}()<>]\ze[-+,!]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
732syn match vimMark ",\zs'[[\]{}()<>]\ze" nextgroup=vimFilter,vimMarkNumber,vimSubst1
dkearns2c51e152024-02-27 07:10:18 +1100733syn match vimMark "[!,:]\zs'[a-zA-Z0-9]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
734syn match vimMark "\<norm\%[al]\s\zs'[a-zA-Z0-9]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
735syn match vimMarkNumber "[-+]\d\+" contained contains=vimOper nextgroup=vimSubst1
Bram Moolenaar5c736222010-01-06 20:54:52 +0100736syn match vimPlainMark contained "'[a-zA-Z0-9]"
Bram Moolenaar6c1e1572019-06-22 02:13:00 +0200737syn match vimRange "[`'][a-zA-Z0-9],[`'][a-zA-Z0-9]" contains=vimMark skipwhite nextgroup=vimFilter
Bram Moolenaar071d4272004-06-13 20:20:40 +0000738
Bram Moolenaarb4ff5182015-11-10 21:15:48 +0100739syn match vimRegister '[^,;[{: \t]\zs"[a-zA-Z0-9.%#:_\-/]\ze[^a-zA-Z_":0-9]'
Bram Moolenaar5c736222010-01-06 20:54:52 +0100740syn match vimRegister '\<norm\s\+\zs"[a-zA-Z0-9]'
741syn match vimRegister '\<normal\s\+\zs"[a-zA-Z0-9]'
742syn match vimRegister '@"'
743syn match vimPlainRegister contained '"[a-zA-Z0-9\-:.%#*+=]'
Doug Kearnsa9c06422025-02-12 20:44:17 +0100744syn match vimLetRegister contained '@["0-9\-a-zA-Z:.%#=*+~_/]'
Bram Moolenaar071d4272004-06-13 20:20:40 +0000745
Bram Moolenaar5c736222010-01-06 20:54:52 +0100746syn match vimAddress ",\zs[.$]" skipwhite nextgroup=vimSubst1
747syn match vimAddress "%\ze\a" skipwhite nextgroup=vimString,vimSubst1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000748
Bram Moolenaar6c1e1572019-06-22 02:13:00 +0200749syn match vimFilter "^!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile
Bram Moolenaard58a3bf2020-09-28 21:48:16 +0200750syn match vimFilter contained "!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile
751syn match vimComFilter contained "|!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile
Bram Moolenaar071d4272004-06-13 20:20:40 +0000752
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100753" Complex Repeats: (:h complex-repeat) {{{2
754" ===============
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100755syn match vimCmplxRepeat '[^a-zA-Z_/\\()]q[0-9a-zA-Z"]\>'lc=1
756syn match vimCmplxRepeat '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\>\)'
Bram Moolenaar071d4272004-06-13 20:20:40 +0000757
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000758" Set command and associated set-options (vimOptions) with comment {{{2
Doug Kearnsddbb6fe2024-07-24 20:21:22 +0200759syn match vimSet "\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skipwhite nextgroup=vimSetBang,vimSetRegion
760syn region vimSetRegion contained start="\S" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*["#]\\ + matchgroup=vimCmdSep end="|" end="$" matchgroup=vimNotation end="<[cC][rR]>" keepend contains=@vimComment,@vimContinue,vimErrSetting,vimOption,vimSetAll,vimSetTermcap
761syn region vimSetEqual contained matchgroup=vimOper start="[=:]\|[-+^]=" skip=+\\\\\|\\|\|\\\s\|\n\s*\\\|\n\s*["#]\\ \|^\s*\\\|^\s*["#]\\ + matchgroup=vimCmdSep end="|" end="\ze\s" end="$" contains=@vimContinue,vimCtrlChar,vimEnvvar,vimNotation,vimSetSep
762syn match vimSetBang contained "\a\@1<=!" skipwhite nextgroup=vimSetAll,vimSetTermcap
763syn keyword vimSetAll contained all nextgroup=vimSetMod
764syn keyword vimSetTermcap contained termcap
765syn region vimSetString contained start=+="+hs=s+1 skip=+\\\\\|\\"+ end=+"+ contains=vimCtrlChar
Bram Moolenaar4072ba52020-12-23 13:56:35 +0100766syn match vimSetSep contained "[,:]"
Doug Kearnsddbb6fe2024-07-24 20:21:22 +0200767syn match vimSetMod contained "\a\@1<=\%(&vim\=\|[!&?<]\)"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000768
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200769" Variable Declarations: {{{2
770" =====================
Doug Kearns1aa287e2025-02-10 22:00:27 +0100771VimL syn keyword vimLet let skipwhite nextgroup=@vimSpecialVar,vimVar,vimVarList
772VimL syn keyword vimConst cons[t] skipwhite nextgroup=@vimSpecialVar,vimVar,vimVarList
773syn region vimVarList contained
774 \ start="\[" end="]"
775 \ contains=@vimContinue,@vimSpecialVar,vimVar
dkearnsf6869212023-12-11 01:53:24 +1100776
Doug Kearns1aa287e2025-02-10 22:00:27 +0100777VimL syn keyword vimUnlet unl[et] skipwhite nextgroup=vimUnletBang,vimUnletVars
778syn match vimUnletBang contained "\a\@1<=!" skipwhite nextgroup=vimUnletVars
779syn region vimUnletVars contained
780 \ start="$\I\|\h" skip=+\n\s*\\\|\n\s*"\\ \|^\s*"\\ + end="$" end="\ze[|"]"
781 \ nextgroup=vimCmdSep,vimComment
782 \ contains=@vimContinue,vimEnvvar,vimVar
dkearnsf6869212023-12-11 01:53:24 +1100783
Doug Kearns7884cc72024-08-23 18:01:35 +0200784VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='\%(^\z(\s*\)\S.*\)\@<==<<\s*trim\%(\s\+\)\@>\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\z1\=\z2$' extend
Ken Takata95e90782024-08-22 21:29:39 +0200785VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='=<<\%(\s*\)\@>\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\z1$' extend
Doug Kearns7884cc72024-08-23 18:01:35 +0200786VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='\%(^\z(\s*\)\S.*\)\@<==<<\s*\%(trim\s\+eval\|eval\s\+trim\)\%(\s\+\)\@>\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\z1\=\z2$' contains=@vimStringInterpolation extend
Ken Takata95e90782024-08-22 21:29:39 +0200787VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='=<<\s*eval\%(\s\+\)\@>\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\z1$' contains=@vimStringInterpolation extend
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200788
789Vim9 syn keyword vim9Const const skipwhite nextgroup=vim9Variable,vim9VariableList
790Vim9 syn keyword vim9Final final skipwhite nextgroup=vim9Variable,vim9VariableList
791Vim9 syn keyword vim9Var var skipwhite nextgroup=vim9Variable,vim9VariableList
792
Doug Kearns818c6412024-10-06 17:00:48 +0200793syn match vim9Variable contained "\<\h\w*\>" skipwhite nextgroup=vimTypeSep,vimLetHereDoc,vimOper
Doug Kearns1aa287e2025-02-10 22:00:27 +0100794syn region vim9VariableList contained start="\[" end="]" contains=@vimContinue,@vimSpecialVar,vim9Variable
795
796" Lockvar and Unlockvar: {{{2
797" =====================
798syn keyword vimLockvar lockv[ar] skipwhite nextgroup=vimLockvarBang,vimLockvarDepth,vimLockvarVars
799syn keyword vimUnlockvar unlo[ckvar] skipwhite nextgroup=vimLockvarBang,vimLockvarDepth,vimLockvarVars
800syn match vimLockvarBang contained "\a\@1<=!" skipwhite nextgroup=vimLockvarVars
801syn match vimLockvarDepth contained "\<[0-3]\>" skipwhite nextgroup=vimLockvarVars
802syn region vimLockvarVars contained
803 \ start="\h" skip=+\n\s*\\\|\n\s*"\\ \|^\s*"\\ + end="$" end="\ze[|"]"
804 \ nextgroup=vimCmdSep,vimComment
805 \ contains=@vimContinue,vimVar
806
807hi def link vimLockvar vimCommand
808hi def link vimUnlockvar vimCommand
809hi def link vimLockvarBang vimBang
810hi def link vimLockvarDepth vimNumber
Bram Moolenaar071d4272004-06-13 20:20:40 +0000811
dkearnsf6869212023-12-11 01:53:24 +1100812" For: {{{2
813" ===
Doug Kearns1aa287e2025-02-10 22:00:27 +0100814" handles Vim9 and legacy for now
815syn region vimFor
816 \ matchgroup=vimCommand
817 \ start="\<for\>" end="\<in\>"
818 \ skipwhite skipnl nextgroup=@vimForInContinue,vim9ForInComment,@vimExprList
819 \ contains=@vimContinue,vimVar,vimVarList,vim9VariableList
820 \ transparent
821
822syn match vim9ForInComment contained "#.*" skipwhite skipempty nextgroup=vimForInComment,@vimExprList
823
824syn match vimForInContinue contained "^\s*\zs\\" skipwhite skipnl nextgroup=@vimForInContinue,@vimExprList
825syn match vimForInContinueComment contained '^\s*\zs["#]\\ .*' skipwhite skipnl nextgroup=@vimForInContinue,@vimExprList
826syn cluster vimForInContinue contains=vimForInContinue,vimForInContinueComment
dkearns76d62982024-03-23 05:55:25 +1100827
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100828" Abbreviations: {{{2
Bram Moolenaare37d50a2008-08-06 17:06:04 +0000829" =============
h-east9b53c052024-02-13 21:09:22 +0100830" GEN_SYN_VIM: vimCommand abbrev, START_STR='syn keyword vimAbb', END_STR='skipwhite nextgroup=vimMapMod,vimMapLhs'
dkearns16249702024-02-23 05:45:05 +1100831syn 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 +1100832" GEN_SYN_VIM: vimCommand abclear, START_STR='syn keyword vimAbb', END_STR='skipwhite nextgroup=vimMapMod'
833syn keyword vimAbb abc[lear] cabc[lear] iabc[lear] skipwhite nextgroup=vimMapMod
Bram Moolenaare37d50a2008-08-06 17:06:04 +0000834
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100835" Autocmd: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000836" =======
Doug Kearns1718e7d2025-01-08 18:20:47 +0100837syn match vimAutoCmdBang contained "\a\@1<=!" skipwhite nextgroup=vimAutoEventList
838syn match vimAutoEventList contained "\%(\a\+,\)*\a\+" contains=vimAutoEvent nextgroup=vimAutoCmdSpace
Bram Moolenaar5c736222010-01-06 20:54:52 +0100839syn match vimAutoCmdSpace contained "\s\+" nextgroup=vimAutoCmdSfxList
dkearns04e53632024-04-11 06:18:37 +1000840syn match vimAutoCmdSfxList contained "\S*" skipwhite nextgroup=vimAutoCmdMod,vimAutoCmdBlock
Doug Kearns1718e7d2025-01-08 18:20:47 +0100841syn keyword vimAutoCmd au[tocmd] skipwhite nextgroup=vimAutoCmdBang,vimAutoEventList
842syn keyword vimAutoCmd do[autocmd] doautoa[ll] skipwhite nextgroup=vimAutoEventList
dkearns04e53632024-04-11 06:18:37 +1000843syn match vimAutoCmdMod "\(++\)\=\(once\|nested\)" skipwhite nextgroup=vimAutoCmdBlock
Doug Kearns1aa287e2025-02-10 22:00:27 +0100844syn region vimAutoCmdBlock contained matchgroup=vimSep start="{" end="^\s*\zs}" contains=@vimDefBodyList
Bram Moolenaar071d4272004-06-13 20:20:40 +0000845
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100846" Echo And Execute: -- prefer strings! {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000847" ================
dkearns61887b32024-03-15 23:45:48 +1100848" NOTE: No trailing comments
dkearnsb1427b42024-02-28 05:59:30 +1100849
dkearns61887b32024-03-15 23:45:48 +1100850syn region vimEcho
851 \ matchgroup=vimCommand
852 \ start="\<ec\%[ho]\>"
853 \ start="\<echoe\%[rr]\>"
854 \ start="\<echom\%[sg]\>"
855 \ start="\<echoc\%[onsole]\>"
856 \ start="\<echon\>"
857 \ start="\<echow\%[indow]\>"
858 \ skip=+\\|\|\n\s*\\\|\n\s*"\\ +
859 \ matchgroup=vimCmdSep end="|" excludenl end="$" contains=@vimContinue,@vimExprList transparent
860
861syn match vimEchohl "\<echohl\=\>" skipwhite nextgroup=vimGroup,vimHLGroup,vimEchohlNone
Bram Moolenaar071d4272004-06-13 20:20:40 +0000862syn case ignore
dkearns61887b32024-03-15 23:45:48 +1100863syn keyword vimEchohlNone contained none
Bram Moolenaar071d4272004-06-13 20:20:40 +0000864syn case match
865
dkearns35e6f4c2024-03-22 06:41:10 +1100866syn cluster vimEcho contains=vimEcho,vimEchohl
dkearns61887b32024-03-15 23:45:48 +1100867
868syn 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 +1100869
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100870" Maps: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000871" ====
Doug Kearns99984fc2024-07-18 20:45:19 +0200872" GEN_SYN_VIM: vimCommand map, START_STR='syn keyword vimMap', END_STR='skipwhite nextgroup=vimMapMod,vimMapLhs'
873syn 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
874syn match vimMap "\<map\>" skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
875syn keyword vimMap no[remap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
dkearns16249702024-02-23 05:45:05 +1100876" GEN_SYN_VIM: vimCommand mapclear, START_STR='syn keyword vimMap', END_STR='skipwhite nextgroup=vimMapMod'
877syn 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 +0200878syn keyword vimMap mapc[lear] skipwhite nextgroup=vimMapBang,vimMapMod
879" GEN_SYN_VIM: vimCommand unmap, START_STR='syn keyword vimUnmap', END_STR='skipwhite nextgroup=vimMapMod,vimMapLhs'
880syn keyword vimUnmap cu[nmap] iu[nmap] lu[nmap] nun[map] ou[nmap] sunm[ap] tunma[p] vu[nmap] xu[nmap] skipwhite nextgroup=vimMapMod,vimMapLhs
881syn keyword vimUnmap unm[ap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
882
dkearns5d67aef2024-03-10 04:01:22 +1100883syn match vimMapLhs contained "\%(.\|\S\)\+" contains=vimCtrlChar,vimNotation skipwhite nextgroup=vimMapRhs
884syn match vimMapLhs contained "\%(.\|\S\)\+\ze\s*$" contains=vimCtrlChar,vimNotation skipwhite skipnl nextgroup=vimMapRhsContinue
885syn match vimMapBang contained "\a\@1<=!" skipwhite nextgroup=vimMapMod,vimMapLhs
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200886syn match vimMapMod contained "\%#=1\c<\(buffer\|expr\|\(local\)\=leader\|nowait\|plug\|script\|sid\|unique\|silent\)\+>" contains=vimMapModKey,vimMapModErr skipwhite nextgroup=vimMapMod,vimMapLhs
dkearns5d67aef2024-03-10 04:01:22 +1100887syn region vimMapRhs contained start="\S" skip=+\\|\|\@1<=|\|\n\s*\\\|\n\s*"\\ + end="|" end="$" contains=@vimContinue,vimCtrlChar,vimNotation skipnl nextgroup=vimMapRhsContinue
888" assume a continuation comment introduces the RHS
889syn region vimMapRhsContinue contained start=+^\s*\%(\\\|"\\ \)+ skip=+\\|\|\@1<=|\|\n\s*\\\|\n\s*"\\ + end="|" end="$" contains=@vimContinue,vimCtrlChar,vimNotation
Bram Moolenaar071d4272004-06-13 20:20:40 +0000890syn case ignore
Bram Moolenaarb4ff5182015-11-10 21:15:48 +0100891syn keyword vimMapModKey contained buffer expr leader localleader nowait plug script sid silent unique
Bram Moolenaar071d4272004-06-13 20:20:40 +0000892syn case match
893
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100894" Menus: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000895" =====
dkearns62b26042024-03-10 03:43:28 +1100896" NOTE: tail comments disallowed
897" GEN_SYN_VIM: vimCommand menu, START_STR='syn keyword vimMenu', END_STR='skipwhite nextgroup=vimMenuBang,vimMenuMod,vimMenuName,vimMenuPriority,vimMenuStatus'
898syn 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
899syn keyword vimMenu popu[p] skipwhite nextgroup=vimMenuBang,vimMenuName
900syn region vimMenuRhs contained contains=@vimContinue,vimNotation start="|\@!\S" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + end="$" matchgroup=vimSep end="|"
901syn region vimMenuRhsContinue contained contains=@vimContinue,vimNotation start=+^\s*\%(\\\|"\\ \)+ skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + end="$" matchgroup=vimSep end="|"
dkearnsec21baf2024-03-20 04:04:42 +1100902syn match vimMenuName "\.\@!\%(\\\s\|\S\)\+" contained contains=vimMenuNotation,vimNotation skipwhite nextgroup=vimCmdSep,vimMenuRhs
903syn match vimMenuName "\.\@!\%(\\\s\|\S\)\+\ze\s*$" contained contains=vimMenuNotation,vimNotation skipwhite skipnl nextgroup=vimCmdSep,vimMenuRhsContinue
dkearns62b26042024-03-10 03:43:28 +1100904syn match vimMenuNotation "&\a\|&&\|\\\s\|\\\." contained
905syn match vimMenuPriority "\<\d\+\%(\.\d\+\)*\>" contained skipwhite nextgroup=vimMenuName
906syn match vimMenuMod "\c<\%(script\|silent\|special\)>" contained skipwhite nextgroup=vimMenuName,vimMenuPriority,vimMenuMod contains=vimMapModKey,vimMapModErr
907syn keyword vimMenuStatus enable disable nextgroup=vimMenuName skipwhite
908syn match vimMenuBang "\a\@1<=!" contained skipwhite nextgroup=vimMenuName,vimMenuMod
909
910syn region vimMenutranslate
911 \ matchgroup=vimCommand start="\<menut\%[ranslate]\>"
912 \ skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ +
913 \ end="$" matchgroup=vimCmdSep end="|" matchgroup=vimMenuClear end="\<clear\ze\s*\%(["#|]\|$\)"
914 \ contains=@vimContinue,vimMenutranslateName keepend transparent
915" oneline is sufficient to match the current formatting in runtime/lang/*.vim
916syn match vimMenutranslateName "\%(\\\s\|\S\)\+" contained contains=vimMenuNotation,vimNotation
917syn match vimMenutranslateComment +".*+ contained containedin=vimMenutranslate
Bram Moolenaar071d4272004-06-13 20:20:40 +0000918
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100919" Angle-Bracket Notation: (tnx to Michael Geddes) {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000920" ======================
921syn case ignore
Doug Kearns68ba6c22025-02-16 16:40:12 +0100922syn 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 +1100923
Doug Kearns68ba6c22025-02-16 16:40:12 +0100924syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}\%(net\|dec\|jsb\|pterm\|urxvt\|sgr\)mouse>" contains=vimBracket
925syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}\%(left\|middle\|right\)\%(mouse\|drag\|release\)>" contains=vimBracket
926syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}left\%(mouse\|release\)nm>" contains=vimBracket
927syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}x[12]\%(mouse\|drag\|release\)>" contains=vimBracket
928syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}sgrmouserelease>" contains=vimBracket
929syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}mouse\%(up\|down\|move\)>" contains=vimBracket
930syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}scrollwheel\%(up\|down\|right\|left\)>" contains=vimBracket
dkearnse3e39342024-02-02 07:44:26 +1100931
Doug Kearns68ba6c22025-02-16 16:40:12 +0100932syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%(sid\|nop\|nul\|lt\|drop\)>" contains=vimBracket
933syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%(snr\|plug\|cursorhold\|ignore\|cmd\|scriptcmd\|focus\%(gained\|lost\)\)>" contains=vimBracket
934syn match vimNotation contained '\%(\\\|<lt>\)\=<C-R>[0-9a-z"%#:.\-=]'he=e-1 contains=vimBracket
935syn match vimNotation contained '\%#=1\%(\\\|<lt>\)\=<\%(q-\)\=\%(line[12]\|count\|bang\|reg\|args\|mods\|f-args\|f-mods\|lt\)>' contains=vimBracket
936syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([cas]file\|abuf\|amatch\|cexpr\|cword\|cWORD\|client\|stack\|script\|sf\=lnum\)>" contains=vimBracket
937syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd]-\)\{0,4}char-\%(\d\+\|0\o\+\|0x\x\+\)>" contains=vimBracket
dkearnse3e39342024-02-02 07:44:26 +1100938
Bram Moolenaar5c736222010-01-06 20:54:52 +0100939syn match vimBracket contained "[\\<>]"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000940syn case match
941
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100942" User Function Highlighting: {{{2
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000943" (following Gautam Iyer's suggestion)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000944" ==========================
Doug Kearns1aa287e2025-02-10 22:00:27 +0100945syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" skipwhite nextgroup=vimOperParen contains=vimFuncEcho,vimFuncName,vimUserFunc,vimExecute
946syn 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 +1100947syn keyword vimFuncEcho contained ec ech echo
948
Doug Kearns99984fc2024-07-18 20:45:19 +0200949syn match vimMap "\<map\%(\s\+(\)\@=" skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
950
Bram Moolenaar2547aa92020-07-26 17:00:44 +0200951" User Command Highlighting: {{{2
Bram Moolenaard2ea7cf2021-05-30 20:54:13 +0200952syn match vimUsrCmd '^\s*\zs\u\%(\w*\)\@>\%([(#[]\|\s\+\%([-+*/%]\=\|\.\.\)=\)\@!'
Bram Moolenaar2547aa92020-07-26 17:00:44 +0200953
Doug Kearns025dc482025-02-23 15:48:52 +0100954" Vim user commands
955
956" Compiler plugins
957syn match vimCompilerSet "\<CompilerSet\>" skipwhite nextgroup=vimSetRegion
958
959" runtime/makemenu.vim
960syn match vimSynMenu "\<SynMenu\>" skipwhite nextgroup=vimSynMenuPath
961syn match vimSynMenuPath contained ".*\ze:" nextgroup=vimSynMenuColon contains=vimMenuNotation
962syn match vimSynMenuColon contained ":" nextgroup=vimSynMenuName
963syn match vimSynMenuName contained "\w\+"
964
965syn cluster vimExUserCmdList contains=vimCompilerSet,vimSynMenu
966
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000967" Errors And Warnings: {{{2
968" ====================
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100969if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimfunctionerror")
Doug Kearns818c6412024-10-06 17:00:48 +0200970 syn match vimFunctionError "\s\zs[a-z0-9]\i\{-}\ze\s*(" contained contains=vimFuncKey,vimFuncBlank
Bram Moolenaar6c1e1572019-06-22 02:13:00 +0200971 syn match vimFunctionError "\s\zs\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\d\i\{-}\ze\s*(" contained contains=vimFuncKey,vimFuncBlank
Bram Moolenaar5c736222010-01-06 20:54:52 +0100972 syn match vimElseIfErr "\<else\s\+if\>"
973 syn match vimBufnrWarn /\<bufnr\s*(\s*["']\.['"]\s*)/
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000974endif
975
Doug Kearns68ba6c22025-02-16 16:40:12 +0100976syn match vimNotFunc "\%#=1\<\%(if\|el\%[seif]\|retu\%[rn]\|while\)\>" skipwhite nextgroup=@vimExprList,vimNotation
Bram Moolenaar6c1e1572019-06-22 02:13:00 +0200977
Doug Kearnse85fdc72024-07-07 20:45:37 +0200978" Match: {{{2
979" =====
980syn match vimMatch "\<[23]\=mat\%[ch]\>" skipwhite nextgroup=vimMatchGroup,vimMatchNone
981syn match vimMatchGroup contained "[[:alnum:]._-]\+" skipwhite nextgroup=vimMatchPattern
982syn case ignore
983syn keyword vimMatchNone contained none
984syn case match
985syn region vimMatchPattern contained matchgroup=Delimiter start="\z([!#$%&'()*+,-./:;<=>?@[\]^_`{}~]\)" skip="\\\\\|\\\z1" end="\z1" contains=@vimSubstList oneline
986
Doug Kearnsbbe52522024-11-09 19:11:25 +0100987" Normal: {{{2
988" ======
989syn match vimNormal "\<norm\%[al]\>!\=" skipwhite nextgroup=vimNormalArg contains=vimBang
990syn region vimNormalArg contained start="\S" skip=+\n\s*\\\|\n\s*["#]\\ + end="$" contains=@vimContinue
Bram Moolenaar05159a02005-02-26 23:04:13 +0000991
Doug Kearns262e25e2024-06-14 20:16:35 +0200992" Sleep: {{{2
993" =====
994syn keyword vimSleep sl[eep] skipwhite nextgroup=vimSleepBang,vimSleepArg
995syn match vimSleepBang contained "\a\@1<=!" skipwhite nextgroup=vimSleepArg
996syn match vimSleepArg contained "\<\%(\d\+\)\=m\=\>"
997
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100998" Syntax: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000999"=======
dkearns21ce1592024-01-29 04:54:08 +11001000syn match vimGroupList contained "[^[:space:],]\+\%(\s*,\s*[^[:space:],]\+\)*" contains=vimGroupSpecial
1001syn 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
1002syn keyword vimGroupSpecial contained ALL ALLBUT CONTAINED TOP
1003
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001004if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsynerror")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001005 syn match vimSynError contained "\i\+"
1006 syn match vimSynError contained "\i\+=" nextgroup=vimGroupList
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001007endif
dkearns21ce1592024-01-29 04:54:08 +11001008syn match vimSynContains contained "\<contain\%(s\|edin\)=" skipwhite skipnl nextgroup=vimGroupList
1009syn match vimSynKeyContainedin contained "\<containedin=" skipwhite skipnl nextgroup=vimGroupList
1010syn match vimSynNextgroup contained "\<nextgroup=" skipwhite skipnl nextgroup=vimGroupList
dkearnsc79646d2024-01-05 08:58:48 +11001011if has("conceal")
dkearns21ce1592024-01-29 04:54:08 +11001012 " no whitespace allowed after '='
dkearnsc79646d2024-01-05 08:58:48 +11001013 syn match vimSynCchar contained "\<cchar=" nextgroup=vimSynCcharValue
1014 syn match vimSynCcharValue contained "\S"
1015endif
1016
dkearns04e53632024-04-11 06:18:37 +10001017syn match vimSyntax "\<sy\%[ntax]\>" contains=vimCommand skipwhite nextgroup=vimSynType,@vimComment
Bram Moolenaard960d762011-09-21 19:22:10 +02001018syn cluster vimFuncBodyList add=vimSyntax
Bram Moolenaar071d4272004-06-13 20:20:40 +00001019
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001020" Syntax: case {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +01001021syn keyword vimSynType contained case skipwhite nextgroup=vimSynCase,vimSynCaseError
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001022if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsyncaseerror")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001023 syn match vimSynCaseError contained "\i\+"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001024endif
Bram Moolenaar5c736222010-01-06 20:54:52 +01001025syn keyword vimSynCase contained ignore match
Bram Moolenaar071d4272004-06-13 20:20:40 +00001026
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001027" Syntax: clear {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +01001028syn keyword vimSynType contained clear skipwhite nextgroup=vimGroupList
Bram Moolenaar071d4272004-06-13 20:20:40 +00001029
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001030" Syntax: cluster {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +01001031syn keyword vimSynType contained cluster skipwhite nextgroup=vimClusterName
dkearns21ce1592024-01-29 04:54:08 +11001032syn region vimClusterName contained keepend matchgroup=vimGroupName start="\h\w*\>" skip=+\\\\\|\\\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="$\||" contains=@vimContinue,vimGroupAdd,vimGroupRem,vimSynContains,vimSynError
1033syn match vimGroupAdd contained keepend "\<add=" skipwhite skipnl nextgroup=vimGroupList
1034syn match vimGroupRem contained keepend "\<remove=" skipwhite skipnl nextgroup=vimGroupList
Bram Moolenaar071d4272004-06-13 20:20:40 +00001035
Brad Kingd4634a22024-01-03 10:17:24 -05001036" Syntax: foldlevel {{{2
1037syn keyword vimSynType contained foldlevel skipwhite nextgroup=vimSynFoldMethod,vimSynFoldMethodError
1038if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsynfoldmethoderror")
1039 syn match vimSynFoldMethodError contained "\i\+"
1040endif
1041syn keyword vimSynFoldMethod contained start minimum
1042
Bram Moolenaar13d5aee2016-01-21 23:36:05 +01001043" Syntax: iskeyword {{{2
1044syn keyword vimSynType contained iskeyword skipwhite nextgroup=vimIskList
1045syn match vimIskList contained '\S\+' contains=vimIskSep
1046syn match vimIskSep contained ','
1047
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001048" Syntax: include {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +01001049syn keyword vimSynType contained include skipwhite nextgroup=vimGroupList
Bram Moolenaar071d4272004-06-13 20:20:40 +00001050
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001051" Syntax: keyword {{{2
dkearns21ce1592024-01-29 04:54:08 +11001052syn cluster vimSynKeyGroup contains=@vimContinue,vimSynCchar,vimSynNextgroup,vimSynKeyOpt,vimSynKeyContainedin
Bram Moolenaar5c736222010-01-06 20:54:52 +01001053syn keyword vimSynType contained keyword skipwhite nextgroup=vimSynKeyRegion
dkearns21ce1592024-01-29 04:54:08 +11001054syn region vimSynKeyRegion contained keepend matchgroup=vimGroupName start="\h\w*\>" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|\|$" contains=@vimSynKeyGroup
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001055syn match vimSynKeyOpt contained "\%#=1\<\(conceal\|contained\|transparent\|skipempty\|skipwhite\|skipnl\)\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001056
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001057" Syntax: match {{{2
dkearns21ce1592024-01-29 04:54:08 +11001058syn cluster vimSynMtchGroup contains=@vimContinue,vimSynCchar,vimSynContains,vimSynError,vimSynMtchOpt,vimSynNextgroup,vimSynRegPat,vimNotation,vimMtchComment
Bram Moolenaar5c736222010-01-06 20:54:52 +01001059syn keyword vimSynType contained match skipwhite nextgroup=vimSynMatchRegion
dkearns21ce1592024-01-29 04:54:08 +11001060syn region vimSynMatchRegion contained keepend matchgroup=vimGroupName start="\h\w*\>" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|\|$" contains=@vimSynMtchGroup
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001061syn match vimSynMtchOpt contained "\%#=1\<\(conceal\|transparent\|contained\|excludenl\|keepend\|skipempty\|skipwhite\|display\|extend\|skipnl\|fold\)\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001062
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001063" Syntax: off and on {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +01001064syn keyword vimSynType contained enable list manual off on reset
Bram Moolenaar071d4272004-06-13 20:20:40 +00001065
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001066" Syntax: region {{{2
dkearns21ce1592024-01-29 04:54:08 +11001067syn cluster vimSynRegPatGroup contains=@vimContinue,vimPatSep,vimNotPatSep,vimSynPatRange,vimSynNotPatRange,vimSubstSubstr,vimPatRegion,vimPatSepErr,vimNotation
1068syn cluster vimSynRegGroup contains=@vimContinue,vimSynCchar,vimSynContains,vimSynNextgroup,vimSynRegOpt,vimSynReg,vimSynMtchGrp
Bram Moolenaar5c736222010-01-06 20:54:52 +01001069syn keyword vimSynType contained region skipwhite nextgroup=vimSynRegion
dkearns21ce1592024-01-29 04:54:08 +11001070syn region vimSynRegion contained keepend matchgroup=vimGroupName start="\h\w*" skip=+\\\\\|\\\|\n\s*\\\|\n\s*"\\ + end="|\|$" contains=@vimSynRegGroup
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001071syn match vimSynRegOpt contained "\%#=1\<\(conceal\(ends\)\=\|transparent\|contained\|excludenl\|skipempty\|skipwhite\|display\|keepend\|oneline\|extend\|skipnl\|fold\)\>"
dkearns21ce1592024-01-29 04:54:08 +11001072syn match vimSynReg contained "\<\%(start\|skip\|end\)=" nextgroup=vimSynRegPat
Bram Moolenaar5c736222010-01-06 20:54:52 +01001073syn match vimSynMtchGrp contained "matchgroup=" nextgroup=vimGroup,vimHLGroup
dkearns21ce1592024-01-29 04:54:08 +11001074syn region vimSynRegPat contained extend start="\z([-`~!@#$%^&*_=+;:'",./?]\)" skip=/\\\\\|\\\z1\|\n\s*\\\|\n\s*"\\ / end="\z1" contains=@vimSynRegPatGroup skipwhite nextgroup=vimSynPatMod,vimSynReg
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001075syn match vimSynPatMod contained "\%#=1\(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\([-+]\d\+\)\="
1076syn match vimSynPatMod contained "\%#=1\(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\([-+]\d\+\)\=," nextgroup=vimSynPatMod
Bram Moolenaar5c736222010-01-06 20:54:52 +01001077syn match vimSynPatMod contained "lc=\d\+"
1078syn match vimSynPatMod contained "lc=\d\+," nextgroup=vimSynPatMod
1079syn region vimSynPatRange contained start="\[" skip="\\\\\|\\]" end="]"
1080syn match vimSynNotPatRange contained "\\\\\|\\\["
1081syn match vimMtchComment contained '"[^"]\+$'
Bram Moolenaar071d4272004-06-13 20:20:40 +00001082
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001083" Syntax: sync {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001084" ============
Bram Moolenaardf177f62005-02-22 08:39:57 +00001085syn keyword vimSynType contained sync skipwhite nextgroup=vimSyncC,vimSyncLines,vimSyncMatch,vimSyncError,vimSyncLinebreak,vimSyncLinecont,vimSyncRegion
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001086if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsyncerror")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001087 syn match vimSyncError contained "\i\+"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001088endif
Bram Moolenaar5c736222010-01-06 20:54:52 +01001089syn keyword vimSyncC contained ccomment clear fromstart
1090syn keyword vimSyncMatch contained match skipwhite nextgroup=vimSyncGroupName
1091syn keyword vimSyncRegion contained region skipwhite nextgroup=vimSynReg
1092syn match vimSyncLinebreak contained "\<linebreaks=" skipwhite nextgroup=vimNumber
1093syn keyword vimSyncLinecont contained linecont skipwhite nextgroup=vimSynRegPat
1094syn match vimSyncLines contained "\(min\|max\)\=lines=" nextgroup=vimNumber
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001095syn match vimSyncGroupName contained "\h\w*" skipwhite nextgroup=vimSyncKey
Bram Moolenaar5c736222010-01-06 20:54:52 +01001096syn match vimSyncKey contained "\<groupthere\|grouphere\>" skipwhite nextgroup=vimSyncGroup
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001097syn match vimSyncGroup contained "\h\w*" skipwhite nextgroup=vimSynRegPat,vimSyncNone
Bram Moolenaar5c736222010-01-06 20:54:52 +01001098syn keyword vimSyncNone contained NONE
Bram Moolenaar071d4272004-06-13 20:20:40 +00001099
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001100" Additional IsCommand: here by reasons of precedence {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001101" ====================
Bram Moolenaar5c736222010-01-06 20:54:52 +01001102syn match vimIsCommand "<Bar>\s*\a\+" transparent contains=vimCommand,vimNotation
Bram Moolenaar071d4272004-06-13 20:20:40 +00001103
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001104" Highlighting: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001105" ============
dkearns04e53632024-04-11 06:18:37 +10001106syn cluster vimHighlightCluster contains=vimHiLink,vimHiClear,vimHiKeyList,@vimComment
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001107if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimhictermerror")
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001108 syn match vimHiCtermError contained "\D\i*"
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001109endif
Bram Moolenaar5c736222010-01-06 20:54:52 +01001110syn match vimHighlight "\<hi\%[ghlight]\>" skipwhite nextgroup=vimHiBang,@vimHighlightCluster
dkearns9530fe42024-03-19 05:19:51 +11001111syn match vimHiBang contained "\a\@1<=!" skipwhite nextgroup=@vimHighlightCluster
Bram Moolenaard960d762011-09-21 19:22:10 +02001112
Bram Moolenaar5c736222010-01-06 20:54:52 +01001113syn match vimHiGroup contained "\i\+"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001114syn case ignore
dkearnsb614b282024-02-12 03:13:34 +11001115syn keyword vimHiAttrib contained none bold inverse italic nocombine reverse standout strikethrough underline undercurl underdashed underdotted underdouble
Bram Moolenaar5c736222010-01-06 20:54:52 +01001116syn keyword vimFgBgAttrib contained none bg background fg foreground
Bram Moolenaar071d4272004-06-13 20:20:40 +00001117syn case match
Bram Moolenaar5c736222010-01-06 20:54:52 +01001118syn match vimHiAttribList contained "\i\+" contains=vimHiAttrib
1119syn match vimHiAttribList contained "\i\+,"he=e-1 contains=vimHiAttrib nextgroup=vimHiAttribList
Bram Moolenaar071d4272004-06-13 20:20:40 +00001120syn case ignore
Bram Moolenaard2ea7cf2021-05-30 20:54:13 +02001121syn 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 +01001122syn match vimHiCtermColor contained "\<color\d\{1,3}\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001123
1124syn case match
Bram Moolenaar5c736222010-01-06 20:54:52 +01001125syn match vimHiFontname contained "[a-zA-Z\-*]\+"
1126syn match vimHiGuiFontname contained "'[a-zA-Z\-* ]\+'"
1127syn match vimHiGuiRgb contained "#\x\{6}"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001128
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001129" Highlighting: hi group key=arg ... {{{2
dkearnsb614b282024-02-12 03:13:34 +11001130syn cluster vimHiCluster contains=vimGroup,vimHiGroup,vimHiTerm,vimHiCTerm,vimHiStartStop,vimHiCtermFgBg,vimHiCtermul,vimHiCtermfont,vimHiGui,vimHiGuiFont,vimHiGuiFgBg,vimHiKeyError,vimNotation,vimComment,vim9comment
dkearns9530fe42024-03-19 05:19:51 +11001131syn 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 +01001132if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_vimhikeyerror")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001133 syn match vimHiKeyError contained "\i\+="he=e-1
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001134endif
Bram Moolenaar5c736222010-01-06 20:54:52 +01001135syn match vimHiTerm contained "\cterm="he=e-1 nextgroup=vimHiAttribList
dkearns9530fe42024-03-19 05:19:51 +11001136syn match vimHiStartStop contained "\c\%(start\|stop\)="he=e-1 nextgroup=vimHiTermcap,vimOption
Bram Moolenaar5c736222010-01-06 20:54:52 +01001137syn match vimHiCTerm contained "\ccterm="he=e-1 nextgroup=vimHiAttribList
Bram Moolenaar83d1b192015-04-13 14:22:40 +02001138syn match vimHiCtermFgBg contained "\ccterm[fb]g="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
Bram Moolenaar2547aa92020-07-26 17:00:44 +02001139syn match vimHiCtermul contained "\cctermul="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
PMuncha606f3a2023-11-15 15:35:49 +01001140syn match vimHiCtermfont contained "\cctermfont="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
Bram Moolenaar5c736222010-01-06 20:54:52 +01001141syn match vimHiGui contained "\cgui="he=e-1 nextgroup=vimHiAttribList
1142syn match vimHiGuiFont contained "\cfont="he=e-1 nextgroup=vimHiFontname
1143syn match vimHiGuiFgBg contained "\cgui\%([fb]g\|sp\)="he=e-1 nextgroup=vimHiGroup,vimHiGuiFontname,vimHiGuiRgb,vimFgBgAttrib
1144syn match vimHiTermcap contained "\S\+" contains=vimNotation
Bram Moolenaar83d1b192015-04-13 14:22:40 +02001145syn match vimHiNmbr contained '\d\+'
Bram Moolenaar071d4272004-06-13 20:20:40 +00001146
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001147" Highlight: clear {{{2
dkearns9530fe42024-03-19 05:19:51 +11001148syn keyword vimHiClear contained clear skipwhite nextgroup=vimGroup,vimHiGroup
Bram Moolenaar071d4272004-06-13 20:20:40 +00001149
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001150" Highlight: link {{{2
Bram Moolenaard2855f52018-07-31 22:23:58 +02001151" see tst24 (hi def vs hi) (Jul 06, 2018)
1152"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 +11001153" TODO: simplify and allow line continuations --djk
1154syn 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 +00001155
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001156" Control Characters: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001157" ==================
Bram Moolenaar5c736222010-01-06 20:54:52 +01001158syn match vimCtrlChar "[- -]"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001159
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001160" Beginners - Patterns that involve ^ {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001161" =========
Doug Kearns35699f12024-09-19 19:51:59 +02001162Vim9 syn region vim9LineComment start=+^[ \t:]*\zs#.*$+ skip=+\n\s*\\\|\n\s*#\\ + end="$" contains=@vimCommentGroup,vimCommentString,vim9CommentTitle extend
1163VimL syn region vimLineComment start=+^[ \t:]*\zs".*$+ skip=+\n\s*\\\|\n\s*"\\ + end="$" contains=@vimCommentGroup,vimCommentString,vimCommentTitle extend
Doug Kearnsd65e58f2024-07-17 19:34:14 +02001164
Bram Moolenaar5c736222010-01-06 20:54:52 +01001165syn 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 +10001166syn 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 +10001167
dkearnsae321b52024-06-15 23:06:17 +10001168" allowed anywhere in the file
1169if !s:vim9script
1170 syn match vimShebangError "^\s*\zs#!.*" display
1171endif
1172syn match vimShebang "\%^#!.*" display
1173
dkearns21ce1592024-01-29 04:54:08 +11001174syn match vimContinue "^\s*\zs\\"
Doug Kearns4f010c92025-02-13 20:24:42 +01001175syn match vimContinueComment '^\s*\zs["#]\\ .*' extend
1176syn match vim9ContinueComment "^\s*\zs#\\ .*" extend
Doug Kearns818c6412024-10-06 17:00:48 +02001177syn cluster vimContinue contains=vimContinue,vimContinueComment
1178syn cluster vim9Continue contains=vimContinue,vim9ContinueComment
1179
Bram Moolenaar5c736222010-01-06 20:54:52 +01001180syn region vimString start="^\s*\\\z(['"]\)" skip='\\\\\|\\\z1' end="\z1" oneline keepend contains=@vimStringGroup,vimContinue
1181syn match vimCommentTitleLeader '"\s\+'ms=s+1 contained
dkearns04e53632024-04-11 06:18:37 +10001182syn match vim9CommentTitleLeader '#\s\+'ms=s+1 contained
Bram Moolenaar071d4272004-06-13 20:20:40 +00001183
Bram Moolenaar18144c82006-04-12 21:52:12 +00001184" Searches And Globals: {{{2
1185" ====================
Doug Kearnsc273f1a2025-01-20 21:53:01 +01001186VimL syn match vimSearch '^\s*[/?].*' contains=vimSearchDelim
Bram Moolenaar5c736222010-01-06 20:54:52 +01001187syn match vimSearchDelim '^\s*\zs[/?]\|[/?]$' contained
Doug Kearnsc273f1a2025-01-20 21:53:01 +01001188Vim9 syn match vim9Search '^\s*:[/?].*' contains=vim9SearchDelim
1189syn match vim9SearchDelim '^\s*\zs:[/?]\|[/?]$' contained contains=vimCmdSep
dkearns2c51e152024-02-27 07:10:18 +11001190syn region vimGlobal matchgroup=Statement start='\<g\%[lobal]!\=/' skip='\\.' end='/' skipwhite nextgroup=vimSubst1
1191syn region vimGlobal matchgroup=Statement start='\<v\%[global]!\=/' skip='\\.' end='/' skipwhite nextgroup=vimSubst1
Bram Moolenaare2f98b92006-03-29 21:18:24 +00001192
dkearns04e53632024-04-11 06:18:37 +10001193" Vim9 Script Regions: {{{2
1194" ==================
1195
1196if s:vim9script
Doug Kearnsce064932024-04-13 18:24:01 +02001197 syn cluster vimLegacyTop contains=TOP,vim9LegacyHeader,vim9Comment,vim9LineComment
1198 VimFoldH syn region vim9LegacyHeader start="\%^" end="^\ze\s*vim9s\%[cript]\>" contains=@vimLegacyTop,vimComment,vimLineComment
dkearns04e53632024-04-11 06:18:37 +10001199
Doug Kearnsce064932024-04-13 18:24:01 +02001200 syn keyword vim9Vim9ScriptArg noclear contained
1201 syn keyword vim9Vim9Script vim9s[cript] nextgroup=vim9Vim9ScriptArg skipwhite
dkearns04e53632024-04-11 06:18:37 +10001202endif
1203
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001204" Embedded Scripts: {{{2
1205" ================
1206" perl,ruby : Benoit Cerrina
1207" python,tcl : Johannes Zellner
1208" mzscheme, lua : Charles Campbell
Bram Moolenaar071d4272004-06-13 20:20:40 +00001209
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00001210" Allows users to specify the type of embedded script highlighting
1211" they want: (perl/python/ruby/tcl support)
1212" g:vimsyn_embed == 0 : don't embed any scripts
Doug Kearnsfc64ac02024-06-22 11:20:36 +02001213" g:vimsyn_embed =~# 'l' : embed Lua (but only if vim supports it)
1214" g:vimsyn_embed =~# 'm' : embed MzScheme (but only if vim supports it)
1215" g:vimsyn_embed =~# 'p' : embed Perl (but only if vim supports it)
1216" g:vimsyn_embed =~# 'P' : embed Python (but only if vim supports it)
1217" g:vimsyn_embed =~# 'r' : embed Ruby (but only if vim supports it)
1218" g:vimsyn_embed =~# 't' : embed Tcl (but only if vim supports it)
Bram Moolenaar7cba6c02013-09-05 22:13:31 +02001219if !exists("g:vimsyn_embed")
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001220 let g:vimsyn_embed= "lmpPr"
Bram Moolenaar7cba6c02013-09-05 22:13:31 +02001221endif
Bram Moolenaar071d4272004-06-13 20:20:40 +00001222
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +02001223" [-- lua --] {{{3
Bram Moolenaaradc21822011-04-01 18:03:16 +02001224let s:luapath= fnameescape(expand("<sfile>:p:h")."/lua.vim")
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +02001225if !filereadable(s:luapath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001226 for s:luapath in split(globpath(&rtp,"syntax/lua.vim"),"\n")
1227 if filereadable(fnameescape(s:luapath))
1228 let s:luapath= fnameescape(s:luapath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +01001229 break
1230 endif
1231 endfor
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +02001232endif
Bram Moolenaarf3913272016-02-25 00:00:01 +01001233if (g:vimsyn_embed =~# 'l' && has("lua")) && filereadable(s:luapath)
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +02001234 unlet! b:current_syntax
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001235 syn cluster vimFuncBodyList add=vimLuaRegion
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +02001236 exe "syn include @vimLuaScript ".s:luapath
Ken Takata95e90782024-08-22 21:29:39 +02001237 VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+^\z(\s*\)lua\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ contains=@vimLuaScript
1238 VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+lua\s*<<\s*\z(\S*\)+ end=+^\z1$+ contains=@vimLuaScript
1239 VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+^\z(\s*\)lua\s*<<\s*trim\s*$+ end=+^\z1\.$+ contains=@vimLuaScript
1240 VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+lua\s*<<\s*$+ end=+^\.$+ contains=@vimLuaScript
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +02001241 syn cluster vimFuncBodyList add=vimLuaRegion
1242else
Ken Takata95e90782024-08-22 21:29:39 +02001243 syn region vimEmbedError start=+^\z(\s*\)lua\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+
1244 syn region vimEmbedError start=+lua\s*<<\s*\z(\S*\)+ end=+^\z1$+
1245 syn region vimEmbedError start=+^\z(\s*\)lua\s*<<\s*trim\s\*$+ end=+^\z1\.$+
1246 syn region vimEmbedError start=+lua\s*<<\s*$+ end=+^\.$+
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +02001247endif
1248unlet s:luapath
1249
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001250" [-- perl --] {{{3
Bram Moolenaaradc21822011-04-01 18:03:16 +02001251let s:perlpath= fnameescape(expand("<sfile>:p:h")."/perl.vim")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001252if !filereadable(s:perlpath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001253 for s:perlpath in split(globpath(&rtp,"syntax/perl.vim"),"\n")
1254 if filereadable(fnameescape(s:perlpath))
1255 let s:perlpath= fnameescape(s:perlpath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +01001256 break
1257 endif
1258 endfor
Bram Moolenaar5c736222010-01-06 20:54:52 +01001259endif
Bram Moolenaarf3913272016-02-25 00:00:01 +01001260if (g:vimsyn_embed =~# 'p' && has("perl")) && filereadable(s:perlpath)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001261 unlet! b:current_syntax
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001262 syn cluster vimFuncBodyList add=vimPerlRegion
Bram Moolenaar5c736222010-01-06 20:54:52 +01001263 exe "syn include @vimPerlScript ".s:perlpath
Ken Takata95e90782024-08-22 21:29:39 +02001264 VimFoldp syn region vimPerlRegion matchgroup=vimScriptDelim start=+^\z(\s*\)pe\%[rl]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ contains=@vimPerlScript
1265 VimFoldp syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*\z(\S*\)+ end=+^\z1$+ contains=@vimPerlScript
1266 VimFoldp syn region vimPerlRegion matchgroup=vimScriptDelim start=+^\z(\s*\)pe\%[rl]\s*<<\s*trim\s*$+ end=+^\z1\.$+ contains=@vimPerlScript
1267 VimFoldp syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*$+ end=+\.$+ contains=@vimPerlScript
Bram Moolenaar5c736222010-01-06 20:54:52 +01001268 syn cluster vimFuncBodyList add=vimPerlRegion
Bram Moolenaarc236c162008-07-13 17:41:49 +00001269else
Ken Takata95e90782024-08-22 21:29:39 +02001270 syn region vimEmbedError start=+^\z(\s*\)pe\%[rl]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+
1271 syn region vimEmbedError start=+pe\%[rl]\s*<<\s*\z(\S*\)+ end=+^\z1$+
1272 syn region vimEmbedError start=+^\z(\s*\)pe\%[rl]\s*<<\s*trim\s\*$+ end=+^\z1\.$+
1273 syn region vimEmbedError start=+pe\%[rl]\s*<<\s*$+ end=+^\.$+
Bram Moolenaar071d4272004-06-13 20:20:40 +00001274endif
Bram Moolenaar5c736222010-01-06 20:54:52 +01001275unlet s:perlpath
Bram Moolenaar071d4272004-06-13 20:20:40 +00001276
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001277" [-- ruby --] {{{3
Bram Moolenaaradc21822011-04-01 18:03:16 +02001278let s:rubypath= fnameescape(expand("<sfile>:p:h")."/ruby.vim")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001279if !filereadable(s:rubypath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001280 for s:rubypath in split(globpath(&rtp,"syntax/ruby.vim"),"\n")
1281 if filereadable(fnameescape(s:rubypath))
1282 let s:rubypath= fnameescape(s:rubypath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +01001283 break
1284 endif
1285 endfor
Bram Moolenaar5c736222010-01-06 20:54:52 +01001286endif
Bram Moolenaarf3913272016-02-25 00:00:01 +01001287if (g:vimsyn_embed =~# 'r' && has("ruby")) && filereadable(s:rubypath)
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001288 syn cluster vimFuncBodyList add=vimRubyRegion
Bram Moolenaar071d4272004-06-13 20:20:40 +00001289 unlet! b:current_syntax
Bram Moolenaar5c736222010-01-06 20:54:52 +01001290 exe "syn include @vimRubyScript ".s:rubypath
Ken Takata95e90782024-08-22 21:29:39 +02001291 VimFoldr syn region vimRubyRegion matchgroup=vimScriptDelim start=+^\z(\s*\)rub\%[y]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ contains=@vimRubyScript
1292 VimFoldr syn region vimRubyRegion matchgroup=vimScriptDelim start=+rub\%[y]\s*<<\s*\z(\S*\)+ end=+^\z1$+ contains=@vimRubyScript
1293 VimFoldr syn region vimRubyRegion matchgroup=vimScriptDelim start=+^\z(\s*\)rub\%[y]\s*<<\s*trim\s*$+ end=+^\z1\.$+ contains=@vimRubyScript
1294 VimFoldr syn region vimRubyRegion matchgroup=vimScriptDelim start=+rub\%[y]\s*<<\s*$+ end=+\.$+ contains=@vimRubyScript
Bram Moolenaar5c736222010-01-06 20:54:52 +01001295 syn cluster vimFuncBodyList add=vimRubyRegion
Bram Moolenaarc236c162008-07-13 17:41:49 +00001296else
Ken Takata95e90782024-08-22 21:29:39 +02001297 syn region vimEmbedError start=+^\z(\s*\)rub\%[y]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+
1298 syn region vimEmbedError start=+rub\%[y]\s*<<\s*\z(\S.*\)+ end=+^\z1$+
1299 syn region vimEmbedError start=+^\z(\s*\)rub\%[y]\s*<<\s*trim\s\*$+ end=+^\z1\.$+
1300 syn region vimEmbedError start=+rub\%[y]\s*<<\s*$+ end=+^\.$+
Bram Moolenaar071d4272004-06-13 20:20:40 +00001301endif
Bram Moolenaar5c736222010-01-06 20:54:52 +01001302unlet s:rubypath
Bram Moolenaar071d4272004-06-13 20:20:40 +00001303
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001304" [-- python --] {{{3
Bram Moolenaaradc21822011-04-01 18:03:16 +02001305let s:pythonpath= fnameescape(expand("<sfile>:p:h")."/python.vim")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001306if !filereadable(s:pythonpath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001307 for s:pythonpath in split(globpath(&rtp,"syntax/python.vim"),"\n")
1308 if filereadable(fnameescape(s:pythonpath))
1309 let s:pythonpath= fnameescape(s:pythonpath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +01001310 break
1311 endif
1312 endfor
Bram Moolenaar5c736222010-01-06 20:54:52 +01001313endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001314if g:vimsyn_embed =~# 'P' && has("pythonx") && filereadable(s:pythonpath)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001315 unlet! b:current_syntax
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001316 syn cluster vimFuncBodyList add=vimPythonRegion
Bram Moolenaar5c736222010-01-06 20:54:52 +01001317 exe "syn include @vimPythonScript ".s:pythonpath
Ken Takata95e90782024-08-22 21:29:39 +02001318 VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+^\z(\s*\)py\%[thon][3x]\=\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ contains=@vimPythonScript
1319 VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon][3x]\=\s*<<\s*\z(\S\+\)+ end=+^\z1$+ contains=@vimPythonScript
1320 VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+^\z(\s*\)py\%[thon][3x]\=\s*<<\s*trim\s*$+ end=+^\z1\.$+ contains=@vimPythonScript
1321 VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon][3x]\=\s*<<\s*$+ end=+^\.$+ contains=@vimPythonScript
1322 VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+Py\%[thon]2or3\s*<<\s*\%(trim\s*\)\=\z(\S\+\)+ end=+^\z1$+ contains=@vimPythonScript
1323 VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+Py\%[thon]2or3\s*<<\s*\%(trim\s*\)\=$+ end=+^\.$+ contains=@vimPythonScript
Bram Moolenaar5c736222010-01-06 20:54:52 +01001324 syn cluster vimFuncBodyList add=vimPythonRegion
Bram Moolenaarc236c162008-07-13 17:41:49 +00001325else
Ken Takata95e90782024-08-22 21:29:39 +02001326 syn region vimEmbedError start=+^\z(\s*\)py\%[thon][3x]\=\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+
1327 syn region vimEmbedError start=+py\%[thon][3x]\=\s*<<\s*\z(\S\+\)+ end=+^\z1$+
1328 syn region vimEmbedError start=+^\z(\s*\)py\%[thon][3x]\=\s*<<\s*trim\s*$+ end=+^\z1\.$+
1329 syn region vimEmbedError start=+py\%[thon][3x]\=\s*<<\s*$+ end=+^\.$+
Bram Moolenaar071d4272004-06-13 20:20:40 +00001330endif
Bram Moolenaar5c736222010-01-06 20:54:52 +01001331unlet s:pythonpath
Bram Moolenaar071d4272004-06-13 20:20:40 +00001332
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001333" [-- tcl --] {{{3
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001334if has("win32") || has("win95") || has("win64") || has("win16")
1335 " apparently has("tcl") has been hanging vim on some windows systems with cygwin
1336 let s:trytcl= (&shell !~ '\<\%(bash\>\|4[nN][tT]\|\<zsh\)\>\%(\.exe\)\=$')
1337else
1338 let s:trytcl= 1
1339endif
Bram Moolenaara6878372014-03-22 21:02:50 +01001340if s:trytcl
1341 let s:tclpath= fnameescape(expand("<sfile>:p:h")."/tcl.vim")
1342 if !filereadable(s:tclpath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001343 for s:tclpath in split(globpath(&rtp,"syntax/tcl.vim"),"\n")
1344 if filereadable(fnameescape(s:tclpath))
1345 let s:tclpath= fnameescape(s:tclpath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +01001346 break
1347 endif
1348 endfor
Bram Moolenaar5c736222010-01-06 20:54:52 +01001349 endif
Bram Moolenaarf3913272016-02-25 00:00:01 +01001350 if (g:vimsyn_embed =~# 't' && has("tcl")) && filereadable(s:tclpath)
Bram Moolenaara6878372014-03-22 21:02:50 +01001351 unlet! b:current_syntax
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001352 syn cluster vimFuncBodyList add=vimTclRegion
Bram Moolenaara6878372014-03-22 21:02:50 +01001353 exe "syn include @vimTclScript ".s:tclpath
Ken Takata95e90782024-08-22 21:29:39 +02001354 VimFoldt syn region vimTclRegion matchgroup=vimScriptDelim start=+^\z(\s*\)tc\%[l]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ contains=@vimTclScript
1355 VimFoldt syn region vimTclRegion matchgroup=vimScriptDelim start=+tc\%[l]\=\s*<<\s*\z(\S*\)+ end=+^\z1$+ contains=@vimTclScript
1356 VimFoldt syn region vimTclRegion matchgroup=vimScriptDelim start=+^\z(\s*\)tc\%[l]\s*<<\s*trim\s*$+ end=+^\z1\.$+ contains=@vimTclScript
1357 VimFoldt syn region vimTclRegion matchgroup=vimScriptDelim start=+tc\%[l]\=\s*<<\s*$+ end=+^\.$+ contains=@vimTclScript
Bram Moolenaara6878372014-03-22 21:02:50 +01001358 syn cluster vimFuncBodyList add=vimTclScript
1359 else
Ken Takata95e90782024-08-22 21:29:39 +02001360 syn region vimEmbedError start=+^\z(\s*\)tc\%[l]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+
1361 syn region vimEmbedError start=+tc\%[l]\=\s*<<\s*\z(\S*\)+ end=+^\z1$+
1362 syn region vimEmbedError start=+^\z(\s*\)tc\%[l]\s*<<\s*trim\s\*$+ end=+^\z1\.$+
1363 syn region vimEmbedError start=+tc\%[l]\=\s*<<\s*$+ end=+^\.$+
Bram Moolenaara6878372014-03-22 21:02:50 +01001364 endif
1365 unlet s:tclpath
Bram Moolenaarc236c162008-07-13 17:41:49 +00001366else
Ken Takata95e90782024-08-22 21:29:39 +02001367 syn region vimEmbedError start=+^\z(\s*\)tc\%[l]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+
1368 syn region vimEmbedError start=+tc\%[l]\=\s*<<\s*\z(\S*\)+ end=+^\z1$+
1369 syn region vimEmbedError start=+^\z(\s*\)tc\%[l]\s*<<\s*trim\s\*$+ end=+^\z1\.$+
1370 syn region vimEmbedError start=+tc\%[l]\=\s*<<\s*$+ end=+^\.$+
Bram Moolenaar9964e462007-05-05 17:54:07 +00001371endif
Bram Moolenaara6878372014-03-22 21:02:50 +01001372unlet s:trytcl
Bram Moolenaar071d4272004-06-13 20:20:40 +00001373
Bram Moolenaar8299df92004-07-10 09:47:34 +00001374" [-- mzscheme --] {{{3
Bram Moolenaaradc21822011-04-01 18:03:16 +02001375let s:mzschemepath= fnameescape(expand("<sfile>:p:h")."/scheme.vim")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001376if !filereadable(s:mzschemepath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001377 for s:mzschemepath in split(globpath(&rtp,"syntax/mzscheme.vim"),"\n")
1378 if filereadable(fnameescape(s:mzschemepath))
1379 let s:mzschemepath= fnameescape(s:mzschemepath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +01001380 break
1381 endif
1382 endfor
Bram Moolenaar5c736222010-01-06 20:54:52 +01001383endif
Bram Moolenaarf3913272016-02-25 00:00:01 +01001384if (g:vimsyn_embed =~# 'm' && has("mzscheme")) && filereadable(s:mzschemepath)
Bram Moolenaar8299df92004-07-10 09:47:34 +00001385 unlet! b:current_syntax
Bram Moolenaar03413f42016-04-12 21:07:15 +02001386 let s:iskKeep= &isk
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001387 syn cluster vimFuncBodyList add=vimMzSchemeRegion
Bram Moolenaar5c736222010-01-06 20:54:52 +01001388 exe "syn include @vimMzSchemeScript ".s:mzschemepath
Bram Moolenaar03413f42016-04-12 21:07:15 +02001389 let &isk= s:iskKeep
1390 unlet s:iskKeep
Ken Takata95e90782024-08-22 21:29:39 +02001391 VimFoldm syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+^\z(\s*\)mz\%[scheme]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ contains=@vimMzSchemeScript
1392 VimFoldm syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*\z(\S*\)+ end=+^\z1$+ contains=@vimMzSchemeScript
1393 VimFoldm syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+^\z(\s*\)mz\%[scheme]\s*<<\s*trim\s*$+ end=+^\z1\.$+ contains=@vimMzSchemeScript
1394 VimFoldm syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*$+ end=+^\.$+ contains=@vimMzSchemeScript
Bram Moolenaar5c736222010-01-06 20:54:52 +01001395 syn cluster vimFuncBodyList add=vimMzSchemeRegion
Bram Moolenaarc236c162008-07-13 17:41:49 +00001396else
Ken Takata95e90782024-08-22 21:29:39 +02001397 syn region vimEmbedError start=+^\z(\s*\)mz\%[scheme]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+
1398 syn region vimEmbedError start=+mz\%[scheme]\s*<<\s*\z(\S*\)+ end=+^\z1$+
1399 syn region vimEmbedError start=+^\z(\s*\)mz\%[scheme]\s*<<\s*trim\s\*$+ end=+^\z1\.$+
1400 syn region vimEmbedError start=+mz\%[scheme]\s*<<\s*$+ end=+^\.$+
Bram Moolenaar8299df92004-07-10 09:47:34 +00001401endif
Bram Moolenaar5c736222010-01-06 20:54:52 +01001402unlet s:mzschemepath
Bram Moolenaar8299df92004-07-10 09:47:34 +00001403
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001404" Synchronize (speed) {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001405"============
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00001406if exists("g:vimsyn_minlines")
1407 exe "syn sync minlines=".g:vimsyn_minlines
Bram Moolenaar071d4272004-06-13 20:20:40 +00001408endif
Bram Moolenaar03413f42016-04-12 21:07:15 +02001409exe "syn sync maxlines=".s:vimsyn_maxlines
Bram Moolenaar071d4272004-06-13 20:20:40 +00001410syn sync linecont "^\s\+\\"
dkearns62b26042024-03-10 03:43:28 +11001411syn sync linebreaks=1
Bram Moolenaar071d4272004-06-13 20:20:40 +00001412syn sync match vimAugroupSyncA groupthere NONE "\<aug\%[roup]\>\s\+[eE][nN][dD]"
1413
Bram Moolenaar5c736222010-01-06 20:54:52 +01001414" ====================
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001415" Highlighting Settings {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001416" ====================
1417
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001418if !exists("skip_vim_syntax_inits")
1419 if !exists("g:vimsyn_noerror")
1420 hi def link vimBehaveError vimError
1421 hi def link vimCollClassErr vimError
1422 hi def link vimErrSetting vimError
1423 hi def link vimEmbedError vimError
1424 hi def link vimFTError vimError
1425 hi def link vimFunctionError vimError
1426 hi def link vimFunc vimError
1427 hi def link vimHiAttribList vimError
1428 hi def link vimHiCtermError vimError
1429 hi def link vimHiKeyError vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001430 hi def link vimMapModErr vimError
dkearnsae321b52024-06-15 23:06:17 +10001431 hi def link vimShebangError vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001432 hi def link vimSubstFlagErr vimError
1433 hi def link vimSynCaseError vimError
Brad Kingd4634a22024-01-03 10:17:24 -05001434 hi def link vimSynFoldMethodError vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001435 hi def link vimBufnrWarn vimWarn
Doug Kearns818c6412024-10-06 17:00:48 +02001436
1437 hi def link vim9TypeAliasError vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001438 endif
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001439
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001440 hi def link vimAbb vimCommand
1441 hi def link vimAddress vimMark
dkearnsc4aef9a2024-03-04 02:42:47 +11001442 hi def link vimAugroupBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001443 hi def link vimAugroupError vimError
1444 hi def link vimAugroupKey vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001445 hi def link vimAutoCmd vimCommand
Doug Kearns1718e7d2025-01-08 18:20:47 +01001446 hi def link vimAutoCmdBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001447 hi def link vimAutoEvent Type
Bram Moolenaard58a3bf2020-09-28 21:48:16 +02001448 hi def link vimAutoCmdMod Special
dkearnsb614b282024-02-12 03:13:34 +11001449 hi def link vimBang vimOper
dkearns2c51e152024-02-27 07:10:18 +11001450 hi def link vimBehaveBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001451 hi def link vimBehaveModel vimBehave
1452 hi def link vimBehave vimCommand
1453 hi def link vimBracket Delimiter
Doug Kearns99984fc2024-07-18 20:45:19 +02001454 hi def link vimCall vimCommand
dkearnsa3bddb72024-06-14 01:48:10 +10001455 hi def link vimCatch vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001456 hi def link vimCmplxRepeat SpecialChar
1457 hi def link vimCommand Statement
1458 hi def link vimComment Comment
Doug Kearnsfc64ac02024-06-22 11:20:36 +02001459 hi def link vimCommentError vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001460 hi def link vimCommentString vimString
1461 hi def link vimCommentTitle PreProc
1462 hi def link vimCondHL vimCommand
dkearnsf6869212023-12-11 01:53:24 +11001463 hi def link vimConst vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001464 hi def link vimContinue Special
dkearns21ce1592024-01-29 04:54:08 +11001465 hi def link vimContinueComment vimComment
Doug Kearns4a530a62025-02-03 18:59:09 +01001466 hi def link vimCount Number
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001467 hi def link vimCtrlChar SpecialChar
Doug Kearns4a530a62025-02-03 18:59:09 +01001468 hi def link vimDebuggreedy vimCommand
Doug Kearnsfc64ac02024-06-22 11:20:36 +02001469 hi def link vimDefComment vim9Comment
dkearns35e6f4c2024-03-22 06:41:10 +11001470 hi def link vimDefKey vimCommand
Doug Kearns1aa287e2025-02-10 22:00:27 +01001471 hi def link vimDefParam vimVar
Doug Kearns3c07eb02024-09-02 10:03:37 +02001472 hi def link vimDelcommand vimCommand
1473 hi def link vimDelcommandAttr vimUserCmdAttr
dkearnsb1427b42024-02-28 05:59:30 +11001474 hi def link vimEcho vimCommand
dkearns61887b32024-03-15 23:45:48 +11001475 hi def link vimEchohlNone vimGroup
1476 hi def link vimEchohl vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001477 hi def link vimElseIfErr Error
dkearns35e6f4c2024-03-22 06:41:10 +11001478 hi def link vimEndfunction vimCommand
1479 hi def link vimEnddef vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001480 hi def link vimEnvvar PreProc
1481 hi def link vimError Error
Bram Moolenaar6ba83ba2022-06-12 22:15:57 +01001482 hi def link vimEscape Special
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001483 hi def link vimFBVar vimVar
1484 hi def link vimFgBgAttrib vimHiAttrib
Bram Moolenaarcbaff5e2022-04-08 17:45:08 +01001485 hi def link vimFuncEcho vimCommand
dkearns1c97b5c2023-12-13 02:47:43 +11001486 hi def link vimFor vimCommand
Doug Kearns1aa287e2025-02-10 22:00:27 +01001487 hi def link vimForInContinue vimContinue
1488 hi def link vimForInContinueComment vimContinueComment
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001489 hi def link vimFTCmd vimCommand
1490 hi def link vimFTOption vimSynType
dkearns35e6f4c2024-03-22 06:41:10 +11001491 hi def link vimFuncBang vimBang
1492 hi def link vimFuncComment vimComment
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001493 hi def link vimFuncKey vimCommand
1494 hi def link vimFuncName Function
dkearns35e6f4c2024-03-22 06:41:10 +11001495 hi def link vimFuncMod Special
1496 hi def link vimFuncParam vimVar
1497 hi def link vimFuncParamEquals vimOper
Doug Kearns1aa287e2025-02-10 22:00:27 +01001498 hi def link vimFuncScope vimVar
1499 hi def link vimFuncSID vimNotation
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001500 hi def link vimGroupAdd vimSynOption
1501 hi def link vimGroupName vimGroup
1502 hi def link vimGroupRem vimSynOption
1503 hi def link vimGroupSpecial Special
1504 hi def link vimGroup Type
1505 hi def link vimHiAttrib PreProc
dkearnsb614b282024-02-12 03:13:34 +11001506 hi def link vimHiBang vimBang
dkearns9530fe42024-03-19 05:19:51 +11001507 hi def link vimHiClear Type
1508 hi def link vimHiCtermColor Constant
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001509 hi def link vimHiCtermFgBg vimHiTerm
dkearns9530fe42024-03-19 05:19:51 +11001510 hi def link vimHiCtermfont vimHiTerm
1511 hi def link vimHiCtermul vimHiTerm
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001512 hi def link vimHiCTerm vimHiTerm
1513 hi def link vimHighlight vimCommand
1514 hi def link vimHiGroup vimGroupName
1515 hi def link vimHiGuiFgBg vimHiTerm
1516 hi def link vimHiGuiFont vimHiTerm
1517 hi def link vimHiGuiRgb vimNumber
1518 hi def link vimHiGui vimHiTerm
1519 hi def link vimHiNmbr Number
1520 hi def link vimHiStartStop vimHiTerm
1521 hi def link vimHiTerm Type
1522 hi def link vimHLGroup vimGroup
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001523 hi def link vimInsert vimString
1524 hi def link vimIskSep Delimiter
dkearns04e53632024-04-11 06:18:37 +10001525 hi def link vim9KeymapLineComment vimKeymapLineComment
dkearns69866442023-11-22 05:43:40 +11001526 hi def link vimKeymapLineComment vimComment
1527 hi def link vimKeymapTailComment vimComment
Doug Kearns1aa287e2025-02-10 22:00:27 +01001528 hi def link vimLambdaOperator vimOper
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001529 hi def link vimLet vimCommand
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001530 hi def link vimLetHereDoc vimString
1531 hi def link vimLetHereDocStart Special
1532 hi def link vimLetHereDocStop Special
dkearnsf6869212023-12-11 01:53:24 +11001533 hi def link vimLetRegister Special
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001534 hi def link vimLineComment vimComment
dkearnsb614b282024-02-12 03:13:34 +11001535 hi def link vimMapBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001536 hi def link vimMapModKey vimFuncSID
1537 hi def link vimMapMod vimBracket
1538 hi def link vimMap vimCommand
1539 hi def link vimMark Number
1540 hi def link vimMarkNumber vimNumber
Doug Kearnse85fdc72024-07-07 20:45:37 +02001541 hi def link vimMatch vimCommand
1542 hi def link vimMatchGroup vimGroup
1543 hi def link vimMatchNone vimGroup
dkearnsb614b282024-02-12 03:13:34 +11001544 hi def link vimMenuBang vimBang
dkearns62b26042024-03-10 03:43:28 +11001545 hi def link vimMenuClear Special
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001546 hi def link vimMenuMod vimMapMod
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001547 hi def link vimMenuName PreProc
dkearns62b26042024-03-10 03:43:28 +11001548 hi def link vimMenu vimCommand
1549 hi def link vimMenuNotation vimNotation
1550 hi def link vimMenuPriority Number
1551 hi def link vimMenuStatus Special
1552 hi def link vimMenutranslateComment vimComment
Doug Kearns818c6412024-10-06 17:00:48 +02001553 hi def link vim9MethodName vimFuncName
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001554 hi def link vimMtchComment vimComment
Doug Kearnsbbe52522024-11-09 19:11:25 +01001555 hi def link vimNormal vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001556 hi def link vimNotation Special
1557 hi def link vimNotFunc vimCommand
1558 hi def link vimNotPatSep vimString
1559 hi def link vimNumber Number
1560 hi def link vimOperError Error
1561 hi def link vimOper Operator
Doug Kearns1aa287e2025-02-10 22:00:27 +01001562 hi def link vimOperContinue vimContinue
1563 hi def link vimOperContinueComment vimContinueComment
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001564 hi def link vimOption PreProc
Doug Kearns1aa287e2025-02-10 22:00:27 +01001565 hi def link vimOptionVar Identifier
1566 hi def link vimVimVar Identifier
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001567 hi def link vimParenSep Delimiter
Bram Moolenaard2855f52018-07-31 22:23:58 +02001568 hi def link vimPatSepErr vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001569 hi def link vimPatSepR vimPatSep
1570 hi def link vimPatSep SpecialChar
1571 hi def link vimPatSepZone vimString
1572 hi def link vimPatSepZ vimPatSep
1573 hi def link vimPattern Type
1574 hi def link vimPlainMark vimMark
1575 hi def link vimPlainRegister vimRegister
Doug Kearns695522d2025-01-10 20:02:17 +01001576 hi def link vimQuoteEscape vimEscape
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001577 hi def link vimRegister SpecialChar
1578 hi def link vimScriptDelim Comment
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001579 hi def link vimSearch vimString
Doug Kearnsc273f1a2025-01-20 21:53:01 +01001580 hi def link vimSearchDelim Delimiter
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001581 hi def link vimSep Delimiter
Doug Kearnsddbb6fe2024-07-24 20:21:22 +02001582 hi def link vimSet vimCommand
1583 hi def link vimSetAll vimOption
1584 hi def link vimSetBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001585 hi def link vimSetMod vimOption
Doug Kearnsddbb6fe2024-07-24 20:21:22 +02001586 hi def link vimSetSep vimSep
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001587 hi def link vimSetString vimString
Doug Kearnsddbb6fe2024-07-24 20:21:22 +02001588 hi def link vimSetTermcap vimOption
dkearnsae321b52024-06-15 23:06:17 +10001589 hi def link vimShebang PreProc
Doug Kearns262e25e2024-06-14 20:16:35 +02001590 hi def link vimSleep vimCommand
1591 hi def link vimSleepArg Constant
1592 hi def link vimSleepBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001593 hi def link vimSpecFile Identifier
1594 hi def link vimSpecFileMod vimSpecFile
1595 hi def link vimSpecial Type
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001596 hi def link vimStringCont vimString
1597 hi def link vimString String
Bram Moolenaard2855f52018-07-31 22:23:58 +02001598 hi def link vimStringEnd vimString
thincacf8695d2024-01-28 18:57:23 +01001599 hi def link vimStringInterpolationBrace vimEscape
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001600 hi def link vimSubst1 vimSubst
1601 hi def link vimSubstDelim Delimiter
1602 hi def link vimSubstFlags Special
1603 hi def link vimSubstSubstr SpecialChar
1604 hi def link vimSubstTwoBS vimString
1605 hi def link vimSubst vimCommand
1606 hi def link vimSynCaseError Error
1607 hi def link vimSynCase Type
1608 hi def link vimSyncC Type
1609 hi def link vimSyncError Error
1610 hi def link vimSyncGroupName vimGroupName
1611 hi def link vimSyncGroup vimGroupName
1612 hi def link vimSyncKey Type
1613 hi def link vimSyncNone Type
1614 hi def link vimSynContains vimSynOption
1615 hi def link vimSynError Error
Brad Kingd4634a22024-01-03 10:17:24 -05001616 hi def link vimSynFoldMethodError Error
1617 hi def link vimSynFoldMethod Type
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001618 hi def link vimSynKeyContainedin vimSynContains
1619 hi def link vimSynKeyOpt vimSynOption
dkearnsc79646d2024-01-05 08:58:48 +11001620 hi def link vimSynCchar vimSynOption
1621 hi def link vimSynCcharValue Character
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001622 hi def link vimSynMtchGrp vimSynOption
1623 hi def link vimSynMtchOpt vimSynOption
1624 hi def link vimSynNextgroup vimSynOption
1625 hi def link vimSynNotPatRange vimSynRegPat
1626 hi def link vimSynOption Special
1627 hi def link vimSynPatRange vimString
1628 hi def link vimSynRegOpt vimSynOption
1629 hi def link vimSynRegPat vimString
1630 hi def link vimSynReg Type
1631 hi def link vimSyntax vimCommand
1632 hi def link vimSynType vimSpecial
dkearnsa3bddb72024-06-14 01:48:10 +10001633 hi def link vimThrow vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001634 hi def link vimTodo Todo
Bram Moolenaar4d8f4762021-06-27 15:18:56 +02001635 hi def link vimType Type
dkearnsf6869212023-12-11 01:53:24 +11001636 hi def link vimUnlet vimCommand
dkearnsb614b282024-02-12 03:13:34 +11001637 hi def link vimUnletBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001638 hi def link vimUnmap vimMap
Doug Kearns3c07eb02024-09-02 10:03:37 +02001639 hi def link vimUserCmdAttrAddr vimSpecial
1640 hi def link vimUserCmdAttrCmplt vimSpecial
1641 hi def link vimUserCmdAttrNargs vimSpecial
1642 hi def link vimUserCmdAttrRange vimSpecial
1643 hi def link vimUserCmdAttrKey vimUserCmdAttr
1644 hi def link vimUserCmdAttr Special
1645 hi def link vimUserCmdAttrError Error
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001646 hi def link vimUserCmdError Error
Doug Kearns3c07eb02024-09-02 10:03:37 +02001647 hi def link vimUserCmdKey vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001648 hi def link vimUserFunc Normal
Doug Kearns1aa287e2025-02-10 22:00:27 +01001649 hi def link vimVar Normal
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001650 hi def link vimWarn WarningMsg
Doug Kearnsd65e58f2024-07-17 19:34:14 +02001651
Doug Kearns818c6412024-10-06 17:00:48 +02001652 hi def link vim9Abstract vimCommand
Doug Kearnsd65e58f2024-07-17 19:34:14 +02001653 hi def link vim9Boolean Boolean
Doug Kearns818c6412024-10-06 17:00:48 +02001654 hi def link vim9Class vimCommand
Doug Kearnsd65e58f2024-07-17 19:34:14 +02001655 hi def link vim9Comment Comment
1656 hi def link vim9CommentError vimError
1657 hi def link vim9CommentTitle PreProc
Doug Kearns1aa287e2025-02-10 22:00:27 +01001658 hi def link vim9ConstructorDefParam vimVar
Doug Kearnsd65e58f2024-07-17 19:34:14 +02001659 hi def link vim9Const vimCommand
Doug Kearns818c6412024-10-06 17:00:48 +02001660 hi def link vim9ContinueComment vimContinueComment
1661 hi def link vim9Enum vimCommand
1662 hi def link vim9Export vimCommand
1663 hi def link vim9Extends Keyword
Doug Kearnsd65e58f2024-07-17 19:34:14 +02001664 hi def link vim9Final vimCommand
1665 hi def link vim9For vimCommand
Doug Kearns1aa287e2025-02-10 22:00:27 +01001666 hi def link vim9ForInComment vim9Comment
Doug Kearns818c6412024-10-06 17:00:48 +02001667 hi def link vim9Implements Keyword
1668 hi def link vim9AbstractDef vimCommand
1669 hi def link vim9Interface vimCommand
Doug Kearns1aa287e2025-02-10 22:00:27 +01001670 hi def link vim9LambdaOperator vimOper
1671 hi def link vim9LambdaOperatorComment vim9Comment
1672 hi def link vim9LambdaParamsParen vimParenSep
1673 hi def link vim9LhsRegister vimLetRegister
1674 hi def link vim9LhsVariable vimVar
Doug Kearnsd65e58f2024-07-17 19:34:14 +02001675 hi def link vim9LineComment vimComment
Doug Kearns818c6412024-10-06 17:00:48 +02001676 hi def link vim9MethodDef vimCommand
1677 hi def link vim9MethodNameError vimFunctionError
Doug Kearnsd65e58f2024-07-17 19:34:14 +02001678 hi def link vim9Null Constant
Doug Kearns818c6412024-10-06 17:00:48 +02001679 hi def link vim9Public vimCommand
Doug Kearnsc273f1a2025-01-20 21:53:01 +01001680 hi def link vim9Search vimString
1681 hi def link vim9SearchDelim Delimiter
Doug Kearns818c6412024-10-06 17:00:48 +02001682 hi def link vim9Static vimCommand
1683 hi def link vim9Super Identifier
1684 hi def link vim9This Identifier
1685 hi def link vim9Type vimCommand
1686 hi def link vim9TypeEquals vimOper
Doug Kearnsd65e58f2024-07-17 19:34:14 +02001687 hi def link vim9Variable vimVar
Doug Kearns818c6412024-10-06 17:00:48 +02001688 hi def link vim9Var vimCommand
Doug Kearnsd65e58f2024-07-17 19:34:14 +02001689 hi def link vim9Vim9ScriptArg Special
Doug Kearns818c6412024-10-06 17:00:48 +02001690 hi def link vim9Vim9Script vimCommand
Doug Kearns025dc482025-02-23 15:48:52 +01001691
1692 hi def link vimCompilerSet vimCommand
1693 hi def link vimSynMenu vimCommand
1694 hi def link vimSynMenuPath vimMenuName
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001695endif
Bram Moolenaar071d4272004-06-13 20:20:40 +00001696
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001697" Current Syntax Variable: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001698let b:current_syntax = "vim"
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001699
1700" ---------------------------------------------------------------------
1701" Cleanup: {{{1
Doug Kearnsd65e58f2024-07-17 19:34:14 +02001702delc Vim9
1703delc VimL
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001704delc VimFolda
Doug Kearns818c6412024-10-06 17:00:48 +02001705delc VimFoldc
1706delc VimFolde
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001707delc VimFoldf
Doug Kearnsce064932024-04-13 18:24:01 +02001708delc VimFoldh
1709delc VimFoldH
Doug Kearns818c6412024-10-06 17:00:48 +02001710delc VimFoldi
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001711delc VimFoldl
1712delc VimFoldm
1713delc VimFoldp
1714delc VimFoldP
1715delc VimFoldr
1716delc VimFoldt
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001717let &cpo = s:keepcpo
dkearns04e53632024-04-11 06:18:37 +10001718unlet s:keepcpo s:vim9script
dkearns5d67aef2024-03-10 04:01:22 +11001719" vim:ts=18 fdm=marker ft=vim