blob: e04429eb035b46471d0da71c29269a10887a10e3 [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>
Hirohito Higashi96b3ef22025-07-05 15:31:23 +02005" Last Change: 2025 Jul 05
Christian Brabandtf9ca1392024-02-19 20:37:11 +01006" Former Maintainer: Charles E. Campbell
h-east9b53c052024-02-13 21:09:22 +01007
8" DO NOT CHANGE DIRECTLY.
9" THIS FILE PARTLY GENERATED BY gen_syntax_vim.vim.
10" (Search string "GEN_SYN_VIM:" in this file)
11
Doug Kearns3dca5122025-03-09 16:30:28 +010012" Quit when a syntax file was already loaded {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +000013if exists("b:current_syntax")
14 finish
15endif
Bram Moolenaar113cb512021-11-07 20:27:04 +000016let s:keepcpo= &cpo
Bram Moolenaar6be7f872012-01-20 21:08:56 +010017set cpo&vim
Bram Moolenaar071d4272004-06-13 20:20:40 +000018
Doug Kearns3dca5122025-03-09 16:30:28 +010019" Feature testing {{{1
20
dkearns04e53632024-04-11 06:18:37 +100021let s:vim9script = "\n" .. getline(1, 32)->join("\n") =~# '\n\s*vim9\%[script]\>'
22
Doug Kearns3dca5122025-03-09 16:30:28 +010023function s:has(feature)
24 return has(a:feature) || index(get(g:, "vimsyn_vim_features", []), a:feature) != -1
25endfunction
26
27" Automatically generated keyword lists: {{{1
28
Bram Moolenaar071d4272004-06-13 20:20:40 +000029" vimTodo: contains common special-notices for comments {{{2
30" Use the vimCommentGroup cluster to add your own.
Bram Moolenaare2719092015-01-10 15:09:25 +010031syn keyword vimTodo contained COMBAK FIXME TODO XXX
Bram Moolenaar217ad922005-03-20 22:37:15 +000032syn cluster vimCommentGroup contains=vimTodo,@Spell
Bram Moolenaar071d4272004-06-13 20:20:40 +000033
34" regular vim commands {{{2
Doug Kearns1718e7d2025-01-08 18:20:47 +010035" GEN_SYN_VIM: vimCommand normal, START_STR='syn keyword vimCommand contained', END_STR='nextgroup=vimBang'
Doug Kearnsa9b5e4a2025-07-03 20:47:50 +020036syn keyword vimCommand contained 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] bf[irst] bl[ast] bm[odified] bn[ext] bp[revious] br[ewind] brea[k] breaka[dd] breakd[el] breakl[ist] 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] clip[reset] 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] cons[t] cope[n] cp[revious] cpf[ile] nextgroup=vimBang
37syn keyword vimCommand contained cq[uit] cr[ewind] cs[cope] cst[ag] cw[indow] d[elete] delm[arks] deb[ug] defc[ompile] defe[r] di[splay] dif[fupdate] diffg[et] diffo[ff] diffp[atch] diffpu[t] diffs[plit] difft[his] dig[raphs] disa[ssemble] dj[ump] dli[st] dr[op] ds[earch] dsp[lit] e[dit] ea[rlier] em[enu] endfo[r] endt[ry] endw[hile] ene[w] ev[al] ex exi[t] exu[sage] f[ile] files filet[ype] fin[d] fina[lly] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] foldd[oopen] folddoc[losed] foldo[pen] g[lobal] go[to] gu[i] gv[im] h[elp] helpc[lose] helpf[ind] helpt[ags] ha[rdcopy] hi[ghlight] his[tory] ij[ump] il[ist] int[ro] ip[ut] is[earch] isp[lit] j[oin] ju[mps] l[ist] lN[ext] lNf[ile] la[st] lab[ove] lan[guage] lad[dexpr] laddb[uffer] laddf[ile] laf[ter] lat[er] lb[uffer] nextgroup=vimBang
38syn keyword vimCommand contained lbe[fore] lbel[ow] lbo[ttom] lc[d] lch[dir] lcl[ose] lcs[cope] ld[o] le[ft] lex[pr] lf[ile] lfd[o] lfir[st] lg[etfile] lgetb[uffer] lgete[xpr] lgr[ep] lgrepa[dd] lhi[story] ll lla[st] lli[st] lmak[e] lne[xt] lnew[er] lnf[ile] lo[adview] lockv[ar] lol[der] lop[en] lp[revious] lpf[ile] lr[ewind] lt[ag] lw[indow] ls m[ove] marks menut[ranslate] mes[sages] mk[exrc] mks[ession] mksp[ell] mkv[imrc] mkvie[w] mod[e] n[ext] nb[key] nbc[lose] nbs[tart] noh[lsearch] nu[mber] o[pen] ol[dfiles] on[ly] opt[ions] ow[nsyntax] p[rint] pa[ckadd] packl[oadall] pb[uffer] pc[lose] ped[it] po[p] pp[op] pre[serve] prev[ious] pro[mptfind] promptr[epl] ps[earch] pt[ag] ptN[ext] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] nextgroup=vimBang
39syn keyword vimCommand contained pw[d] q[uit] quita[ll] qa[ll] r[ead] rec[over] red[o] redr[aw] redraws[tatus] redrawt[abline] redrawtabp[anel] reg[isters] res[ize] ret[ab] rew[ind] ri[ght] ru[ntime] rub[y] rubyd[o] rubyf[ile] rund[o] rv[iminfo] sN[ext] sa[rgument] sal[l] sav[eas] sb[uffer] sbN[ext] sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbp[revious] sbr[ewind] scr[iptnames] scripte[ncoding] scriptv[ersion] scs[cope] setf[iletype] sf[ind] sfir[st] sh[ell] sim[alt] sig[n] sla[st] sn[ext] so[urce] sp[lit] spe[llgood] spelld[ump] spelli[nfo] spellr[epall] spellra[re] spellu[ndo] spellw[rong] spr[evious] sre[wind] st[op] sta[g] star[tinsert] startg[replace] startr[eplace] stopi[nsert] stj[ump] sts[elect] sun[hide] sus[pend] sv[iew] sw[apname] synti[me] sync[bind] nextgroup=vimBang
40syn keyword vimCommand contained smi[le] t tN[ext] ta[g] tags tabc[lose] tabd[o] tabe[dit] tabf[ind] tabfir[st] tabm[ove] tabl[ast] tabn[ext] tabnew tabo[nly] tabp[revious] tabN[ext] tabr[ewind] tabs tc[d] tch[dir] te[aroff] ter[minal] tf[irst] tj[ump] tl[ast] tn[ext] tp[revious] tr[ewind] try ts[elect] u[ndo] undoj[oin] undol[ist] unh[ide] unlo[ckvar] up[date] v[global] ve[rsion] vi[sual] vie[w] viu[sage] vne[w] vs[plit] w[rite] wN[ext] wa[ll] wi[nsize] winc[md] wind[o] winp[os] wl[restore] wn[ext] wp[revious] wq wqa[ll] wu[ndo] wv[iminfo] x[it] xa[ll] xr[estore] y[ank] z dl dell delel deletl deletel dp dep delp delep deletp deletep a i nextgroup=vimBang
41
42" GEN_SYN_VIM: vimCommand modifier, START_STR='syn keyword vimCommandModifier', END_STR='skipwhite nextgroup=vimCommandModifierBang,@vimCmdList'
43syn keyword vimCommandModifier abo[veleft] bel[owright] bo[tright] bro[wse] conf[irm] hid[e] hor[izontal] kee[pmarks] keepj[umps] keepp[atterns] keepa[lt] lefta[bove] leg[acy] loc[kmarks] noa[utocmd] nos[wapfile] rightb[elow] san[dbox] sil[ent] tab to[pleft] uns[ilent] verb[ose] vert[ical] vim9[cmd] skipwhite nextgroup=vimCommandModifierBang,@vimCmdList
44" :filter is handled specially elsewhere
45syn match vimCommandModifierBang contained "\a\@1<=!" skipwhite nextgroup=@vimCmdList
h-east9b53c052024-02-13 21:09:22 +010046
Aliaksei Budaveidfcef892024-02-18 21:02:14 +030047" Lower priority for _new_ to distinguish constructors from the command.
48syn match vimCommand contained "\<new\>(\@!"
Bram Moolenaare2719092015-01-10 15:09:25 +010049syn match vimCommand contained "\<z[-+^.=]\=\>"
h-east9b53c052024-02-13 21:09:22 +010050syn 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 +000051
52" vimOptions are caught only when contained in a vimSet {{{2
Doug Kearnsddbb6fe2024-07-24 20:21:22 +020053" GEN_SYN_VIM: vimOption normal, START_STR='syn keyword vimOption contained', END_STR='skipwhite nextgroup=vimSetEqual,vimSetMod'
Foxe Chenb90c2392025-06-27 21:10:35 +020054syn keyword vimOption contained al aleph ari allowrevins ambw ambiwidth arab arabic arshape arabicshape acd autochdir ai autoindent ar autoread asd autoshelldir aw autowrite awa autowriteall bg background bs backspace bk backup bkc backupcopy bdir backupdir bex backupext bsk backupskip bdlay balloondelay beval ballooneval bevalterm balloonevalterm bexpr balloonexpr bo belloff bin binary bomb brk breakat bri breakindent briopt breakindentopt bsdir browsedir bh bufhidden bl buflisted bt buftype cmp casemap cdh cdhome cd cdpath cedit ccv charconvert chi chistory cin cindent cink cinkeys cino cinoptions cinsd cinscopedecls cinw cinwords cb clipboard cpm clipmethod ch cmdheight cwh cmdwinheight cc colorcolumn co columns com comments cms commentstring cp compatible skipwhite nextgroup=vimSetEqual,vimSetMod
55syn keyword vimOption contained cpt complete cfu completefunc cfc completefuzzycollect cia completeitemalign cot completeopt cpp completepopup csl completeslash cocu concealcursor cole conceallevel cf confirm ci copyindent cpo cpoptions cm cryptmethod cspc cscopepathcomp csprg cscopeprg csqf cscopequickfix csre cscoperelative cst cscopetag csto cscopetagorder csverb cscopeverbose crb cursorbind cuc cursorcolumn cul cursorline culopt cursorlineopt debug def define deco delcombine dict dictionary diff dex diffexpr dip diffopt dg digraph dir directory dy display ead eadirection ed edcompatible emo emoji enc encoding eof endoffile eol endofline ea equalalways ep equalprg eb errorbells ef errorfile efm errorformat ek esckeys ei eventignore eiw eventignorewin et expandtab skipwhite nextgroup=vimSetEqual,vimSetMod
56syn keyword vimOption contained ex exrc fenc fileencoding fencs fileencodings ff fileformat ffs fileformats fic fileignorecase ft filetype fcs fillchars ffu findfunc fixeol fixendofline fcl foldclose fdc foldcolumn fen foldenable fde foldexpr fdi foldignore fdl foldlevel fdls foldlevelstart fmr foldmarker fdm foldmethod fml foldminlines fdn foldnestmax fdo foldopen fdt foldtext fex formatexpr flp formatlistpat fo formatoptions fp formatprg fs fsync gd gdefault gfm grepformat gp grepprg gcr guicursor gfn guifont gfs guifontset gfw guifontwide ghr guiheadroom gli guiligatures go guioptions guipty gtl guitablabel gtt guitabtooltip hf helpfile hh helpheight hlg helplang hid hidden hl highlight hi history hk hkmap hkp hkmapp hls hlsearch icon iconstring ic ignorecase skipwhite nextgroup=vimSetEqual,vimSetMod
57syn keyword vimOption contained imaf imactivatefunc imak imactivatekey imc imcmdline imd imdisable imi iminsert ims imsearch imsf imstatusfunc imst imstyle inc include inex includeexpr is incsearch inde indentexpr indk indentkeys inf infercase im insertmode ise isexpand isf isfname isi isident isk iskeyword isp isprint js joinspaces jop jumpoptions key kmp keymap km keymodel kpc keyprotocol kp keywordprg lmap langmap lm langmenu lnr langnoremap lrm langremap ls laststatus lz lazyredraw lhi lhistory lbr linebreak lines lsp linespace lisp lop lispoptions lw lispwords list lcs listchars lpl loadplugins luadll magic mef makeef menc makeencoding mp makeprg mps matchpairs mat matchtime mco maxcombine mfd maxfuncdepth mmd maxmapdepth mm maxmem mmp maxmempattern mmt maxmemtot skipwhite nextgroup=vimSetEqual,vimSetMod
58syn keyword vimOption contained mis menuitems mopt messagesopt msm mkspellmem ml modeline mle modelineexpr mls modelines ma modifiable mod modified more mouse mousef mousefocus mh mousehide mousem mousemodel mousemev mousemoveevent mouses mouseshape mouset mousetime mzq mzquantum mzschemedll mzschemegcdll nf nrformats nu number nuw numberwidth ofu omnifunc odev opendevice opfunc operatorfunc pp packpath para paragraphs paste pt pastetoggle pex patchexpr pm patchmode pa path perldll pi preserveindent pvh previewheight pvp previewpopup pvw previewwindow pdev printdevice penc printencoding pexpr printexpr pfn printfont pheader printheader pmbcs printmbcharset pmbfn printmbfont popt printoptions prompt ph pumheight pmw pummaxwidth pw pumwidth pythondll pythonhome skipwhite nextgroup=vimSetEqual,vimSetMod
59syn keyword vimOption contained pythonthreedll pythonthreehome pyx pyxversion qftf quickfixtextfunc qe quoteescape ro readonly rdt redrawtime re regexpengine rnu relativenumber remap rop renderoptions report rs restorescreen ri revins rl rightleft rlc rightleftcmd rubydll ru ruler ruf rulerformat rtp runtimepath scr scroll scb scrollbind scf scrollfocus sj scrolljump so scrolloff sbo scrollopt sect sections secure sel selection slm selectmode ssop sessionoptions sh shell shcf shellcmdflag sp shellpipe shq shellquote srr shellredir ssl shellslash stmp shelltemp st shelltype sxe shellxescape sxq shellxquote sr shiftround sw shiftwidth shm shortmess sn shortname sbr showbreak sc showcmd sloc showcmdloc sft showfulltag sm showmatch smd showmode stal showtabline stpl showtabpanel skipwhite nextgroup=vimSetEqual,vimSetMod
60syn keyword vimOption contained ss sidescroll siso sidescrolloff scl signcolumn scs smartcase si smartindent sta smarttab sms smoothscroll sts softtabstop spell spc spellcapcheck spf spellfile spl spelllang spo spelloptions sps spellsuggest sb splitbelow spk splitkeep spr splitright sol startofline stl statusline su suffixes sua suffixesadd swf swapfile sws swapsync swb switchbuf smc synmaxcol syn syntax tcl tabclose tal tabline tpm tabpagemax tpl tabpanel tplo tabpanelopt ts tabstop tbs tagbsearch tc tagcase tfu tagfunc tl taglength tr tagrelative tag tags tgst tagstack tcldll term tbidi termbidi tenc termencoding tgc termguicolors twk termwinkey twsl termwinscroll tws termwinsize twt termwintype terse ta textauto tx textmode tw textwidth tsr thesaurus tsrfu thesaurusfunc skipwhite nextgroup=vimSetEqual,vimSetMod
61syn keyword vimOption contained top tildeop to timeout tm timeoutlen title titlelen titleold titlestring tb toolbar tbis toolbariconsize ttimeout ttm ttimeoutlen tbi ttybuiltin tf ttyfast ttym ttymouse tsl ttyscroll tty ttytype udir undodir udf undofile ul undolevels ur undoreload uc updatecount ut updatetime vsts varsofttabstop vts vartabstop vbs verbose vfile verbosefile vdir viewdir vop viewoptions vi viminfo vif viminfofile ve virtualedit vb visualbell warn wiv weirdinvert ww whichwrap wc wildchar wcm wildcharm wig wildignore wic wildignorecase wmnu wildmenu wim wildmode wop wildoptions wak winaltkeys wcr wincolor wi window wfb winfixbuf wfh winfixheight wfw winfixwidth wh winheight wmh winminheight wmw winminwidth winptydll wiw winwidth wse wlseat wst wlsteal skipwhite nextgroup=vimSetEqual,vimSetMod
62syn keyword vimOption contained wtm wltimeoutlen wrap wm wrapmargin ws wrapscan write wa writeany wb writebackup wd writedelay xtermcodes skipwhite nextgroup=vimSetEqual,vimSetMod
Bram Moolenaar071d4272004-06-13 20:20:40 +000063
64" vimOptions: These are the turn-off setting variants {{{2
h-east9b53c052024-02-13 21:09:22 +010065" GEN_SYN_VIM: vimOption turn-off, START_STR='syn keyword vimOption contained', END_STR=''
66syn 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
67syn 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
Foxe Chenb90c2392025-06-27 21:10:35 +020068syn 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 nowst nowlsteal nowrap nows nowrapscan nowrite
69syn keyword vimOption contained nowa nowriteany nowb nowritebackup noxtermcodes
Bram Moolenaar071d4272004-06-13 20:20:40 +000070
71" vimOptions: These are the invertible variants {{{2
h-east9b53c052024-02-13 21:09:22 +010072" GEN_SYN_VIM: vimOption invertible, START_STR='syn keyword vimOption contained', END_STR=''
73syn 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
74syn 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
75syn 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
Foxe Chenb90c2392025-06-27 21:10:35 +020076syn keyword vimOption contained invtf invttyfast invudf invundofile invvb invvisualbell invwarn invwiv invweirdinvert invwic invwildignorecase invwmnu invwildmenu invwfb invwinfixbuf invwfh invwinfixheight invwfw invwinfixwidth invwst invwlsteal invwrap invws invwrapscan invwrite invwa invwriteany invwb invwritebackup invxtermcodes
Bram Moolenaar071d4272004-06-13 20:20:40 +000077" termcap codes (which can also be set) {{{2
Doug Kearnsddbb6fe2024-07-24 20:21:22 +020078" GEN_SYN_VIM: vimOption term output code, START_STR='syn keyword vimOption contained', END_STR='skipwhite nextgroup=vimSetEqual,vimSetMod'
79syn 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 +010080" term key codes
81syn 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 +010082syn match vimOption contained "t_%1"
Bram Moolenaar071d4272004-06-13 20:20:40 +000083syn match vimOption contained "t_#2"
84syn match vimOption contained "t_#4"
Bram Moolenaar6d5ad4c2016-10-27 17:00:16 +020085syn match vimOption contained "t_@7"
Bram Moolenaarb0d45e72017-11-05 18:19:24 +010086syn match vimOption contained "t_*7"
87syn match vimOption contained "t_&8"
88syn match vimOption contained "t_%i"
Bram Moolenaar071d4272004-06-13 20:20:40 +000089syn match vimOption contained "t_k;"
90
Doug Kearns3dca5122025-03-09 16:30:28 +010091" vimOptions: These are the variable names {{{2
92" GEN_SYN_VIM: vimOption normal variable, START_STR='syn keyword vimOptionVarName contained', END_STR=''
Foxe Chenb90c2392025-06-27 21:10:35 +020093syn keyword vimOptionVarName contained al aleph ari allowrevins ambw ambiwidth arab arabic arshape arabicshape acd autochdir ai autoindent ar autoread asd autoshelldir aw autowrite awa autowriteall bg background bs backspace bk backup bkc backupcopy bdir backupdir bex backupext bsk backupskip bdlay balloondelay beval ballooneval bevalterm balloonevalterm bexpr balloonexpr bo belloff bin binary bomb brk breakat bri breakindent briopt breakindentopt bsdir browsedir bh bufhidden bl buflisted bt buftype cmp casemap cdh cdhome cd cdpath cedit ccv charconvert chi chistory cin cindent cink cinkeys cino cinoptions cinsd cinscopedecls cinw cinwords cb clipboard cpm clipmethod ch cmdheight cwh cmdwinheight cc colorcolumn co columns com comments cms commentstring cp compatible
94syn keyword vimOptionVarName contained cpt complete cfu completefunc cfc completefuzzycollect cia completeitemalign cot completeopt cpp completepopup csl completeslash cocu concealcursor cole conceallevel cf confirm ci copyindent cpo cpoptions cm cryptmethod cspc cscopepathcomp csprg cscopeprg csqf cscopequickfix csre cscoperelative cst cscopetag csto cscopetagorder csverb cscopeverbose crb cursorbind cuc cursorcolumn cul cursorline culopt cursorlineopt debug def define deco delcombine dict dictionary diff dex diffexpr dip diffopt dg digraph dir directory dy display ead eadirection ed edcompatible emo emoji enc encoding eof endoffile eol endofline ea equalalways ep equalprg eb errorbells ef errorfile efm errorformat ek esckeys ei eventignore eiw eventignorewin
95syn keyword vimOptionVarName contained et expandtab ex exrc fenc fileencoding fencs fileencodings ff fileformat ffs fileformats fic fileignorecase ft filetype fcs fillchars ffu findfunc fixeol fixendofline fcl foldclose fdc foldcolumn fen foldenable fde foldexpr fdi foldignore fdl foldlevel fdls foldlevelstart fmr foldmarker fdm foldmethod fml foldminlines fdn foldnestmax fdo foldopen fdt foldtext fex formatexpr flp formatlistpat fo formatoptions fp formatprg fs fsync gd gdefault gfm grepformat gp grepprg gcr guicursor gfn guifont gfs guifontset gfw guifontwide ghr guiheadroom gli guiligatures go guioptions guipty gtl guitablabel gtt guitabtooltip hf helpfile hh helpheight hlg helplang hid hidden hl highlight hi history hk hkmap hkp hkmapp hls hlsearch icon iconstring
96syn keyword vimOptionVarName contained ic ignorecase imaf imactivatefunc imak imactivatekey imc imcmdline imd imdisable imi iminsert ims imsearch imsf imstatusfunc imst imstyle inc include inex includeexpr is incsearch inde indentexpr indk indentkeys inf infercase im insertmode ise isexpand isf isfname isi isident isk iskeyword isp isprint js joinspaces jop jumpoptions key kmp keymap km keymodel kpc keyprotocol kp keywordprg lmap langmap lm langmenu lnr langnoremap lrm langremap ls laststatus lz lazyredraw lhi lhistory lbr linebreak lines lsp linespace lisp lop lispoptions lw lispwords list lcs listchars lpl loadplugins luadll magic mef makeef menc makeencoding mp makeprg mps matchpairs mat matchtime mco maxcombine mfd maxfuncdepth mmd maxmapdepth mm maxmem mmp maxmempattern
Doug Kearnsc29b5332025-04-26 20:14:15 +020097syn keyword vimOptionVarName contained mmt maxmemtot mis menuitems mopt messagesopt msm mkspellmem ml modeline mle modelineexpr mls modelines ma modifiable mod modified more mouse mousef mousefocus mh mousehide mousem mousemodel mousemev mousemoveevent mouses mouseshape mouset mousetime mzq mzquantum mzschemedll mzschemegcdll nf nrformats nu number nuw numberwidth ofu omnifunc odev opendevice opfunc operatorfunc pp packpath para paragraphs paste pt pastetoggle pex patchexpr pm patchmode pa path perldll pi preserveindent pvh previewheight pvp previewpopup pvw previewwindow pdev printdevice penc printencoding pexpr printexpr pfn printfont pheader printheader pmbcs printmbcharset pmbfn printmbfont popt printoptions prompt ph pumheight pmw pummaxwidth pw pumwidth
98syn keyword vimOptionVarName contained pythondll pythonhome pythonthreedll pythonthreehome pyx pyxversion qftf quickfixtextfunc qe quoteescape ro readonly rdt redrawtime re regexpengine rnu relativenumber remap rop renderoptions report rs restorescreen ri revins rl rightleft rlc rightleftcmd rubydll ru ruler ruf rulerformat rtp runtimepath scr scroll scb scrollbind scf scrollfocus sj scrolljump so scrolloff sbo scrollopt sect sections secure sel selection slm selectmode ssop sessionoptions sh shell shcf shellcmdflag sp shellpipe shq shellquote srr shellredir ssl shellslash stmp shelltemp st shelltype sxe shellxescape sxq shellxquote sr shiftround sw shiftwidth shm shortmess sn shortname sbr showbreak sc showcmd sloc showcmdloc sft showfulltag sm showmatch smd showmode
Naruhiko Nishinobe5bd4d2025-05-14 21:20:28 +020099syn keyword vimOptionVarName contained stal showtabline stpl showtabpanel ss sidescroll siso sidescrolloff scl signcolumn scs smartcase si smartindent sta smarttab sms smoothscroll sts softtabstop spell spc spellcapcheck spf spellfile spl spelllang spo spelloptions sps spellsuggest sb splitbelow spk splitkeep spr splitright sol startofline stl statusline su suffixes sua suffixesadd swf swapfile sws swapsync swb switchbuf smc synmaxcol syn syntax tcl tabclose tal tabline tpm tabpagemax tpl tabpanel tplo tabpanelopt ts tabstop tbs tagbsearch tc tagcase tfu tagfunc tl taglength tr tagrelative tag tags tgst tagstack tcldll term tbidi termbidi tenc termencoding tgc termguicolors twk termwinkey twsl termwinscroll tws termwinsize twt termwintype terse ta textauto tx textmode
100syn keyword vimOptionVarName contained tw textwidth tsr thesaurus tsrfu thesaurusfunc top tildeop to timeout tm timeoutlen title titlelen titleold titlestring tb toolbar tbis toolbariconsize ttimeout ttm ttimeoutlen tbi ttybuiltin tf ttyfast ttym ttymouse tsl ttyscroll tty ttytype udir undodir udf undofile ul undolevels ur undoreload uc updatecount ut updatetime vsts varsofttabstop vts vartabstop vbs verbose vfile verbosefile vdir viewdir vop viewoptions vi viminfo vif viminfofile ve virtualedit vb visualbell warn wiv weirdinvert ww whichwrap wc wildchar wcm wildcharm wig wildignore wic wildignorecase wmnu wildmenu wim wildmode wop wildoptions wak winaltkeys wcr wincolor wi window wfb winfixbuf wfh winfixheight wfw winfixwidth wh winheight wmh winminheight wmw winminwidth
Foxe Chenb90c2392025-06-27 21:10:35 +0200101syn keyword vimOptionVarName contained winptydll wiw winwidth wse wlseat wst wlsteal wtm wltimeoutlen wrap wm wrapmargin ws wrapscan write wa writeany wb writebackup wd writedelay xtermcodes
Doug Kearns3dca5122025-03-09 16:30:28 +0100102" GEN_SYN_VIM: vimOption term output code variable, START_STR='syn keyword vimOptionVarName contained', END_STR=''
103syn keyword vimOptionVarName contained t_AB t_AF t_AU t_AL t_al t_bc t_BE t_BD t_cd t_ce t_Ce t_CF t_cl t_cm t_Co t_CS t_Cs t_cs t_CV t_da t_db t_DL t_dl t_ds t_Ds t_EC t_EI t_fs t_fd t_fe t_GP t_IE t_IS t_ke t_ks t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_RF t_RB t_RC t_RI t_Ri t_RK t_RS t_RT t_RV t_Sb t_SC t_se t_Sf t_SH t_SI t_Si t_so t_SR t_sr t_ST t_Te t_te t_TE t_ti t_TI t_Ts t_ts t_u7 t_ue t_us t_Us t_ut t_vb t_ve t_vi t_VS t_vs t_WP t_WS t_XM t_xn t_xs t_ZH t_ZR t_8f t_8b t_8u t_xo
104syn keyword vimOptionVarName contained t_F1 t_F2 t_F3 t_F4 t_F5 t_F6 t_F7 t_F8 t_F9 t_k1 t_K1 t_k2 t_k3 t_K3 t_k4 t_K4 t_k5 t_K5 t_k6 t_K6 t_k7 t_K7 t_k8 t_K8 t_k9 t_K9 t_KA t_kb t_kB t_KB t_KC t_kd t_kD t_KD t_KE t_KF t_KG t_kh t_KH t_kI t_KI t_KJ t_KK t_kl t_KL t_kN t_kP t_kr t_ku
105syn match vimOptionVarName contained "t_%1"
106syn match vimOptionVarName contained "t_#2"
107syn match vimOptionVarName contained "t_#4"
108syn match vimOptionVarName contained "t_@7"
109syn match vimOptionVarName contained "t_*7"
110syn match vimOptionVarName contained "t_&8"
111syn match vimOptionVarName contained "t_%i"
112syn match vimOptionVarName contained "t_k;"
113
Bram Moolenaar03413f42016-04-12 21:07:15 +0200114" unsupported settings: some were supported by vi but don't do anything in vim {{{2
h-east9b53c052024-02-13 21:09:22 +0100115" GEN_SYN_VIM: Missing vimOption, START_STR='syn keyword vimErrSetting contained', END_STR=''
116syn 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
117syn 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
118syn 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 +0000119
Bram Moolenaar80a94a52006-02-23 21:26:58 +0000120" AutoCmd Events {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000121syn case ignore
Doug Kearnsfa3b1042025-04-22 19:48:13 +0200122" GEN_SYN_VIM: vimAutoEvent, START_STR='syn keyword vimAutoEvent contained', END_STR='skipwhite nextgroup=vimAutoEventSep,@vimAutocmdPattern'
Doug Kearnsc29b5332025-04-26 20:14:15 +0200123syn keyword vimAutoEvent contained BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre CmdlineChanged CmdlineEnter CmdlineLeave CmdlineLeavePre CmdUndefined CmdwinEnter CmdwinLeave ColorScheme ColorSchemePre CompleteChanged CompleteDone CompleteDonePre CursorHold CursorHoldI CursorMoved CursorMovedC CursorMovedI DiffUpdated DirChanged DirChangedPre EncodingChanged ExitPre FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre skipwhite nextgroup=vimAutoEventSep,@vimAutocmdPattern
124syn keyword vimAutoEvent contained FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave InsertLeavePre KeyInputPre MenuPopup ModeChanged OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SafeState SafeStateAgain SessionLoadPost SessionWritePost ShellCmdPost ShellFilterPost SigUSR1 SourceCmd SourcePost SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabClosed TabClosedPre TabEnter TabLeave TabNew TermChanged TerminalOpen TerminalWinOpen TermResponse TermResponseAll TextChanged TextChangedI TextChangedP TextChangedT TextYankPost VimEnter VimLeave VimLeavePre VimResized VimResume VimSuspend WinClosed WinEnter WinLeave WinNew WinNewPre WinResized skipwhite nextgroup=vimAutoEventSep,@vimAutocmdPattern
125syn keyword vimAutoEvent contained WinScrolled skipwhite nextgroup=vimAutoEventSep,@vimAutocmdPattern
Doug Kearnsfa3b1042025-04-22 19:48:13 +0200126
127syn keyword vimAutoEvent contained User skipwhite nextgroup=vimUserAutoEvent
zeertzjq8311e7d2025-06-18 18:02:47 +0200128syn match vimUserAutoEvent contained "\<\h\w*\>" skipwhite nextgroup=vimUserAutoEventSep,vimAutocmdMod,vimAutocmdBlock
Bram Moolenaar071d4272004-06-13 20:20:40 +0000129
130" Highlight commonly used Groupnames {{{2
Doug Kearnsc233c2e2025-07-03 20:57:03 +0200131" GEN_SYN_VIM: vimGroup, START_STR='syn keyword vimGroup contained', END_STR=''
132syn keyword vimGroup contained Added Boolean Changed Character Comment Conditional Constant Debug Define Delimiter Error Exception Float Function Identifier Ignore Include Keyword Label Macro Number Operator PreCondit PreProc Removed Repeat Special SpecialChar SpecialComment Statement StorageClass String Structure Tag Todo Type Typedef Underlined
Bram Moolenaar071d4272004-06-13 20:20:40 +0000133
134" Default highlighting groups {{{2
h-east9b53c052024-02-13 21:09:22 +0100135" GEN_SYN_VIM: vimHLGroup, START_STR='syn keyword vimHLGroup contained', END_STR=''
Naruhiko Nishinobe5bd4d2025-05-14 21:20:28 +0200136syn keyword vimHLGroup contained ErrorMsg IncSearch ModeMsg NonText StatusLine StatusLineNC EndOfBuffer VertSplit VisualNOS DiffText DiffTextAdd PmenuSbar TabLineSel TabLineFill TabPanel TabPanelSel TabPanelFill Cursor lCursor QuickFixLine CursorLineSign CursorLineFold CurSearch PmenuKind PmenuKindSel PmenuMatch PmenuMatchSel PmenuExtra PmenuExtraSel PopupSelected MessageWindow PopupNotification Normal Directory LineNr CursorLineNr MoreMsg Question Search SpellBad SpellCap SpellRare SpellLocal PmenuThumb Pmenu PmenuSel SpecialKey Title WarningMsg WildMenu Folded FoldColumn SignColumn Visual DiffAdd DiffChange DiffDelete TabLine CursorColumn CursorLine ColorColumn MatchParen StatusLineTerm StatusLineTermNC ToolbarLine ToolbarButton Menu Tooltip Scrollbar CursorIM
Doug Kearnsc233c2e2025-07-03 20:57:03 +0200137syn keyword vimHLGroup contained ComplMatchIns LineNrAbove LineNrBelow MsgArea Terminal User1 User2 User3 User4 User5 User6 User7 User8 User9
Christian Brabandt393708c2024-05-27 15:50:07 +0200138syn match vimHLGroup contained "\<Conceal\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000139syn case match
140
141" Function Names {{{2
h-east9b53c052024-02-13 21:09:22 +0100142" GEN_SYN_VIM: vimFuncName, START_STR='syn keyword vimFuncName contained', END_STR=''
Doug Kearns8dec6c22025-01-19 14:02:06 +0100143syn keyword vimFuncName contained abs acos add and append appendbufline argc argidx arglistid argv asin assert_beeps assert_equal assert_equalfile assert_exception assert_fails assert_false assert_inrange assert_match assert_nobeep assert_notequal assert_notmatch assert_report assert_true atan atan2 autocmd_add autocmd_delete autocmd_get balloon_gettext balloon_show balloon_split base64_decode base64_encode bindtextdomain blob2list blob2str browse browsedir bufadd bufexists buflisted bufload bufloaded bufname bufnr bufwinid bufwinnr byte2line byteidx byteidxcomp call ceil ch_canread ch_close ch_close_in ch_evalexpr ch_evalraw ch_getbufnr ch_getjob ch_info ch_log ch_logfile ch_open ch_read ch_readblob ch_readraw ch_sendexpr ch_sendraw ch_setoptions ch_status changenr
Doug Kearnsc29b5332025-04-26 20:14:15 +0200144syn keyword vimFuncName contained char2nr charclass charcol charidx chdir cindent clearmatches cmdcomplete_info col complete complete_add complete_check complete_info complete_match confirm copy cos cosh count cscope_connection cursor debugbreak deepcopy delete deletebufline did_filetype diff diff_filler diff_hlID digraph_get digraph_getlist digraph_set digraph_setlist echoraw empty environ err_teapot escape eval eventhandler executable execute exepath exists exists_compiled exp expand expandcmd extend extendnew feedkeys filecopy filereadable filewritable filter finddir findfile flatten flattennew float2nr floor fmod fnameescape fnamemodify foldclosed foldclosedend foldlevel foldtext foldtextresult foreach foreground fullcommand funcref function garbagecollect
Hirohito Higashi96b3ef22025-07-05 15:31:23 +0200145syn keyword vimFuncName contained get getbufinfo getbufline getbufoneline getbufvar getcellpixels getcellwidths getchangelist getchar getcharmod getcharpos getcharsearch getcharstr getcmdcomplpat getcmdcompltype getcmdline getcmdpos getcmdprompt getcmdscreenpos getcmdtype getcmdwintype getcompletion getcompletiontype getcurpos getcursorcharpos getcwd getenv getfontname getfperm getfsize getftime getftype getimstatus getjumplist getline getloclist getmarklist getmatches getmousepos getmouseshape getpid getpos getqflist getreg getreginfo getregion getregionpos getregtype getscriptinfo getstacktrace gettabinfo gettabvar gettabwinvar gettagstack gettext getwininfo getwinpos getwinposx getwinposy getwinvar glob glob2regpat globpath has has_key haslocaldir hasmapto
146syn keyword vimFuncName contained histadd histdel histget histnr hlID hlexists hlget hlset hostname iconv id indent index indexof input inputdialog inputlist inputrestore inputsave inputsecret insert instanceof interrupt invert isabsolutepath isdirectory isinf islocked isnan items job_getchannel job_info job_setoptions job_start job_status job_stop join js_decode js_encode json_decode json_encode keys keytrans len libcall libcallnr line line2byte lispindent list2blob list2str list2tuple listener_add listener_flush listener_remove localtime log log10 luaeval map maparg mapcheck maplist mapnew mapset match matchadd matchaddpos matcharg matchbufline matchdelete matchend matchfuzzy matchfuzzypos matchlist matchstr matchstrlist matchstrpos max menu_info min mkdir mode
147syn keyword vimFuncName contained mzeval nextnonblank ngettext nr2char or pathshorten perleval popup_atcursor popup_beval popup_clear popup_close popup_create popup_dialog popup_filter_menu popup_filter_yesno popup_findecho popup_findinfo popup_findpreview popup_getoptions popup_getpos popup_hide popup_list popup_locate popup_menu popup_move popup_notification popup_setbuf popup_setoptions popup_settext popup_show pow prevnonblank printf prompt_getprompt prompt_setcallback prompt_setinterrupt prompt_setprompt prop_add prop_add_list prop_clear prop_find prop_list prop_remove prop_type_add prop_type_change prop_type_delete prop_type_get prop_type_list pum_getpos pumvisible py3eval pyeval pyxeval rand range readblob readdir readdirex readfile reduce reg_executing
148syn keyword vimFuncName contained reg_recording reltime reltimefloat reltimestr remote_expr remote_foreground remote_peek remote_read remote_send remote_startserver remove rename repeat resolve reverse round rubyeval screenattr screenchar screenchars screencol screenpos screenrow screenstring search searchcount searchdecl searchpair searchpairpos searchpos server2client serverlist setbufline setbufvar setcellwidths setcharpos setcharsearch setcmdline setcmdpos setcursorcharpos setenv setfperm setline setloclist setmatches setpos setqflist setreg settabvar settabwinvar settagstack setwinvar sha256 shellescape shiftwidth sign_define sign_getdefined sign_getplaced sign_jump sign_place sign_placelist sign_undefine sign_unplace sign_unplacelist simplify sin sinh slice
149syn keyword vimFuncName contained sort sound_clear sound_playevent sound_playfile sound_stop soundfold spellbadword spellsuggest split sqrt srand state str2blob str2float str2list str2nr strcharlen strcharpart strchars strdisplaywidth strftime strgetchar stridx string strlen strpart strptime strridx strtrans strutf16len strwidth submatch substitute swapfilelist swapinfo swapname synID synIDattr synIDtrans synconcealed synstack system systemlist tabpagebuflist tabpagenr tabpagewinnr tagfiles taglist tan tanh tempname term_dumpdiff term_dumpload term_dumpwrite term_getaltscreen term_getansicolors term_getattr term_getcursor term_getjob term_getline term_getscrolled term_getsize term_getstatus term_gettitle term_gettty term_list term_scrape term_sendkeys term_setansicolors
150syn keyword vimFuncName contained term_setapi term_setkill term_setrestore term_setsize term_start term_wait terminalprops test_alloc_fail test_autochdir test_feedinput test_garbagecollect_now test_garbagecollect_soon test_getvalue test_gui_event test_ignore_error test_mswin_event test_null_blob test_null_channel test_null_dict test_null_function test_null_job test_null_list test_null_partial test_null_string test_null_tuple test_option_not_set test_override test_refcount test_setmouse test_settime test_srand_seed test_unknown test_void timer_info timer_pause timer_start timer_stop timer_stopall tolower toupper tr trim trunc tuple2list type typename undofile undotree uniq utf16idx values virtcol virtcol2col visualmode wildmenumode win_execute win_findbuf win_getid
151syn keyword vimFuncName contained win_gettype win_gotoid win_id2tabwin win_id2win win_move_separator win_move_statusline win_screenpos win_splitmove winbufnr wincol windowsversion winheight winlayout winline winnr winrestcmd winrestview winsaveview winwidth wordcount writefile xor
Doug Kearns3dca5122025-03-09 16:30:28 +0100152" Predefined variable names {{{2
153" GEN_SYN_VIM: vimVarName, START_STR='syn keyword vimVimVarName contained', END_STR=''
154syn keyword vimVimVarName contained count count1 prevcount errmsg warningmsg statusmsg shell_error this_session version lnum termresponse fname lang lc_time ctype charconvert_from charconvert_to fname_in fname_out fname_new fname_diff cmdarg foldstart foldend folddashes foldlevel progname servername dying exception throwpoint register cmdbang insertmode val key profiling fcs_reason fcs_choice beval_bufnr beval_winnr beval_winid beval_lnum beval_col beval_text scrollstart swapname swapchoice swapcommand char mouse_win mouse_winid mouse_lnum mouse_col operator searchforward hlsearch oldfiles windowid progpath completed_item option_new option_old option_oldlocal option_oldglobal option_command option_type errors false true none null numbermax numbermin numbersize
Foxe Chenb90c2392025-06-27 21:10:35 +0200155syn keyword vimVimVarName contained vim_did_enter testing t_number t_string t_func t_list t_dict t_float t_bool t_none t_job t_channel t_blob t_class t_object termrfgresp termrbgresp termu7resp termstyleresp termblinkresp event versionlong echospace argv collate exiting colornames sizeofint sizeoflong sizeofpointer maxcol python3_version t_typealias t_enum t_enumvalue stacktrace t_tuple wayland_display clipmethod
Bram Moolenaar071d4272004-06-13 20:20:40 +0000156
Doug Kearns3dca5122025-03-09 16:30:28 +0100157"--- syntax here and above generated by runtime/syntax/generator/gen_syntax_vim.vim ---
158
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000159" Special Vim Highlighting (not automatic) {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000160
Doug Kearns3dca5122025-03-09 16:30:28 +0100161" Neovim keyword list additions {{{2
162
163if s:has("nvim")
164 syn keyword vimOptionVarName contained channel inccommand mousescroll pumblend redrawdebug scrollback shada shadafile statuscolumn termpastefilter termsync winbar winblend winhighlight
165 syn keyword vimVimVarName contained lua msgpack_types relnum stderr termrequest virtnum
166endif
167
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200168" Set up commands for this syntax highlighting file {{{2
169
170com! -nargs=* Vim9 execute <q-args> s:vim9script ? "" : "contained"
171com! -nargs=* VimL execute <q-args> s:vim9script ? "contained" : ""
172
Doug Kearns818c6412024-10-06 17:00:48 +0200173if exists("g:vimsyn_folding") && g:vimsyn_folding =~# '[acefhiHlmpPrt]'
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200174 if g:vimsyn_folding =~# 'a'
175 com! -nargs=* VimFolda <args> fold
176 else
177 com! -nargs=* VimFolda <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100178 endif
Doug Kearns818c6412024-10-06 17:00:48 +0200179 if g:vimsyn_folding =~# 'c'
180 com! -nargs=* VimFoldc <args> fold
181 else
182 com! -nargs=* VimFoldc <args>
183 endif
184 if g:vimsyn_folding =~# 'e'
185 com! -nargs=* VimFolde <args> fold
186 else
187 com! -nargs=* VimFolde <args>
188 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200189 if g:vimsyn_folding =~# 'f'
190 com! -nargs=* VimFoldf <args> fold
191 else
192 com! -nargs=* VimFoldf <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100193 endif
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100194 if g:vimsyn_folding =~# 'h'
195 com! -nargs=* VimFoldh <args> fold
196 else
197 com! -nargs=* VimFoldh <args>
198 endif
Doug Kearnsce064932024-04-13 18:24:01 +0200199 if g:vimsyn_folding =~# 'H'
200 com! -nargs=* VimFoldH <args> fold
201 else
202 com! -nargs=* VimFoldH <args>
203 endif
Doug Kearns818c6412024-10-06 17:00:48 +0200204 if g:vimsyn_folding =~# 'i'
205 com! -nargs=* VimFoldi <args> fold
206 else
207 com! -nargs=* VimFoldi <args>
208 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200209 if g:vimsyn_folding =~# 'l'
210 com! -nargs=* VimFoldl <args> fold
211 else
212 com! -nargs=* VimFoldl <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100213 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200214 if g:vimsyn_folding =~# 'm'
215 com! -nargs=* VimFoldm <args> fold
216 else
217 com! -nargs=* VimFoldm <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100218 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200219 if g:vimsyn_folding =~# 'p'
220 com! -nargs=* VimFoldp <args> fold
221 else
222 com! -nargs=* VimFoldp <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100223 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200224 if g:vimsyn_folding =~# 'P'
225 com! -nargs=* VimFoldP <args> fold
226 else
227 com! -nargs=* VimFoldP <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100228 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200229 if g:vimsyn_folding =~# 'r'
230 com! -nargs=* VimFoldr <args> fold
231 else
232 com! -nargs=* VimFoldr <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100233 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200234 if g:vimsyn_folding =~# 't'
235 com! -nargs=* VimFoldt <args> fold
236 else
237 com! -nargs=* VimFoldt <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100238 endif
239else
240 com! -nargs=* VimFolda <args>
Doug Kearns818c6412024-10-06 17:00:48 +0200241 com! -nargs=* VimFoldc <args>
242 com! -nargs=* VimFolde <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100243 com! -nargs=* VimFoldf <args>
Doug Kearns818c6412024-10-06 17:00:48 +0200244 com! -nargs=* VimFoldi <args>
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100245 com! -nargs=* VimFoldh <args>
Doug Kearnsce064932024-04-13 18:24:01 +0200246 com! -nargs=* VimFoldH <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100247 com! -nargs=* VimFoldl <args>
248 com! -nargs=* VimFoldm <args>
249 com! -nargs=* VimFoldp <args>
250 com! -nargs=* VimFoldP <args>
251 com! -nargs=* VimFoldr <args>
252 com! -nargs=* VimFoldt <args>
253endif
254
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000255" Deprecated variable options {{{2
256if exists("g:vim_minlines")
257 let g:vimsyn_minlines= g:vim_minlines
258endif
259if exists("g:vim_maxlines")
260 let g:vimsyn_maxlines= g:vim_maxlines
261endif
262if exists("g:vimsyntax_noerror")
263 let g:vimsyn_noerror= g:vimsyntax_noerror
264endif
265
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200266" Nulls {{{2
267" =====
268Vim9 syn keyword vim9Null null null_blob null_channel null_class null_dict null_function null_job null_list null_object null_partial null_string
269
270" Booleans {{{2
271" ========
272Vim9 syn keyword vim9Boolean true false
273
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000274" Numbers {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000275" =======
dkearns5cd86c62024-03-12 07:40:58 +1100276syn case ignore
Doug Kearnse957cba2025-05-04 21:01:18 +0200277syn match vimNumber "\<\d\+\%('\d\+\)*" skipwhite nextgroup=@vimComment,vimSubscript,vimGlobal,vimSubst1
278syn match vimNumber "\<\d\+\%('\d\+\)*\.\d\+\%(e[+-]\=\d\+\)\=" skipwhite nextgroup=@vimComment
279syn match vimNumber "\<0b[01]\+\%('[01]\+\)*" skipwhite nextgroup=@vimComment,vimSubscript
280syn match vimNumber "\<0o\=\o\+\%('\o\+\)*" skipwhite nextgroup=@vimComment,vimSubscript
281syn match vimNumber "\<0x\x\+\%('\x\+\)*" skipwhite nextgroup=@vimComment,vimSubscript
282syn match vimNumber '\<0z\>' skipwhite nextgroup=@vimComment
283syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=@vimComment,vimSubscript
dkearns5cd86c62024-03-12 07:40:58 +1100284syn case match
Bram Moolenaar071d4272004-06-13 20:20:40 +0000285
Bram Moolenaar6c1e1572019-06-22 02:13:00 +0200286" All vimCommands are contained by vimIsCommand. {{{2
Doug Kearnsc233c2e2025-07-03 20:57:03 +0200287syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutocmd,vimAugroup,vimBehave,vimCall,vimCatch,vimCommandModifier,vimConst,vimDoautocmd,vimDebuggreedy,vimDef,vimDefFold,vimDelcommand,vimDelFunction,@vimEcho,vimElse,vimEnddef,vimEndfunction,vimEndif,vimExecute,vimIsCommand,vimExtCmd,vimExFilter,vimExMark,vimFor,vimFunction,vimFunctionFold,vimGrep,vimGrepAdd,vimGlobal,vimHelpgrep,vimHighlight,vimImport,vimLet,vimLoadkeymap,vimLockvar,vimMake,vimMap,vimMark,vimMatch,vimNotFunc,vimNormal,vimProfdel,vimProfile,vimRedir,vimSet,vimSleep,vimSort,vimSyntax,vimSynColor,vimSynLink,vimThrow,vimUniq,vimUnlet,vimUnlockvar,vimUnmap,vimUserCmd,vimVimgrep,vimVimgrepadd,vimMenu,vimMenutranslate,@vim9CmdList,@vimExUserCmdList,vimLua,vimMzScheme,vimPerl,vimPython,vimPython3,vimPythonX,vimRuby,vimTcl
h-east61397662025-01-03 17:32:54 +0100288syn cluster vim9CmdList contains=vim9Abstract,vim9Class,vim9Const,vim9Enum,vim9Export,vim9Final,vim9For,vim9Interface,vim9Type,vim9Var
Doug Kearns60bd1402025-02-27 19:15:20 +0100289syn match vimCmdSep "\\\@1<!|" skipwhite nextgroup=@vimCmdList,vimSubst1,vimFunc
290syn match vimCmdSep ":\+" skipwhite nextgroup=@vimCmdList,vimSubst1
Doug Kearns4a530a62025-02-03 18:59:09 +0100291syn match vimCount contained "\d\+"
Doug Kearns1718e7d2025-01-08 18:20:47 +0100292syn match vimIsCommand "\<\%(\h\w*\|[23]mat\%[ch]\)\>" nextgroup=vimBang contains=vimCommand
Doug Kearns3c07eb02024-09-02 10:03:37 +0200293syn match vimBang contained "!"
Doug Kearnsc29b5332025-04-26 20:14:15 +0200294syn match vimWhitespace contained "\s\+"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000295
Doug Kearns1aa287e2025-02-10 22:00:27 +0100296syn region vimSubscript contained matchgroup=vimSubscriptBracket start="\[" end="]" nextgroup=vimSubscript contains=@vimExprList
297
298syn match vimVar contained "\<\h[a-zA-Z0-9#_]*\>" nextgroup=vimSubscript contains=vim9Super,vim9This
Doug Kearns3dca5122025-03-09 16:30:28 +0100299syn match vimVar "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>" nextgroup=vimSubscript contains=vimVarScope
300syn match vimVar "\<a:\%(000\|1\=[0-9]\|20\)\>" nextgroup=vimSubscript contains=vimVarScope
301syn match vimFBVar contained "\<[bwglsta]:\h[a-zA-Z0-9#_]*\>" nextgroup=vimSubscript contains=vimVarScope
Doug Kearns1aa287e2025-02-10 22:00:27 +0100302
Doug Kearns3dca5122025-03-09 16:30:28 +0100303" match the scope prefix independently of the retrofitted scope dictionary
304syn match vimVarScope contained "\<[bwglstav]:"
305syn match vimVimVar contained "\<[bwglstav]:\%(\h\|\d\)\@!" nextgroup=vimSubscript
306
307syn match vimVarNameError contained "\<\h\w*\>"
308syn match vimVimVar "\<v:" nextgroup=vimSubscript,vimVimVarName,vimVarNameError
309syn match vimOptionVar "&\%([lg]:\)\=" nextgroup=vimSubscript,vimOptionVarName,vimVarNameError
Doug Kearns1aa287e2025-02-10 22:00:27 +0100310syn cluster vimSpecialVar contains=vimEnvvar,vimLetRegister,vimOptionVar,vimVimVar
311
Doug Kearns274efcc2025-06-10 21:02:43 +0200312Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s\+[-+/*%]\=="
313Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s\+\.\.="
314Vim9 syn match vim9LhsVariable "\s\=\%([bwgt]:\)\=\h[a-zA-Z0-9#_]*\ze\s\+=<<" skipwhite nextgroup=vimLetHeredoc contains=vimVarScope
315Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\[" nextgroup=vimSubscript
316Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\." nextgroup=vimOper contains=vim9Super,vim9This
317Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s*->" contains=vim9Super,vim9This
Doug Kearns1aa287e2025-02-10 22:00:27 +0100318
Doug Kearns274efcc2025-06-10 21:02:43 +0200319Vim9 syn match vim9LhsVariableList "\[\_[^]]\+]\ze\s\+[-+/*%]\==" contains=vimVar,@vimSpecialVar
320Vim9 syn match vim9LhsVariableList "\[\_[^]]\+]\ze\s\+=<<" skipwhite nextgroup=vimLetHeredoc contains=vimVar,@vimSpecialVar
321Vim9 syn match vim9LhsVariableList "\[\_[^]]\+]\ze\s\+\.\.=" contains=vimVar,@vimSpecialVar
Doug Kearns1aa287e2025-02-10 22:00:27 +0100322
323Vim9 syn match vim9LhsRegister "@["0-9\-a-zA-Z#=*+_/]\ze\s\+\%(\.\.\)\=="
324
325syn cluster vimExprList contains=@vimSpecialVar,vimFunc,vimNumber,vimOper,vimOperParen,vimLambda,vimString,vimVar,@vim9ExprList
326syn cluster vim9ExprList contains=vim9Boolean,vim9LambdaParams,vim9Null
dkearnsb1427b42024-02-28 05:59:30 +1100327
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000328" Insertions And Appends: insert append {{{2
Bram Moolenaar519cc552021-11-16 19:18:26 +0000329" (buftype != nofile test avoids having append, change, insert show up in the command window)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000330" =======================
Bram Moolenaar519cc552021-11-16 19:18:26 +0000331if &buftype != 'nofile'
dkearns4ba70ca2024-04-15 04:32:56 +1000332 syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=a\%[ppend]$" matchgroup=vimCommand end="^\.$" extend
333 syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=c\%[hange]$" matchgroup=vimCommand end="^\.$" extend
334 syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=i\%[nsert]$" matchgroup=vimCommand end="^\.$" extend
Bram Moolenaar519cc552021-11-16 19:18:26 +0000335endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000336
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000337" Behave! {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000338" =======
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100339if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_nobehaveerror")
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000340 syn match vimBehaveError contained "[^ ]\+"
341endif
Doug Kearnsfe6d5b02024-02-14 21:17:43 +0100342syn match vimBehave "\<be\%[have]\>" nextgroup=vimBehaveBang,vimBehaveModel,vimBehaveError skipwhite
343syn match vimBehaveBang contained "\a\@1<=!" nextgroup=vimBehaveModel skipwhite
344syn keyword vimBehaveModel contained mswin xterm
Bram Moolenaar071d4272004-06-13 20:20:40 +0000345
Doug Kearns99984fc2024-07-18 20:45:19 +0200346" Call {{{2
347" ====
348syn match vimCall "\<call\=\>" skipwhite nextgroup=vimFunc
349
Doug Kearnsa9c06422025-02-12 20:44:17 +0100350" Debuggreedy {{{2
Doug Kearns4a530a62025-02-03 18:59:09 +0100351" ===========
352" TODO: special-cased until generalised range/count support is implemented
353syn match vimDebuggreedy "\<0\=debugg\%[reedy]\>" contains=vimCount
354
dkearnsa3bddb72024-06-14 01:48:10 +1000355" Exception Handling {{{2
356syn keyword vimThrow th[row] skipwhite nextgroup=@vimExprList
357syn keyword vimCatch cat[ch] skipwhite nextgroup=vimCatchPattern
358syn region vimCatchPattern contained matchgroup=Delimiter start="\z([!#$%&'()*+,-./:;<=>?@[\]^_`{}~]\)" skip="\\\\\|\\\z1" end="\z1" contains=@vimSubstList oneline
359
Doug Kearns818c6412024-10-06 17:00:48 +0200360" Export {{{2
361" ======
362if s:vim9script
363 syn keyword vim9Export export skipwhite nextgroup=vim9Abstract,vim9ClassBody,vim9Const,vim9Def,vim9EnumBody,vim9Final,vim9InterfaceBody,vim9Type,vim9Var
364endif
365
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000366" Filetypes {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000367" =========
Bram Moolenaar293ee4d2004-12-09 21:34:53 +0000368syn match vimFiletype "\<filet\%[ype]\(\s\+\I\i*\)*" skipwhite contains=vimFTCmd,vimFTOption,vimFTError
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100369if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_vimFTError")
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000370 syn match vimFTError contained "\I\i*"
371endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000372syn keyword vimFTCmd contained filet[ype]
373syn keyword vimFTOption contained detect indent off on plugin
374
Doug Kearns7b5550f2025-05-18 20:37:34 +0200375" Import {{{2
376" ======
377syn keyword vimImportAutoload contained autoload skipwhite nextgroup=vimImportFilename
378if s:vim9script
379 syn region vimImportFilename contained
380 \ start="\S"
381 \ skip=+\%#=1
382 "\ continuation operators at SOL
383 \\n\%(\s*#.*\n\)*\s*\%([[:punct:]]\+\&[^#"'(]\)
384 \\|
385 "\ continuation operators at EOL
386 \\%(\%([[:punct:]]\+\&[^#"')]\)\s*\%(#.*\)\=\)\@<=$
387 \\|
388 \\n\%(\s*#.*\n\)*\s*as\s
389 \\|
390 \\%(^\s*#.*\)\@<=$
391 \\|
Doug Kearns99b98472025-06-20 18:59:21 +0200392 \\n\s*\%(\\\|#\\ \)
Doug Kearns7b5550f2025-05-18 20:37:34 +0200393 \+
394 \ matchgroup=vimCommand
395 \ end="\s\+\zsas\ze\s\+\h"
396 \ matchgroup=NONE
397 \ end="$"
398 \ skipwhite nextgroup=vimImportName
399 \ contains=@vim9Continue,@vimExprList,vim9Comment
400 \ transparent
401else
402 syn region vimImportFilename contained
403 \ start="\S"
Doug Kearns99b98472025-06-20 18:59:21 +0200404 \ skip=+\n\s*\%(\\\|"\\ \)+
Doug Kearns7b5550f2025-05-18 20:37:34 +0200405 \ matchgroup=vimCommand
406 \ end="\s\+\zsas\ze\s\+\h"
407 \ matchgroup=NONE
408 \ end="$"
409 \ skipwhite nextgroup=vimImportName
410 \ contains=@vimContinue,@vimExprList
411 \ transparent
412endif
413syn match vimImportName contained "\%(\<as\s\+\)\@<=\h\w*\>" skipwhite nextgroup=@vimComment
414syn match vimImport "\<imp\%[ort]\>" skipwhite nextgroup=vimImportAutoload,vimImportFilename
415
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000416" Augroup : vimAugroupError removed because long augroups caused sync'ing problems. {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000417" ======= : Trade-off: Increasing synclines with slower editing vs augroup END error checking.
Doug Kearns1aa287e2025-02-10 22:00:27 +0100418syn cluster vimAugroupList contains=@vimCmdList,vimFilter,vimFunc,vimLineComment,vimSpecFile,vimOper,vimNumber,vimOperParen,@vimComment,vimString,vimSubst,vimRegister,vimCmplxRepeat,vimNotation,vimCtrlChar,vimContinue
Doug Kearnsfa3b1042025-04-22 19:48:13 +0200419
420" define
421VimFolda syn region vimAugroup
422 \ start="\<aug\%[roup]\>\ze\s\+\%([eE][nN][dD]\)\@!\S\+"
423 \ matchgroup=vimAugroupKey
424 \ end="\<aug\%[roup]\>\ze\s\+[eE][nN][dD]\>"
425 \ skipwhite nextgroup=vimAugroupEnd
426 \ contains=vimAutocmd,@vimAugroupList,vimAugroupkey
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100427if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noaugrouperror")
Doug Kearnsfa3b1042025-04-22 19:48:13 +0200428 syn match vimAugroupError "\<aug\%[roup]\>\s\+[eE][nN][dD]\>"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000429endif
dkearnsc4aef9a2024-03-04 02:42:47 +1100430
Doug Kearnsfa3b1042025-04-22 19:48:13 +0200431" TODO: Vim9 comment
432syn match vimAugroupName contained "\%(\\["|[:space:]]\|[^"|[:space:]]\)\+"
Doug Kearnsc29b5332025-04-26 20:14:15 +0200433 \ skipwhite nextgroup=vimCmdSep,vimComment
434syn match vimAugroupEnd contained "\c\<END\>" skipwhite nextgroup=vimCmdSep,vimComment
Doug Kearnsfa3b1042025-04-22 19:48:13 +0200435syn match vimAugroupBang contained "\a\@1<=!" skipwhite nextgroup=vimAugroupName
436syn keyword vimAugroupKey contained aug[roup] skipwhite nextgroup=vimAugroupBang,vimAugroupName,vimAugroupEnd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000437
Doug Kearnsfa3b1042025-04-22 19:48:13 +0200438" remove
Eisuke Kawashima6acca4b2025-06-07 17:55:58 +0200439syn match vimAugroup "\<aug\%[roup]!" skipwhite nextgroup=vimAugroupName contains=vimAugroupKey,vimAugroupBang
Doug Kearnsfa3b1042025-04-22 19:48:13 +0200440
441" list
442VimL syn match vimAugroup "\<aug\%[roup]\>\ze\s*\%(["|]\|$\)" skipwhite nextgroup=vimCmdSep,vimComment contains=vimAugroupKey
443Vim9 syn match vimAugroup "\<aug\%[roup]\>\ze\s*\%([#|]\|$\)" skipwhite nextgroup=vimCmdSep,vim9Comment contains=vimAugroupKey
444
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000445" Operators: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000446" =========
Doug Kearnsb9ffbf52025-04-27 19:17:06 +0200447syn cluster vimOperGroup contains=@vimContinue,@vimExprList,vim9Comment,vim9LineComment,vimContinueString
Doug Kearns1aa287e2025-02-10 22:00:27 +0100448syn match vimOper "\a\@<!!" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimSpecFile
449syn match vimOper "||\|&&\|[-+*/%.]" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimSpecFile
Doug Kearnsc29b5332025-04-26 20:14:15 +0200450syn match vimOper "?" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimContinueString
Doug Kearnsc273f1a2025-01-20 21:53:01 +0100451" distinguish ternary : from ex-colon
Doug Kearnsc29b5332025-04-26 20:14:15 +0200452syn match vimOper "\s\@1<=:\ze\s\|\s\@1<=:$" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimContinueString
453syn match vimOper "??" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimContinueString
454syn match vimOper "=" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimContinueString,vimSpecFile
455syn match vimOper "\%#=1\%(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\)[?#]\=" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimContinueString,vimSpecFile
456syn match vimOper "\<is\%(not\)\=\>" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimContinueString,vimSpecFile
457syn match vimOper "\<is\%(not\)\=[?#]" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimContinueString,vimSpecFile
Doug Kearns1aa287e2025-02-10 22:00:27 +0100458syn region vimOperParen matchgroup=vimParenSep start="(" end=")" contains=@vimOperGroup nextgroup=vimSubscript
459syn region vimOperParen matchgroup=vimSep start="#\={" end="}" contains=@vimOperGroup nextgroup=vimSubscript,vimVar
460syn region vimOperParen contained matchgroup=vimSep start="\[" end="]" contains=@vimOperGroup nextgroup=vimSubscript,vimVar
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100461if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noopererror")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100462 syn match vimOperError ")"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000463endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000464
Doug Kearnsc29b5332025-04-26 20:14:15 +0200465syn match vimOperContinue contained "^\s*\\" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList contains=vimWhitespace
466syn match vimOperContinueComment contained '^\s*["#]\\ .*' skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList contains=vimWhitespace
Doug Kearns1aa287e2025-02-10 22:00:27 +0100467syn cluster vimOperContinue contains=vimOperContinue,vimOperContinueComment
468
469" Lambda Expressions: {{{2
470" ==================
471syn match vimLambdaOperator contained "->" skipwhite nextgroup=@vimExprList
Doug Kearns722fbd12025-03-28 19:36:37 +0100472syn region vimLambda contained
473 \ matchgroup=vimLambdaBrace
474 \ start=+{\ze[[:space:][:alnum:]_.,]*\%(\n\s*\%(\\[[:space:][:alnum:]_.,]*\|"\\ .*\)\)*->+
475 \ skip=+\n\s*\%(\\\|"\\ \)+
476 \ end="}" end="$"
477 \ contains=@vimContinue,@vimExprList,vimLambdaParams
Doug Kearns51289202025-06-11 21:16:14 +0200478syn match vimLambdaParams contained "\%({\n\=\)\@1<=\_.\{-}\%(->\)\@=" nextgroup=vimLambdaOperator contains=@vimContinue,vimFunctionParam
Doug Kearns1aa287e2025-02-10 22:00:27 +0100479
Doug Kearns722fbd12025-03-28 19:36:37 +0100480syn match vim9LambdaOperator contained "=>" skipwhite skipempty nextgroup=@vimExprList,vim9LambdaBlock,vim9LambdaOperatorComment
481syn match vim9LambdaParen contained "[()]"
482syn match vim9LambdaParams contained
483 \ "(\%(\<func(\|[^(]\)*\%(\n\s*\\\%(\<func(\|[^(]\)*\|\n\s*#\\ .*\)*\ze\s\+=>"
484 \ skipwhite nextgroup=vim9LambdaOperator
485 \ contains=@vim9Continue,vimDefParam,vim9LambdaParen,vim9LambdaReturnType
486syn region vim9LambdaReturnType contained start=")\@<=:\s" end="\ze\s*#" end="\ze\s*=>" contains=@vim9Continue,@vimType transparent
487syn region vim9LambdaBlock contained matchgroup=vimSep start="{" end="^\s*\zs}" contains=@vimDefBodyList
Doug Kearns1aa287e2025-02-10 22:00:27 +0100488
489syn match vim9LambdaOperatorComment contained "#.*" skipwhite skipempty nextgroup=@vimExprList,vim9LambdaBlock,vim9LambdaOperatorComment
490
dkearns4ba70ca2024-04-15 04:32:56 +1000491" Functions: Tag is provided for those who wish to highlight tagged functions {{{2
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000492" =========
Doug Kearns51289202025-06-11 21:16:14 +0200493syn cluster vimFunctionBodyCommon contains=@vimCmdList,vimCmplxRepeat,vimContinue,vimCtrlChar,vimDef,vimFBVar,vimFunc,vimFunction,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegister,vimSpecFile,vimString,vimSubst,vimFunctionFold,vimDefFold,vimCmdSep
494syn cluster vimFunctionBodyList contains=@vimFunctionBodyCommon,vimComment,vimLineComment,vimInsert,vimConst,vimLet,vimSearch
495syn cluster vimDefBodyList contains=@vimFunctionBodyCommon,vim9Comment,vim9LineComment,vim9Block,vim9Const,vim9Final,vim9Var,vim9Null,vim9Boolean,vim9For,vim9LhsVariable,vim9LhsVariableList,vim9LhsRegister,vim9Search,@vimSpecialVar
dkearns4ba70ca2024-04-15 04:32:56 +1000496
Doug Kearns51289202025-06-11 21:16:14 +0200497syn region vimFunctionPattern contained
498 \ matchgroup=vimOper
499 \ start="/"
Doug Kearnsdd3f1c02025-03-17 20:27:13 +0100500 \ end="$"
Doug Kearns51289202025-06-11 21:16:14 +0200501 \ contains=@vimSubstList
502
503syn match vimFunctionBang contained "\a\@1<=!" skipwhite nextgroup=vimFunctionName
504syn match vimDefBang contained "\a\@1<=!" skipwhite nextgroup=vimDefName
505syn match vimFunctionSID contained "\c<sid>"
506syn match vimFunctionScope contained "\<[bwglstav]:"
507syn match vimFunctionName contained
508 \ "\%(<[sS][iI][dD]>\|[bwglstav]:\)\=\%([[:alnum:]_#.]\+\|{.\{-1,}}\)\+"
509 \ skipwhite nextgroup=vimFunctionParams,vimCmdSep,vimComment,vim9Comment
510 \ contains=vimFunctionError,vimFunctionScope,vimFunctionSID,Tag
511syn match vimDefName contained
512 \ "\%(<[sS][iI][dD]>\|[bwglstav]:\)\=\%([[:alnum:]_#.]\+\|{.\{-1,}}\)\+"
513 \ nextgroup=vimDefParams,vimCmdSep,vimComment,vim9Comment
514 \ contains=vimFunctionError,vimFunctionScope,vimFunctionSID,Tag
515
516syn match vimFunction "\<fu\%[nction]\>" skipwhite nextgroup=vimFunctionBang,vimFunctionName,vimFunctionPattern,vimCmdSep,vimComment
517syn match vimDef "\<def\>" skipwhite nextgroup=vimDefBang,vimDefName,vimFunctionPattern,vimCmdSep,vimComment
518
519syn region vimFunctionComment contained
520 \ start=+".*+
521 \ skip=+\n\s*\%(\\\|"\\ \)+
522 \ end="$"
523 \ skipwhite skipempty nextgroup=vimFunctionBody,vimEndfunction
Doug Kearnsdd3f1c02025-03-17 20:27:13 +0100524syn region vimDefComment contained
525 \ start="#.*"
Doug Kearns51289202025-06-11 21:16:14 +0200526 \ skip=+\n\s*\%(\\\|#\\ \)+
Doug Kearnsdd3f1c02025-03-17 20:27:13 +0100527 \ end="$"
528 \ skipwhite skipempty nextgroup=vimDefBody,vimEnddef
dkearns35e6f4c2024-03-22 06:41:10 +1100529
Doug Kearns51289202025-06-11 21:16:14 +0200530syn region vimFunctionParams contained
531 \ matchgroup=Delimiter
532 \ start="("
533 \ skip=+\n\s*\%(\\\|"\\ \)+
534 \ end=")"
535 \ skipwhite skipempty nextgroup=vimFunctionBody,vimFunctionComment,vimEndfunction,vimFunctionMod,vim9CommentError
536 \ contains=vimFunctionParam,vimOperParen,@vimContinue
537syn region vimDefParams contained
538 \ matchgroup=Delimiter
539 \ start="("
540 \ end=")"
541 \ skipwhite skipempty nextgroup=vimDefBody,vimDefComment,vimEnddef,vimReturnType,vimCommentError
542 \ contains=vimDefParam,vim9Comment,vimFunctionParamEquals,vimOperParen
543syn match vimFunctionParam contained "\<\h\w*\>\|\.\.\." skipwhite nextgroup=vimFunctionParamEquals
544syn match vimDefParam contained "\<\h\w*\>" skipwhite nextgroup=vimParamType,vimFunctionParamEquals
dkearns35e6f4c2024-03-22 06:41:10 +1100545
Doug Kearns51289202025-06-11 21:16:14 +0200546syn match vimFunctionParamEquals contained "=" skipwhite nextgroup=@vimExprList
547syn match vimFunctionMod contained "\<\%(abort\|closure\|dict\|range\)\>" skipwhite skipempty nextgroup=vimFunctionBody,vimFunctionComment,vimEndfunction,vimFunctionMod,vim9CommentError
dkearns35e6f4c2024-03-22 06:41:10 +1100548
Doug Kearns51289202025-06-11 21:16:14 +0200549syn region vimFunctionBody contained
550 \ start="^."
551 \ matchgroup=vimCommand
552 \ end="\<endfu\%[nction]\>"
553 \ skipwhite nextgroup=vimCmdSep,vimComment,vim9CommentError
554 \ contains=@vimFunctionBodyList
555syn region vimDefBody contained
556 \ start="^."
557 \ matchgroup=vimCommand
558 \ end="\<enddef\>"
559 \ skipwhite nextgroup=vimCmdSep,vim9Comment,vimCommentError
560 \ contains=@vimDefBodyList
dkearns35e6f4c2024-03-22 06:41:10 +1100561
Doug Kearns51289202025-06-11 21:16:14 +0200562syn match vimEndfunction "\<endf\%[unction]\>" skipwhite nextgroup=vimCmdSep,vimComment,vim9CommentError
563syn match vimEnddef "\<enddef\>" skipwhite nextgroup=vimCmdSep,vim9Comment,vimCommentError
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000564
Bram Moolenaarf3913272016-02-25 00:00:01 +0100565if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f'
Doug Kearns51289202025-06-11 21:16:14 +0200566 syn region vimFunctionFold
567 \ start="\<fu\%[nction]!"
568 "\ assume no dict literal in curly-brace name expressions
569 \ start="\<fu\%[nction]\>\s*\%([[:alnum:]_:<>.#]\+\|{.\{-1,}}\)\+\s*("
570 \ end="^\s*:\=\s*endf\%[unction]\>"
571 \ contains=vimFunction
572 \ extend fold keepend transparent
573 syn region vimDefFold
574 \ start="\<def!"
575 "\ assume no dict literal in curly-brace name expressions
576 \ start="\<def\>\s*\%([[:alnum:]_:<>.#]\+\|{.\{-1,}}\)\+("
577 \ end="^\s*:\=\s*enddef\>"
578 \ contains=vimDef
579 \ extend fold keepend transparent
Bram Moolenaarb4ff5182015-11-10 21:15:48 +0100580endif
dkearns35e6f4c2024-03-22 06:41:10 +1100581
Doug Kearns51289202025-06-11 21:16:14 +0200582syn match vimDelfunctionBang contained "\a\@1<=!" skipwhite nextgroup=vimFunctionName
583syn match vimDelfunction "\<delf\%[unction]\>" skipwhite nextgroup=vimDelfunctionBang,vimFunctionName
584
dkearns35e6f4c2024-03-22 06:41:10 +1100585" Types: {{{2
586" =====
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200587
Doug Kearnsdd3f1c02025-03-17 20:27:13 +0100588syn region vimReturnType contained
589 \ start=":\%(\s\|\n\)\@="
590 \ skip=+\n\s*\\\|\n\s*#\\ \|^\s*#\\ +
591 \ end="$"
592 \ matchgroup=vim9Comment
593 "\ allow for legacy script tail comment error
594 \ end="\ze[#"]"
595 \ skipwhite skipempty nextgroup=vimDefBody,vimDefComment,vimEnddef,vimCommentError
596 \ contains=@vim9Continue,@vimType
597 \ transparent
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200598syn match vimParamType contained ":\s" skipwhite skipnl nextgroup=@vimType contains=vimTypeSep
dkearns35e6f4c2024-03-22 06:41:10 +1100599
Doug Kearnsdd3f1c02025-03-17 20:27:13 +0100600syn match vimTypeSep contained ":\%(\s\|\n\)\@=" skipwhite nextgroup=@vimType
dkearns35e6f4c2024-03-22 06:41:10 +1100601syn keyword vimType contained any blob bool channel float job number string void
Doug Kearns722fbd12025-03-28 19:36:37 +0100602syn match vimType contained "\<\%(func\)\>"
603syn region vimCompoundType contained matchgroup=vimType start="\<func(" end=")" nextgroup=vimTypeSep contains=@vim9Continue,@vimType transparent
604syn region vimCompoundType contained matchgroup=vimType start="\<tuple<" end=">" contains=@vim9Continue,@vimType transparent
605syn region vimCompoundType contained matchgroup=vimType start="\<\%(list\|dict\)<" end=">" contains=@vimType oneline transparent
Doug Kearnsdd3f1c02025-03-17 20:27:13 +0100606syn match vimUserType contained "\<\%(\h\w*\.\)*\u\w*\>"
dkearns35e6f4c2024-03-22 06:41:10 +1100607
608syn cluster vimType contains=vimType,vimCompoundType,vimUserType
Bram Moolenaar4d8f4762021-06-27 15:18:56 +0200609
Doug Kearns818c6412024-10-06 17:00:48 +0200610" Classes, Enums And Interfaces: {{{2
611" =============================
612
613if s:vim9script
Doug Kearns1c580192025-05-01 17:43:17 +0200614
Doug Kearns818c6412024-10-06 17:00:48 +0200615 " Methods {{{3
Doug Kearns1aa287e2025-02-10 22:00:27 +0100616 syn match vim9MethodDef contained "\<def\>" skipwhite nextgroup=vim9MethodDefName,vim9ConstructorDefName
Doug Kearns818c6412024-10-06 17:00:48 +0200617 syn match vim9MethodDefName contained "\<\h\w*\>" nextgroup=vim9MethodDefParams contains=@vim9MethodName
618 syn region vim9MethodDefParams contained
619 \ matchgroup=Delimiter start="(" end=")"
Doug Kearnsdd3f1c02025-03-17 20:27:13 +0100620 \ skipwhite skipnl nextgroup=vim9MethodDefBody,vim9MethodDefComment,vimEnddef,vim9MethodDefReturnType,vimCommentError
Doug Kearns51289202025-06-11 21:16:14 +0200621 \ contains=vimDefParam,vim9Comment,vimFunctionParamEquals
Doug Kearns1aa287e2025-02-10 22:00:27 +0100622
Doug Kearnsadb703e2025-03-23 16:14:20 +0100623 syn match vim9ConstructorDefName contained "\<_\=new\w*\>"
Doug Kearns1aa287e2025-02-10 22:00:27 +0100624 \ nextgroup=vim9ConstructorDefParams
625 \ contains=@vim9MethodName
626 syn match vim9ConstructorDefParam contained "\<\%(this\.\)\=\h\w*\>"
Doug Kearns51289202025-06-11 21:16:14 +0200627 \ skipwhite nextgroup=vimParamType,vimFunctionParamEquals
Doug Kearns1aa287e2025-02-10 22:00:27 +0100628 \ contains=vim9This,vimOper
629 syn region vim9ConstructorDefParams contained
630 \ matchgroup=Delimiter start="(" end=")"
Doug Kearnsdd3f1c02025-03-17 20:27:13 +0100631 \ skipwhite skipnl nextgroup=vim9MethodDefBody,vim9MethodDefComment,vimEnddef,vimCommentError
Doug Kearns51289202025-06-11 21:16:14 +0200632 \ contains=vim9ConstructorDefParam,vim9Comment,vimFunctionParamEquals
Doug Kearns1aa287e2025-02-10 22:00:27 +0100633
Doug Kearns818c6412024-10-06 17:00:48 +0200634 syn region vim9MethodDefReturnType contained
Doug Kearnsdd3f1c02025-03-17 20:27:13 +0100635 \ start=":\%(\s\|\n\)\@="
636 \ skip=+\n\s*\\\|\n\s*#\\ \|^\s*#\\ +
637 \ end="$"
638 \ matchgroup=vim9Comment
639 \ end="\ze#"
640 \ skipwhite skipnl nextgroup=vim9MethodDefBody,vim9MethodDefComment,vimEnddef,vimCommentError
641 \ contains=@vim9Continue,vimType,vimTypeSep
Doug Kearns818c6412024-10-06 17:00:48 +0200642 \ transparent
Doug Kearnsdd3f1c02025-03-17 20:27:13 +0100643
644 syn region vim9MethodDefComment contained
645 \ start="#.*"
646 \ skip=+\n\s*\\\|\n\s*#\\ +
647 \ end="$"
648 \ skipwhite skipempty nextgroup=vim9MethodDefBody,vimEnddef
649
Doug Kearns818c6412024-10-06 17:00:48 +0200650 syn region vim9MethodDefBody contained
651 \ start="^.\=" matchgroup=vimCommand end="\<enddef\>"
652 \ skipwhite nextgroup=vimCmdSep,vim9Comment,vimCommentError
653 \ contains=@vim9MethodDefBodyList
654
655 syn cluster vim9MethodDefBodyList contains=@vimDefBodyList,vim9This,vim9Super
656
657 if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimfunctionerror")
658 syn match vim9MethodNameError contained "\<[a-z0-9]\i\>"
659 endif
Doug Kearnsadb703e2025-03-23 16:14:20 +0100660 syn match vim9MethodName contained "\<_\=new\w*\>"
Doug Kearns818c6412024-10-06 17:00:48 +0200661 syn keyword vim9MethodName contained empty len string
662
663 syn cluster vim9MethodName contains=vim9MethodName,vim9MethodNameError
664
665 if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f'
666 syn region vim9MethodDefFold contained start="\%(^\s*\%(:\=static\s\+\)\=\)\@16<=:\=def\s\+\h\i*(" end="^\s*:\=enddef\>" contains=vim9MethodDef fold keepend extend transparent
Doug Kearnsadb703e2025-03-23 16:14:20 +0100667 syn region vim9MethodDefFold contained start="^\s*:\=def\s\+_\=new\i*(" end="^\s*:\=enddef\>" contains=vim9MethodDef fold keepend extend transparent
Doug Kearns818c6412024-10-06 17:00:48 +0200668 endif
669
670 syn cluster vim9MethodDef contains=vim9MethodDef,vim9MethodDefFold
671
672 " Classes {{{3
673 syn cluster vim9ClassBodyList contains=vim9Abstract,vim9Class,vim9Comment,vim9LineComment,@vim9Continue,@vimExprList,vim9Extends,vim9Implements,@vim9MethodDef,vim9Public,vim9Static,vim9Const,vim9Final,vim9This,vim9Super,vim9Var
674
675 syn match vim9Class contained "\<class\>" skipwhite nextgroup=vim9ClassName
676 syn match vim9ClassName contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9Extends,vim9Implements
677 syn match vim9SuperClass contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9Implements
678 syn match vim9ImplementedInterface contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9InterfaceListComma,vim9Extends
679 syn match vim9InterfaceListComma contained "," skipwhite skipnl nextgroup=vim9ImplementedInterface
680 syn keyword vim9Abstract abstract skipwhite skipnl nextgroup=vim9ClassBody,vim9AbstractDef
681 syn keyword vim9Extends contained extends skipwhite skipnl nextgroup=vim9SuperClass
682 syn keyword vim9Implements contained implements skipwhite skipnl nextgroup=vim9ImplementedInterface
683 syn keyword vim9Public contained public
684 syn keyword vim9Static contained static
Doug Kearns1aa287e2025-02-10 22:00:27 +0100685 " FIXME: don't match as dictionary keys, remove when operators are not
686 " shared between Vim9 and legacy script
687 syn match vim9This contained "\.\@1<!\<this\>:\@!"
688 " super must be folowed by '.'
689 syn match vim9Super contained "\.\@1<!\<super\.\@="
Doug Kearns818c6412024-10-06 17:00:48 +0200690
691 VimFoldc syn region vim9ClassBody start="\<class\>" matchgroup=vimCommand end="\<endclass\>" contains=@vim9ClassBodyList transparent
692
693 " Enums {{{3
Doug Kearns1c580192025-05-01 17:43:17 +0200694 syn cluster vim9EnumBodyList contains=vim9Comment,vim9LineComment,@vim9Continue,vim9Enum,@vimExprList,@vim9MethodDef,vim9Public,vim9Static,vim9Const,vim9Final,vim9This,vim9Var
Doug Kearns818c6412024-10-06 17:00:48 +0200695
Doug Kearns1c580192025-05-01 17:43:17 +0200696 syn match vim9Enum contained "\<enum\>" skipwhite nextgroup=vim9EnumName
697
698 syn match vim9EnumName contained "\<\u\w*\>" skipwhite skipempty nextgroup=vim9EnumNameTrailing,vim9EnumNameEmpty,vim9EnumNameComment,@vim9EnumNameContinue,vim9EnumImplements
699 syn match vim9EnumNameTrailing contained "\S.*"
700 syn region vim9EnumNameComment contained
701 \ start="#" skip="\n\s*\%(\\\|#\\ \)" end="$"
702 \ skipwhite skipempty nextgroup=vim9EnumNameComment,vim9EnumValue
703 \ contains=@vimCommentGroup,vimCommentString
704 " vim9EnumName's "skipempty" should only apply to comments and enum values and not implements clauses
705 syn match vim9EnumNameEmpty contained "^" skipwhite skipempty nextgroup=vim9EnumNameComment,vim9EnumValue
706 " allow line continuation between enum name and "implements"
707 syn match vim9EnumNameContinue contained
708 \ "^\s*\\"
709 \ skipwhite skipnl nextgroup=vim9EnumNameTrailing,vim9EnumNameEmpty,vim9EnumNameComment,@vim9EnumNameContinue,vim9EnumImplements
710 \ contains=vimWhitespace
711 syn match vim9EnumNameContinueComment contained
712 \ "^\s*#\\ .*"
713 \ skipwhite skipnl nextgroup=vim9EnumNameEmpty,vim9EnumNameComment,@vim9EnumNameContinue
714 \ contains=vimWhitespace
715 syn cluster vim9EnumNameContinue contains=vim9EnumNameContinue,vim9EnumNameContinueComment
716
717 " enforce enum value list location
718 syn match vim9EnumValue contained "\<\a\w*\>" nextgroup=vim9EnumValueArgList,vim9EnumValueListComma,vim9Comment
719 syn match vim9EnumValueListComma contained "," skipwhite skipempty nextgroup=vim9EnumValue,vim9EnumValueListCommaComment
720 syn region vim9EnumValueListCommaComment contained
721 \ start="#" skip="\n\s*\%(\\\|#\\ \)" end="$"
722 \ skipwhite skipempty nextgroup=vim9EnumValueListCommaComment,vim9EnumValue
723 \ contains=@vimCommentGroup,vimCommentString
724 syn region vim9EnumValueArgList contained
725 \ matchgroup=vimParenSep start="(" end=")"
726 \ nextgroup=vim9EnumValueListComma
727 \ contains=@vimExprList,vimContinueString,vim9Comment
728
729 syn keyword vim9EnumImplements contained implements skipwhite nextgroup=vim9EnumImplementedInterface
730 syn match vim9EnumImplementedInterface contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9EnumInterfaceListComma,vim9EnumImplementedInterfaceComment,vim9EnumValue
731 syn match vim9EnumInterfaceListComma contained "," skipwhite nextgroup=vim9EnumImplementedInterface
732 syn region vim9EnumImplementedInterfaceComment contained
733 \ start="#" skip="\n\s*\%(\\\|#\\ \)" end="$"
734 \ skipwhite skipempty nextgroup=vim9EnumImplementedInterfaceComment,vim9EnumValue
735 \ contains=@vimCommentGroup,vimCommentString
Doug Kearns818c6412024-10-06 17:00:48 +0200736
737 VimFolde syn region vim9EnumBody start="\<enum\>" matchgroup=vimCommand end="\<endenum\>" contains=@vim9EnumBodyList transparent
738
739 " Interfaces {{{3
740 " TODO: limit to decl only - no init values
741 syn cluster vim9InterfaceBodyList contains=vim9Comment,vim9LineComment,@vim9Continue,vim9Extends,vim9Interface,vim9AbstractDef,vim9Var
742
743 syn match vim9Interface contained "\<interface\>" skipwhite nextgroup=vim9InterfaceName
744 syn match vim9InterfaceName contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9Extends
745
746 syn keyword vim9AbstractDef contained def skipwhite nextgroup=vim9AbstractDefName
747 syn match vim9AbstractDefName contained "\<\h\w*\>" skipwhite nextgroup=vim9AbstractDefParams contains=@vim9MethodName
748 syn region vim9AbstractDefParams contained
749 \ matchgroup=Delimiter start="(" end=")"
750 \ skipwhite skipnl nextgroup=vimDefComment,vim9AbstractDefReturnType,vimCommentError
Doug Kearns51289202025-06-11 21:16:14 +0200751 \ contains=vimDefParam,vim9Comment,vimFunctionParamEquals
Doug Kearns818c6412024-10-06 17:00:48 +0200752 syn region vim9AbstractDefReturnType contained
753 \ start=":\s" end="$" matchgroup=vim9Comment end="\ze[#"]"
754 \ skipwhite skipnl nextgroup=vimDefComment,vimCommentError
755 \ contains=vimTypeSep
756 \ transparent
757
758 VimFoldi syn region vim9InterfaceBody start="\<interface\>" matchgroup=vimCommand end="\<endinterface\>" contains=@vim9InterfaceBodyList transparent
759
Doug Kearns1aa287e2025-02-10 22:00:27 +0100760 " Type Aliases {{{3
Doug Kearns818c6412024-10-06 17:00:48 +0200761 syn match vim9Type "\<ty\%[pe]\>" skipwhite nextgroup=vim9TypeAlias,vim9TypeAliasError
762 syn match vim9TypeAlias contained "\<\u\w*\>" skipwhite nextgroup=vim9TypeEquals
763 syn match vim9TypeEquals contained "=" skipwhite nextgroup=@vimType
764 if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_notypealiaserror")
Doug Kearns1aa287e2025-02-10 22:00:27 +0100765 syn match vim9TypeAliasError contained "\<\l\w*\>" skipwhite nextgroup=vim9TypeEquals
Doug Kearns818c6412024-10-06 17:00:48 +0200766 endif
767endif
768
Doug Kearns1aa287e2025-02-10 22:00:27 +0100769" Blocks: {{{2
770" ======
Doug Kearns1cccdeb2025-06-05 20:23:07 +0200771Vim9 syn region vim9Block
772 \ matchgroup=vimSep
773 \ start="{\ze\s*\%($\|[#|]\)"
774 \ end="^\s*\zs}"
775 \ skipwhite nextgroup=vim9Comment,vimCmdSep
776 \ contains=@vimDefBodyList
Doug Kearns1aa287e2025-02-10 22:00:27 +0100777
dkearns04e53632024-04-11 06:18:37 +1000778" Keymaps: {{{2
dkearns69866442023-11-22 05:43:40 +1100779" =======
780
dkearns04e53632024-04-11 06:18:37 +1000781syn match vimKeymapStart "^" contained skipwhite nextgroup=vimKeymapLhs,@vimKeymapLineComment
dkearns69866442023-11-22 05:43:40 +1100782syn match vimKeymapLhs "\S\+" contained skipwhite nextgroup=vimKeymapRhs contains=vimNotation
783syn match vimKeymapRhs "\S\+" contained skipwhite nextgroup=vimKeymapTailComment contains=vimNotation
784syn match vimKeymapTailComment "\S.*" contained
dkearns04e53632024-04-11 06:18:37 +1000785
786" TODO: remove when :" comment is matched in parts as "ex-colon comment" --djk
787if s:vim9script
788 syn match vim9KeymapLineComment "#.*" contained contains=@vimCommentGroup,vimCommentString,vim9CommentTitle
789else
790 syn match vimKeymapLineComment +".*+ contained contains=@vimCommentGroup,vimCommentString,vimCommentTitle
791endif
792syn cluster vimKeymapLineComment contains=vim9\=KeymapLineComment
dkearns69866442023-11-22 05:43:40 +1100793
Doug Kearns7866d542024-08-23 18:37:55 +0200794syn region vimLoadkeymap matchgroup=vimCommand start="\<loadk\%[eymap]\>" end="\%$" contains=vimKeymapStart
dkearns69866442023-11-22 05:43:40 +1100795
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000796" Special Filenames, Modifiers, Extension Removal: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000797" ===============================================
dkearns2c51e152024-02-27 07:10:18 +1100798syn match vimSpecFile "<c\(word\|WORD\)>" nextgroup=vimSpecFileMod,vimSubst1
799syn match vimSpecFile "<\([acs]file\|amatch\|abuf\)>" nextgroup=vimSpecFileMod,vimSubst1
800syn match vimSpecFile "\s%[ \t:]"ms=s+1,me=e-1 nextgroup=vimSpecFileMod,vimSubst1
801syn match vimSpecFile "\s%$"ms=s+1 nextgroup=vimSpecFileMod,vimSubst1
802syn match vimSpecFile "\s%<"ms=s+1,me=e-1 nextgroup=vimSpecFileMod,vimSubst1
803syn match vimSpecFile "#\d\+\|[#%]<\>" nextgroup=vimSpecFileMod,vimSubst1
Bram Moolenaar5c736222010-01-06 20:54:52 +0100804syn match vimSpecFileMod "\(:[phtre]\)\+" contained
Bram Moolenaar071d4272004-06-13 20:20:40 +0000805
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000806" User-Specified Commands: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000807" =======================
dkearns04e53632024-04-11 06:18:37 +1000808syn cluster vimUserCmdList contains=@vimCmdList,vimCmplxRepeat,@vimComment,vimCtrlChar,vimEscapeBrace,vimFunc,vimNotation,vimNumber,vimOper,vimRegister,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange
Doug Kearns520a2c72025-04-08 20:50:00 +0200809
810syn match vimUserCmd "\<com\%[mand]\>!\=" skipwhite nextgroup=vimUserCmdAttrs,vimUserCmdName contains=vimBang
811syn match vimUserCmd +\<com\%[mand]\>!\=\ze\s*\n\s*\%(\\\|["#]\\ \)+ skipwhite skipnl nextgroup=vimUserCmdAttrs,vimUserCmdName contains=vimBang
812
813syn region vimUserCmdAttrs contained
814 \ start="-\l"
815 \ start=+^\s*\%(\\\|["#]\\ \)+
816 \ end="\ze\s\u"
817 \ skipwhite nextgroup=vimUserCmdName
818 \ contains=@vimContinue,vimUserCmdAttr,vimUserCmdAttrError
819 \ transparent
820syn match vimUserCmdAttrError contained "-\a\+\ze\%(\s\|=\)"
821syn match vimUserCmdAttr contained "-addr=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrAddr
822syn match vimUserCmdAttr contained "-bang\>" contains=vimUserCmdAttrKey
823syn match vimUserCmdAttr contained "-bar\>" contains=vimUserCmdAttrKey
824syn match vimUserCmdAttr contained "-buffer\>" contains=vimUserCmdAttrKey
825syn match vimUserCmdAttr contained "-complete=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrComplete,vimUserCmdError
826syn match vimUserCmdAttr contained "-count\>" contains=vimUserCmdAttrKey
827syn match vimUserCmdAttr contained "-count=" contains=vimUserCmdAttrKey nextgroup=vimNumber
828syn match vimUserCmdAttr contained "-keepscript\>" contains=vimUserCmdAttrKey
829syn match vimUserCmdAttr contained "-nargs=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrNargs
830syn match vimUserCmdAttr contained "-range\>" contains=vimUserCmdAttrKey
831syn match vimUserCmdAttr contained "-range=" contains=vimUserCmdAttrKey nextgroup=vimNumber,vimUserCmdAttrRange
832syn match vimUserCmdAttr contained "-register\>" contains=vimUserCmdAttrKey
Doug Kearns3c07eb02024-09-02 10:03:37 +0200833
834syn match vimUserCmdAttrNargs contained "[01*?+]"
835syn match vimUserCmdAttrRange contained "%"
836
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100837if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_nousercmderror")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100838 syn match vimUserCmdError contained "\S\+\>"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000839endif
Bram Moolenaara93fa7e2006-04-17 22:14:47 +0000840
Doug Kearns3c07eb02024-09-02 10:03:37 +0200841syn case ignore
842syn keyword vimUserCmdAttrKey contained a[ddr] ban[g] bar bu[ffer] com[plete] cou[nt] k[eepscript] n[args] ra[nge] re[gister]
Doug Kearns520a2c72025-04-08 20:50:00 +0200843
844" GEN_SYN_VIM: vimUserCmdAttrComplete, START_STR='syn keyword vimUserCmdAttrComplete contained', END_STR=''
Doug Kearnsc29b5332025-04-26 20:14:15 +0200845syn keyword vimUserCmdAttrComplete contained arglist augroup behave breakpoint buffer color command compiler cscope diff_buffer dir dir_in_path environment event expression file file_in_path filetype filetypecmd function help highlight history keymap locale mapclear mapping menu messages option packadd runtime scriptnames shellcmd shellcmdline sign syntax syntime tag tag_listfiles user var
Doug Kearns520a2c72025-04-08 20:50:00 +0200846syn keyword vimUserCmdAttrComplete contained arglist augroup behave breakpoint buffer color command compiler cscope diff_buffer dir dir_in_path environment event expression file file_in_path filetype function help highlight history keymap locale mapclear mapping menu messages option packadd runtime scriptnames shellcmd shellcmdline sign syntax syntime tag tag_listfiles user var
847syn keyword vimUserCmdAttrComplete contained custom customlist nextgroup=vimUserCmdAttrCompleteFunc,vimUserCmdError
Doug Kearns51289202025-06-11 21:16:14 +0200848syn match vimUserCmdAttrCompleteFunc contained ",\%([bwglstav]:\|<[sS][iI][dD]>\)\=\h\w*\%([.#]\h\w*\)*"hs=s+1 nextgroup=vimUserCmdError contains=vimVarScope,vimFunctionSID
Doug Kearns520a2c72025-04-08 20:50:00 +0200849
Doug Kearns3c07eb02024-09-02 10:03:37 +0200850" GEN_SYN_VIM: vimUserCmdAttrAddr, START_STR='syn keyword vimUserCmdAttrAddr contained', END_STR=''
851syn keyword vimUserCmdAttrAddr contained arguments arg buffers buf lines line loaded_buffers load other quickfix qf tabs tab windows win
Doug Kearns520a2c72025-04-08 20:50:00 +0200852syn keyword vimUserCmdAttrAddr contained arguments arg buffers buf lines line loaded_buffers load other quickfix qf tabs tab windows win
853syn match vimUserCmdAttrAddr contained "?"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000854syn case match
Bram Moolenaar071d4272004-06-13 20:20:40 +0000855
Doug Kearns520a2c72025-04-08 20:50:00 +0200856syn match vimUserCmdName contained "\<\u[[:alnum:]]*\>" skipwhite nextgroup=vimUserCmdBlock,vimUserCmdReplacement
857syn match vimUserCmdName contained +\<\u[[:alnum:]]*\>\ze\s*\n\s*\%(\\\|["#]\\ \)+ skipwhite skipnl nextgroup=vimUserCmdBlock,vimUserCmdReplacement
858syn region vimUserCmdReplacement contained
859 \ start="\S"
860 \ start=+^\s*\%(\\\|["#]\\ \)+
861 \ skip=+\n\s*\%(\\\|["#]\\ \)+
862 \ end="$"
863 \ contains=@vimContinue,@vimUserCmdList,vimComFilter
864syn region vimUserCmdBlock contained
865 \ matchgroup=vimSep
866 \ start="{"
867 \ end="^\s*\zs}"
Doug Kearnsa8b86602025-07-05 15:21:03 +0200868 \ contains=@vimDefBodyList,@vimUserCmdList
dkearns04e53632024-04-11 06:18:37 +1000869
Doug Kearns520a2c72025-04-08 20:50:00 +0200870syn match vimDelcommand "\<delc\%[ommand]\>" skipwhite nextgroup=vimDelcommandAttr,vimDelcommandName
871syn match vimDelcommandAttr contained "-buffer\>" skipwhite nextgroup=vimDelcommandName
872syn match vimDelcommandName contained "\<\u[[:alnum:]]*\>"
Doug Kearns3c07eb02024-09-02 10:03:37 +0200873
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000874" Lower Priority Comments: after some vim commands... {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000875" =======================
dkearns959c3c82024-06-12 04:18:08 +1000876if get(g:, "vimsyn_comment_strings", 1)
Doug Kearns35699f12024-09-19 19:51:59 +0200877 syn region vimCommentString contained oneline start='\S\s\+"'ms=e end='"' extend
dkearns959c3c82024-06-12 04:18:08 +1000878endif
dkearns04e53632024-04-11 06:18:37 +1000879
880if s:vim9script
dkearns04e53632024-04-11 06:18:37 +1000881 syn cluster vimComment contains=vim9Comment
882else
dkearns04e53632024-04-11 06:18:37 +1000883 syn cluster vimComment contains=vimComment
884endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000885
Doug Kearnsc29b5332025-04-26 20:14:15 +0200886VimL syn region vimComment
887 \ excludenl
888 \ start=+"+
889 \ skip=+\n\s*\%(\\\|"\\ \)+
890 \ end="$"
891 \ contains=@vimCommentGroup,vimCommentString
892 \ extend
893Vim9 syn region vim9Comment
894 \ excludenl
895 \ start="\%#=1\s\@1<=#\%({\@!\|{{\)"
896 \ skip="\n\s*\%(\\\|#\\ \)"
897 \ end="$"
898 \ contains=@vimCommentGroup,vimCommentString
899 \ extend
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200900
Doug Kearnsfc64ac02024-06-22 11:20:36 +0200901syn match vim9CommentError contained "#.*"
902syn match vimCommentError contained +".*+
903
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000904" Environment Variables: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000905" =====================
Bram Moolenaar5c736222010-01-06 20:54:52 +0100906syn match vimEnvvar "\$\I\i*"
907syn match vimEnvvar "\${\I\i*}"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000908
Doug Kearns68ba6c22025-02-16 16:40:12 +0100909" Strings {{{2
910" =======
911
912" In-String Specials:
Bram Moolenaar071d4272004-06-13 20:20:40 +0000913" Try to catch strings, if nothing else matches (therefore it must precede the others!)
914" vimEscapeBrace handles ["] []"] (ie. "s don't terminate string inside [])
Doug Kearnsc29b5332025-04-26 20:14:15 +0200915" syn region vimEscapeBrace oneline contained transparent start="[^\\]\(\\\\\)*\[\zs\^\=\]\=" skip="\\\\\|\\\]" end="]"me=e-1
Bram Moolenaar5c736222010-01-06 20:54:52 +0100916syn match vimPatSepErr contained "\\)"
917syn match vimPatSep contained "\\|"
Bram Moolenaarb730f0c2018-11-25 03:56:26 +0100918syn region vimPatSepZone oneline contained matchgroup=vimPatSepZ start="\\%\=\ze(" skip="\\\\" end="\\)\|[^\\]['"]" contains=@vimStringGroup
Bram Moolenaar5c736222010-01-06 20:54:52 +0100919syn region vimPatRegion contained transparent matchgroup=vimPatSepR start="\\[z%]\=(" end="\\)" contains=@vimSubstList oneline
920syn match vimNotPatSep contained "\\\\"
Bram Moolenaar6ba83ba2022-06-12 22:15:57 +0100921syn cluster vimStringGroup contains=vimEscape,vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone,@Spell
Doug Kearns3993cd62025-06-02 19:31:10 +0200922syn region vimString oneline keepend matchgroup=vimString start=+[^a-zA-Z\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ nextgroup=vimSubscript contains=@vimStringGroup extend
923syn region vimString oneline matchgroup=vimString start=+[^a-zA-Z\\@]'+lc=1 end=+'+ nextgroup=vimSubscript contains=vimQuoteEscape extend
Bram Moolenaaracc22402020-06-07 21:07:18 +0200924"syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup " see tst45.vim
Doug Kearns695522d2025-01-10 20:02:17 +0100925
Bram Moolenaar6ba83ba2022-06-12 22:15:57 +0100926syn match vimEscape contained "\\."
dkearnse3e39342024-02-02 07:44:26 +1100927" syn match vimEscape contained +\\[befnrt\"]+
928syn match vimEscape contained "\\\o\{1,3}\|\\[xX]\x\{1,2}\|\\u\x\{1,4}\|\\U\x\{1,8}"
929syn match vimEscape contained "\\<" contains=vimNotation
930syn match vimEscape contained "\\<\*[^>]*>\=>"
Doug Kearns695522d2025-01-10 20:02:17 +0100931syn match vimQuoteEscape contained "''"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000932
Doug Kearnsc29b5332025-04-26 20:14:15 +0200933syn region vimString oneline matchgroup=vimString start=+$'+ end=+'+ nextgroup=vimSubscript contains=@vimStringInterpolation,vimQuoteEscape extend
934syn region vimString oneline matchgroup=vimString start=+$"+ end=+"+ nextgroup=vimSubscript contains=@vimStringInterpolation,@vimStringGroup extend
dkearnsb1427b42024-02-28 05:59:30 +1100935syn region vimStringInterpolationExpr oneline contained matchgroup=vimSep start=+{+ end=+}+ contains=@vimExprList
936syn match vimStringInterpolationBrace contained "{{"
937syn match vimStringInterpolationBrace contained "}}"
Doug Kearnsd164f2a2024-08-16 21:07:15 +0200938syn cluster vimStringInterpolation contains=vimStringInterpolationExpr,vimStringInterpolationBrace
thincacf8695d2024-01-28 18:57:23 +0100939
Doug Kearnsc29b5332025-04-26 20:14:15 +0200940syn region vimContinueString contained matchgroup=vimContinueString start=+"+ skip=+\n\s*\%(\\\|["#]\\ \)+ end=+"+ end="$" skipwhite nextgroup=vimSubscript,vimComment contains=@vimContinue,@vimStringGroup
941syn region vimContinueString contained matchgroup=vimContinueString start=+'+ skip=+\n\s*\%(\\\|["#]\\ \)+ end=+'+ end="$" skipwhite nextgroup=vimSubscript,vimComment contains=@vimContinue,vimQuoteEscape
942syn region vimContinueString contained matchgroup=vimContinueString start=+$"+ skip=+\n\s*\%(\\\|["#]\\ \)+ end=+"+ end="$" skipwhite nextgroup=vimSubscript,vimComment contains=@vimContinue,@vimStringInterpolation,@vimStringGroup
943syn region vimContinueString contained matchgroup=vimContinueString start=+$'+ skip=+\n\s*\%(\\\|["#]\\ \)+ end=+'+ end="$" skipwhite nextgroup=vimSubscript,vimComment contains=@vimContinue,@vimStringInterpolation,vimQuoteEscape
944
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000945" Substitutions: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000946" =============
Bram Moolenaar5c736222010-01-06 20:54:52 +0100947syn cluster vimSubstList contains=vimPatSep,vimPatRegion,vimPatSepErr,vimSubstTwoBS,vimSubstRange,vimNotation
948syn cluster vimSubstRepList contains=vimSubstSubstr,vimSubstTwoBS,vimNotation
949syn cluster vimSubstList add=vimCollection
Doug Kearns086b3b52025-05-31 17:52:48 +0200950syn match vimSubst "^\s*\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)\>" skipwhite nextgroup=vimSubstPat,vimSubstFlags,vimSubstCount
951syn match vimSubst "^\s*\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)[_#]\@=" skipwhite nextgroup=vimSubstPat
952syn match vimSubst "^\s*\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)\%(\d\+\)\@=" skipwhite nextgroup=vimSubstCount
953syn match vimSubst1 contained "\%(s\%[ubstitute]\|sm\%[agic]\>\|sno\%[magic]\)\>" skipwhite nextgroup=vimSubstPat,vimSubstFlags,vimSubstCount
Doug Kearns92f4e912024-06-05 19:45:43 +0200954syn match vimSubst1 contained "\%(s\%[ubstitute]\|sm\%[agic]\>\|sno\%[magic]\)[_#]\@=" skipwhite nextgroup=vimSubstPat
Doug Kearns086b3b52025-05-31 17:52:48 +0200955syn match vimSubst1 contained "\%(s\%[ubstitute]\|sm\%[agic]\>\|sno\%[magic]\)\%(\d\+\)\@=" skipwhite nextgroup=vimSubstCount
956syn match vimSubstFlagErr contained "[^< \t\r|]\+" contains=vimSubstFlags
957" & and # after :s are always pattern delimiters not flags
958syn match vimSubstFlags contained "[&cegiIlnpr#]\+" skipwhite nextgroup=vimSubstCount
959syn match vimSubstCount contained "\d\+\>"
dkearns2c51e152024-02-27 07:10:18 +1100960" TODO: Vim9 illegal separators for abbreviated :s form are [-.:], :su\%[...] required
961" : # is allowed but "not recommended" (see :h pattern-delimiter)
962syn 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
963syn region vimSubstRep4 contained matchgroup=vimSubstDelim start="\z(.\)" skip="\\\\\|\\\z1" end="\z1" matchgroup=vimNotation end="<[cC][rR]>" contains=@vimSubstRepList nextgroup=vimSubstFlagErr oneline
964syn region vimCollection contained transparent start="\\\@<!\[" skip="\\\[" end="\]" contains=vimCollClass
965syn match vimCollClassErr contained "\[:.\{-\}:\]"
966syn match vimCollClass contained transparent "\%#=1\[:\(alnum\|alpha\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|xdigit\|retu\%[rn]\|tab\|escape\|backspace\):\]"
967syn match vimSubstSubstr contained "\\z\=\d"
968syn match vimSubstTwoBS contained "\\\\"
Doug Kearns086b3b52025-05-31 17:52:48 +0200969
970" TODO: flags, unlike count, must follow immediately
971" : distinguish from with Vim9 &var
972" syn match vimSubst "^\s*\zs&&\=" skipwhite nextgroup=vimSubstFlags,vimSubstCount
973" syn match vimSubst "^\s*\zs\~&\=" skipwhite nextgroup=vimSubstFlags,vimSubstCount
974" syn match vimSubst1 contained "&&\=" skipwhite nextgroup=vimSubstFlags,vimSubstCount
975" syn match vimSubst1 contained "\~&\=" skipwhite nextgroup=vimSubstFlags,vimSubstCount
976
977" two and three letter variants (matched as :s + flags, count may follow immediately)
978syn match vimSubst "^\s*\zssc[egiIlnp]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags
979syn match vimSubst "^\s*\zssg[ceiIlnpr]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags
980syn match vimSubst "^\s*\zssi[ceInpr]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags
981syn match vimSubst "^\s*\zssI[ceginplr]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags
982syn match vimSubst "^\s*\zssr[cgiInplr]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags
983
984syn match vimSubst1 contained "\<sc[egiIlnp]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags
985syn match vimSubst1 contained "\<sg[ceiIlnpr]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags
986syn match vimSubst1 contained "\<si[ceInpr]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags
987syn match vimSubst1 contained "\<sI[ceginplr]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags
988syn match vimSubst1 contained "\<sr[cgiInplr]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags
Bram Moolenaar071d4272004-06-13 20:20:40 +0000989
Doug Kearns92f4e912024-06-05 19:45:43 +0200990" Vi compatibility
991syn match vimSubstDelim contained "\\"
992syn match vimSubstPat contained "\\\ze[/?&]" contains=vimSubstDelim nextgroup=vimSubstRep4
993
Doug Kearns086b3b52025-05-31 17:52:48 +0200994" Mark: {{{2
995" ====
996VimL syn match vimExMark "\<k\%([a-zA-Z0-9]\>\|[[\]<>'`]\)\@=" nextgroup=@vimMarkArg
997VimL syn match vimExMark "\<k\>" skipwhite nextgroup=@vimMarkArg
998syn match vimExMark "\<mark\>" skipwhite nextgroup=@vimMarkArg
999
1000syn match vimMarkArg contained "[a-zA-Z]\>\|[[\]<>'`]" skipwhite nextgroup=vimCmdSep,vimComment
1001syn match vimMarkArgError contained "["^.(){}0-9]"
1002syn cluster vimMarkArg contains=vimMarkArg,vimMarkArgError
1003
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001004" Marks, Registers, Addresses, Filters: {{{2
Doug Kearnsdcff4972025-06-22 18:47:49 +02001005syn match vimMark "'[a-zA-Z0-9]\ze\s*$"
1006syn match vimMark "'[[\]{}()<>'`"^.]\ze\s*$"
dkearns2c51e152024-02-27 07:10:18 +11001007syn match vimMark "'[a-zA-Z0-9]\ze[-+,!]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
Doug Kearnsdcff4972025-06-22 18:47:49 +02001008syn match vimMark "'[[\]{}()<>'`"^.]\ze[-+,!]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
1009syn match vimMark ",\zs'[[\]{}()<>'`"^.]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
dkearns2c51e152024-02-27 07:10:18 +11001010syn match vimMark "[!,:]\zs'[a-zA-Z0-9]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
dkearns2c51e152024-02-27 07:10:18 +11001011syn match vimMarkNumber "[-+]\d\+" contained contains=vimOper nextgroup=vimSubst1
Bram Moolenaar5c736222010-01-06 20:54:52 +01001012syn match vimPlainMark contained "'[a-zA-Z0-9]"
Bram Moolenaar6c1e1572019-06-22 02:13:00 +02001013syn match vimRange "[`'][a-zA-Z0-9],[`'][a-zA-Z0-9]" contains=vimMark skipwhite nextgroup=vimFilter
Bram Moolenaar071d4272004-06-13 20:20:40 +00001014
Bram Moolenaarb4ff5182015-11-10 21:15:48 +01001015syn match vimRegister '[^,;[{: \t]\zs"[a-zA-Z0-9.%#:_\-/]\ze[^a-zA-Z_":0-9]'
Bram Moolenaar5c736222010-01-06 20:54:52 +01001016syn match vimRegister '@"'
Doug Kearns037c32e2025-06-25 20:58:50 +02001017syn match vimLetRegister contained '@["@0-9\-a-zA-Z:.%#=*+~_/]'
Bram Moolenaar071d4272004-06-13 20:20:40 +00001018
Bram Moolenaar5c736222010-01-06 20:54:52 +01001019syn match vimAddress ",\zs[.$]" skipwhite nextgroup=vimSubst1
1020syn match vimAddress "%\ze\a" skipwhite nextgroup=vimString,vimSubst1
Bram Moolenaar071d4272004-06-13 20:20:40 +00001021
Bram Moolenaar6c1e1572019-06-22 02:13:00 +02001022syn match vimFilter "^!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile
Bram Moolenaard58a3bf2020-09-28 21:48:16 +02001023syn match vimFilter contained "!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile
1024syn match vimComFilter contained "|!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile
Bram Moolenaar071d4272004-06-13 20:20:40 +00001025
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001026" Complex Repeats: (:h complex-repeat) {{{2
1027" ===============
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001028syn match vimCmplxRepeat '[^a-zA-Z_/\\()]q[0-9a-zA-Z"]\>'lc=1
1029syn match vimCmplxRepeat '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\>\)'
Bram Moolenaar071d4272004-06-13 20:20:40 +00001030
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001031" Set command and associated set-options (vimOptions) with comment {{{2
Doug Kearns570e71a2025-05-30 16:17:30 +02001032syn match vimSet "\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skipwhite nextgroup=vimSetBang,vimCmdSep,vimComment,vimSetArgs
Doug Kearns2a6be832025-04-03 21:39:24 +02001033syn region vimSetComment contained start=+"+ skip=+\n\s*\%(\\\||"\\ \)+ end="$" contains=@vimCommentGroup,vimCommentString extend
1034syn match vimSetCmdSep contained "|" skipwhite nextgroup=@vimCmdList,vimSubst1,vimFunc
1035syn match vimSetEscape contained "\\\%(\\[|"]\|.\)"
1036syn match vimSetBarEscape contained "\\|"
1037syn match vimSetQuoteEscape contained +\\"+
1038syn region vimSetArgs contained
Doug Kearns570e71a2025-05-30 16:17:30 +02001039 \ start="\l\|<"
Doug Kearns2a6be832025-04-03 21:39:24 +02001040 \ skip=+\n\s*\%(\\\|["#]\\ \)\|^\s*"\\ +
1041 \ end=+\ze\\\@1<![|"]+
1042 "\ assume this isn't an escaped char with backslash on the previous line
1043 \ end=+^\s*\\\ze[|"]+
1044 \ end="\ze\s#"
1045 \ end="$"
1046 \ nextgroup=vimSetCmdSep,vimSetComment,vim9Comment
1047 \ contains=@vimContinue,vimErrSetting,vimOption,vimSetAll,vimSetTermcap
1048 \ keepend
Doug Kearns570e71a2025-05-30 16:17:30 +02001049" TODO: restrict this to valid values?
1050syn match vimOption contained "<[^>]\+>" contains=vimOption
Doug Kearns2a6be832025-04-03 21:39:24 +02001051syn region vimSetEqual contained
1052 \ matchgroup=vimOper
1053 \ start="[=:]\|[-+^]="
1054 \ skip=+\\\s\|^\s*\%(\\\|["#]\\ \)+
1055 \ end="\ze\s"
1056 \ contains=@vimContinue,vimCtrlChar,vimEnvvar,vimNotation,vimSetSep,vimSetEscape,vimSetBarEscape,vimSetQuoteEscape
Doug Kearnsddbb6fe2024-07-24 20:21:22 +02001057syn match vimSetBang contained "\a\@1<=!" skipwhite nextgroup=vimSetAll,vimSetTermcap
1058syn keyword vimSetAll contained all nextgroup=vimSetMod
1059syn keyword vimSetTermcap contained termcap
Bram Moolenaar4072ba52020-12-23 13:56:35 +01001060syn match vimSetSep contained "[,:]"
Doug Kearnsddbb6fe2024-07-24 20:21:22 +02001061syn match vimSetMod contained "\a\@1<=\%(&vim\=\|[!&?<]\)"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001062
Doug Kearnsd65e58f2024-07-17 19:34:14 +02001063" Variable Declarations: {{{2
1064" =====================
Doug Kearns274efcc2025-06-10 21:02:43 +02001065VimL syn keyword vimLet let skipwhite nextgroup=@vimSpecialVar,vimVar,vimVarList,vimLetVar
1066VimL syn keyword vimConst cons[t] skipwhite nextgroup=@vimSpecialVar,vimVar,vimVarList,vimLetVar
Doug Kearns1aa287e2025-02-10 22:00:27 +01001067syn region vimVarList contained
1068 \ start="\[" end="]"
Doug Kearns274efcc2025-06-10 21:02:43 +02001069 \ skipwhite nextgroup=vimLetHeredoc
Doug Kearns1aa287e2025-02-10 22:00:27 +01001070 \ contains=@vimContinue,@vimSpecialVar,vimVar
Doug Kearns274efcc2025-06-10 21:02:43 +02001071syn match vimLetVar contained "\<\%([bwglstav]:\)\=\h[a-zA-Z0-9#_]*\>\ze\%(\[.*]\)\=\s*=<<" skipwhite nextgroup=vimLetVarSubscript,vimLetHeredoc contains=vimVarScope,vimSubscript
1072hi link vimLetVar vimVar
1073syn region vimLetVarSubscript contained
1074 \ matchgroup=vimSubscriptBracket
1075 \ start="\S\@1<=\["
1076 \ end="]"
1077 \ skipwhite nextgroup=vimLetVarSubscript,vimLetHeredoc
1078 \ contains=@vimExprList
dkearnsf6869212023-12-11 01:53:24 +11001079
Doug Kearns1aa287e2025-02-10 22:00:27 +01001080VimL syn keyword vimUnlet unl[et] skipwhite nextgroup=vimUnletBang,vimUnletVars
1081syn match vimUnletBang contained "\a\@1<=!" skipwhite nextgroup=vimUnletVars
1082syn region vimUnletVars contained
1083 \ start="$\I\|\h" skip=+\n\s*\\\|\n\s*"\\ \|^\s*"\\ + end="$" end="\ze[|"]"
1084 \ nextgroup=vimCmdSep,vimComment
Doug Kearns3dca5122025-03-09 16:30:28 +01001085 \ contains=@vimContinue,vimEnvvar,vimVar,vimVimVar
dkearnsf6869212023-12-11 01:53:24 +11001086
Doug Kearns274efcc2025-06-10 21:02:43 +02001087" TODO: type error after register or environment variables (strings)
1088VimFoldh syn region vimLetHeredoc contained
1089 \ matchgroup=vimLetHeredocStart
1090 \ start="\%(^\z(\s*\)\S.*\)\@<==<<\s*trim\%(\s\+\)\@>\z(\L\S*\)"
1091 \ matchgroup=vimLetHeredocStop
1092 \ end="^\z1\=\z2$"
1093 \ extend
1094VimFoldh syn region vimLetHeredoc contained
1095 \ matchgroup=vimLetHeredocStart
1096 \ start="=<<\%(\s*\)\@>\z(\L\S*\)"
1097 \ matchgroup=vimLetHeredocStop end="^\z1$"
1098 \ extend
1099VimFoldh syn region vimLetHeredoc contained
1100 \ matchgroup=vimLetHeredocStart
1101 \ start="\%(^\z(\s*\)\S.*\)\@<==<<\s*\%(trim\s\+eval\|eval\s\+trim\)\%(\s\+\)\@>\z(\L\S*\)"
1102 \ matchgroup=vimLetHeredocStop
1103 \ end="^\z1\=\z2$"
1104 \ contains=@vimStringInterpolation
1105 \ extend
1106VimFoldh syn region vimLetHeredoc contained
1107 \ matchgroup=vimLetHeredocStart
1108 \ start="=<<\s*eval\%(\s\+\)\@>\z(\L\S*\)"
1109 \ matchgroup=vimLetHeredocStop
1110 \ end="^\z1$"
1111 \ contains=@vimStringInterpolation
1112 \ extend
Doug Kearnsd65e58f2024-07-17 19:34:14 +02001113
1114Vim9 syn keyword vim9Const const skipwhite nextgroup=vim9Variable,vim9VariableList
1115Vim9 syn keyword vim9Final final skipwhite nextgroup=vim9Variable,vim9VariableList
1116Vim9 syn keyword vim9Var var skipwhite nextgroup=vim9Variable,vim9VariableList
1117
Doug Kearns274efcc2025-06-10 21:02:43 +02001118syn match vim9Variable contained "\<\h\w*\>" skipwhite nextgroup=vim9VariableTypeSep,vimLetHeredoc,vimOper
1119syn region vim9VariableList contained start="\[" end="]" contains=@vimContinue,@vimSpecialVar,vim9Variable skipwhite nextgroup=vimLetHeredoc
1120
1121syn match vim9VariableTypeSep contained "\S\@1<=:\%(\s\|\n\)\@=" skipwhite nextgroup=@vim9VariableType
1122syn keyword vim9VariableType contained any blob bool channel float job number string void skipwhite nextgroup=vimLetHeredoc
1123syn match vim9VariableType contained "\<\%(func\)\>" skipwhite nextgroup=vimLetHeredoc
1124syn region vim9VariableCompoundType contained
1125 \ matchgroup=vim9VariableType
1126 \ start="\<func("
1127 \ end=")"
1128 \ skipwhite nextgroup=vim9VariableTypeSep,vimLetHeredoc
1129 \ contains=@vim9Continue,@vim9VariableType
1130 \ transparent
1131syn region vim9VariableCompoundType contained
1132 \ matchgroup=vim9VariableType
1133 \ start="\<tuple<"
1134 \ end=">"
1135 \ skipwhite nextgroup=vimLetHeredoc
1136 \ contains=@vim9Continue,@vim9VariableType
1137 \ transparent
1138syn region vim9VariableCompoundType contained
1139 \ matchgroup=vim9VariableType
1140 \ start="\<\%(list\|dict\)<"
1141 \ end=">"
1142 \ skipwhite nextgroup=vimLetHeredoc
1143 \ contains=@vim9VariableType
1144 \ oneline
1145 \ transparent
1146syn match vim9VariableUserType contained "\<\%(\h\w*\.\)*\u\w*\>" skipwhite nextgroup=vimLetHeredoc
1147
1148syn cluster vim9VariableType contains=vim9VariableType,vim9VariableCompoundType,vim9VariableUserType
Doug Kearns1aa287e2025-02-10 22:00:27 +01001149
1150" Lockvar and Unlockvar: {{{2
1151" =====================
1152syn keyword vimLockvar lockv[ar] skipwhite nextgroup=vimLockvarBang,vimLockvarDepth,vimLockvarVars
1153syn keyword vimUnlockvar unlo[ckvar] skipwhite nextgroup=vimLockvarBang,vimLockvarDepth,vimLockvarVars
1154syn match vimLockvarBang contained "\a\@1<=!" skipwhite nextgroup=vimLockvarVars
1155syn match vimLockvarDepth contained "\<[0-3]\>" skipwhite nextgroup=vimLockvarVars
1156syn region vimLockvarVars contained
1157 \ start="\h" skip=+\n\s*\\\|\n\s*"\\ \|^\s*"\\ + end="$" end="\ze[|"]"
1158 \ nextgroup=vimCmdSep,vimComment
1159 \ contains=@vimContinue,vimVar
1160
1161hi def link vimLockvar vimCommand
1162hi def link vimUnlockvar vimCommand
1163hi def link vimLockvarBang vimBang
1164hi def link vimLockvarDepth vimNumber
Bram Moolenaar071d4272004-06-13 20:20:40 +00001165
dkearnsf6869212023-12-11 01:53:24 +11001166" For: {{{2
1167" ===
Doug Kearns1aa287e2025-02-10 22:00:27 +01001168" handles Vim9 and legacy for now
1169syn region vimFor
1170 \ matchgroup=vimCommand
1171 \ start="\<for\>" end="\<in\>"
1172 \ skipwhite skipnl nextgroup=@vimForInContinue,vim9ForInComment,@vimExprList
1173 \ contains=@vimContinue,vimVar,vimVarList,vim9VariableList
1174 \ transparent
1175
1176syn match vim9ForInComment contained "#.*" skipwhite skipempty nextgroup=vimForInComment,@vimExprList
1177
1178syn match vimForInContinue contained "^\s*\zs\\" skipwhite skipnl nextgroup=@vimForInContinue,@vimExprList
1179syn match vimForInContinueComment contained '^\s*\zs["#]\\ .*' skipwhite skipnl nextgroup=@vimForInContinue,@vimExprList
1180syn cluster vimForInContinue contains=vimForInContinue,vimForInContinueComment
dkearns76d62982024-03-23 05:55:25 +11001181
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001182" Abbreviations: {{{2
Bram Moolenaare37d50a2008-08-06 17:06:04 +00001183" =============
h-east9b53c052024-02-13 21:09:22 +01001184" GEN_SYN_VIM: vimCommand abbrev, START_STR='syn keyword vimAbb', END_STR='skipwhite nextgroup=vimMapMod,vimMapLhs'
dkearns16249702024-02-23 05:45:05 +11001185syn 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 +11001186" GEN_SYN_VIM: vimCommand abclear, START_STR='syn keyword vimAbb', END_STR='skipwhite nextgroup=vimMapMod'
1187syn keyword vimAbb abc[lear] cabc[lear] iabc[lear] skipwhite nextgroup=vimMapMod
Bram Moolenaare37d50a2008-08-06 17:06:04 +00001188
Doug Kearnsfa3b1042025-04-22 19:48:13 +02001189" Filename Patterns: {{{2
1190" =================
1191
1192syn match vimWildcardQuestion contained "?"
1193syn match vimWildcardStar contained "*"
1194
1195syn match vimWildcardBraceComma contained ","
1196syn region vimWildcardBrace contained
1197 \ matchgroup=vimWildcard
1198 \ start="{"
1199 \ end="}"
1200 \ contains=vimWildcardEscape,vimWildcardBrace,vimWildcardBraceComma,vimWildcardQuestion,vimWildcardStar,vimWildcardBracket
1201 \ oneline
1202
1203syn match vimWildcardIntervalNumber contained "\d\+"
1204syn match vimWildcardInterval contained "\\\\\\{\d\+\%(,\d\+\)\=\\}" contains=vimWildcardIntervalNumber
1205
1206
1207syn match vimWildcardBracket contained "\[\%(\^\=]\=\%(\\.\|\[\([:.=]\)[^:.=]\+\1]\|[^][:space:]]\)*\)\@>]"
1208 \ contains=vimWildcardBracketStart,vimWildcardEscape
1209
1210syn match vimWildcardBracketCharacter contained "." nextgroup=@vimWildcardBracketCharacter,vimWildcardBracketHyphen,vimWildcardBracketEnd
1211syn match vimWildcardBracketRightBracket contained "]" nextgroup=@vimWildcardBracketCharacter,vimWildcardBracketEnd
1212syn match vimWildcardBracketHyphen contained "-]\@!" nextgroup=@vimWildcardBracketCharacter
1213syn match vimWildcardBracketEscape contained "\\." nextgroup=@vimWildcardBracketCharacter,vimWildcardBracketHyphen,vimWildcardBracketEnd
1214syn match vimWildcardBracketCharacterClass contained "\[:[^:]\+:]" nextgroup=@vimWildcardBracketCharacter,vimWildcardBracketEnd
1215syn match vimWildcardBracketEquivalenceClass contained "\[=[^=]\+=]" nextgroup=@vimWildcardBracketCharacter,vimWildcardBracketEnd
1216syn match vimWildcardBracketCollatingSymbol contained "\[\.[^.]\+\.]" nextgroup=@vimWildcardBracketCharacter,vimWildcardBracketEnd
1217
1218syn match vimWildcardBracketStart contained "\[" nextgroup=vimWildcardBracketCaret,vimWildcardBracketRightBracket,@vimWildcardBracketCharacter
Eisuke Kawashima6acca4b2025-06-07 17:55:58 +02001219syn match vimWildcardBracketCaret contained "\^" nextgroup=@vimWildcardBracketCharacter,vimWildcardBracketRightBracket
Doug Kearnsfa3b1042025-04-22 19:48:13 +02001220syn match vimWildcardBracketEnd contained "]"
1221
1222syn cluster vimWildcardBracketCharacter contains=vimWildcardBracketCharacter,vimWildcardBracketEscape,vimWildcardBracketCharacterClass,vimWildcardBracketEquivalenceClass,vimWildcardBracketCollatingSymbol
1223
1224syn match vimWildcardEscape contained "\\."
1225
1226syn cluster vimWildcard contains=vimWildcardQuestion,vimWildcardStar,vimWildcardBrace,vimWildcardBracket,vimWildcardInterval
1227
1228" Autocmd and Doauto{cmd,all}: {{{2
1229" ===========================
1230
1231" TODO: explicitly match the {cmd} arg rather than bailing out to TOP
1232syn region vimAutocmdBlock contained matchgroup=vimSep start="{" end="^\s*\zs}" contains=@vimDefBodyList
1233
1234syn match vimAutocmdGroup contained "\%(\\["|[:space:]]\|[^"|[:space:]]\)\+" skipwhite nextgroup=vimAutoEvent,vimAutoEventGlob
1235syn match vimAutocmdBang contained "\a\@1<=!" skipwhite nextgroup=vimAutocmdGroup,vimAutoEvent,vimAutoEventGlob
1236
1237" TODO: cleaner handling of | in pattern position
1238" : match pattern items in addition to wildcards
1239syn region vimAutocmdPattern contained
1240 \ start="|\@!\S"
1241 \ skip="\\\\\|\\[,[:space:]]"
1242 \ end="\ze[,[:space:]]"
1243 \ end="$"
1244 \ skipwhite nextgroup=vimAutocmdPatternSep,vimAutocmdMod,vimAutocmdBlock
1245 \ contains=vimEnvvar,@vimWildcard,vimAutocmdPatternEscape
1246syn match vimAutocmdBufferPattern contained "<buffer\%(=\%(\d\+\|abuf\)\)\=>" skipwhite nextgroup=vimAutocmdPatternSep,vimAutocmdMod,vimAutocmdBlock
1247" trailing pattern separator comma allowed
1248syn match vimAutocmdPatternSep contained "," skipwhite nextgroup=@vimAutocmdPattern,vimAutocmdMod,vimAutocmdBlock
1249syn match vimAutocmdPatternEscape contained "\\."
1250syn cluster vimAutocmdPattern contains=vimAutocmdPattern,vimAutocmdBufferPattern
1251
1252" TODO: Vim9 requires '++' prefix
1253syn match vimAutocmdMod contained "\%(++\)\=\<nested\>" skipwhite nextgroup=vimAutocmdMod,vimAutocmdBlock
1254syn match vimAutocmdMod contained "++once\>" skipwhite nextgroup=vimAutocmdMod,vimAutocmdBlock
1255
1256" higher priority than vimAutocmdGroup, assume no group is so named
1257syn match vimAutoEventGlob contained "*" skipwhite nextgroup=@vimAutocmdPattern
1258syn match vimAutoEventSep contained "\a\@1<=," nextgroup=vimAutoEvent
zeertzjq8311e7d2025-06-18 18:02:47 +02001259syn match vimUserAutoEventSep contained "\a\@1<=," nextgroup=vimUserAutoEvent
Doug Kearnsfa3b1042025-04-22 19:48:13 +02001260
1261syn match vimAutocmd "\<au\%[tocmd]\>" skipwhite nextgroup=vimAutocmdBang,vimAutocmdGroup,vimAutoEvent,vimAutoEventGlob
1262
1263
1264syn match vimDoautocmdMod contained "<nomodeline>" skipwhite nextgroup=vimAutocmdGroup,vimAutoEvent
1265syn match vimDoautocmd "\<do\%[autocmd]\>" skipwhite nextgroup=vimDoautocmdMod,vimAutocmdGroup,vimAutoEvent
1266syn match vimDoautocmd "\<doautoa\%[ll]\>" skipwhite nextgroup=vimDoautocmdMod,vimAutocmdGroup,vimAutoEvent
Bram Moolenaar071d4272004-06-13 20:20:40 +00001267
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001268" Echo And Execute: -- prefer strings! {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001269" ================
dkearns61887b32024-03-15 23:45:48 +11001270" NOTE: No trailing comments
dkearnsb1427b42024-02-28 05:59:30 +11001271
dkearns61887b32024-03-15 23:45:48 +11001272syn region vimEcho
1273 \ matchgroup=vimCommand
1274 \ start="\<ec\%[ho]\>"
1275 \ start="\<echoe\%[rr]\>"
1276 \ start="\<echom\%[sg]\>"
1277 \ start="\<echoc\%[onsole]\>"
1278 \ start="\<echon\>"
1279 \ start="\<echow\%[indow]\>"
Doug Kearnsa9313712025-06-23 21:51:44 +02001280 \ skip=+\\|\|||\|\n\s*\%(\\\|["#]\\ \)+
1281 \ end="\ze|"
1282 \ excludenl end="$"
1283 \ nextgroup=vimCmdSep
1284 \ contains=@vimContinue,@vimExprList
1285 \ transparent
dkearns61887b32024-03-15 23:45:48 +11001286
1287syn match vimEchohl "\<echohl\=\>" skipwhite nextgroup=vimGroup,vimHLGroup,vimEchohlNone
Bram Moolenaar071d4272004-06-13 20:20:40 +00001288syn case ignore
dkearns61887b32024-03-15 23:45:48 +11001289syn keyword vimEchohlNone contained none
Bram Moolenaar071d4272004-06-13 20:20:40 +00001290syn case match
1291
dkearns35e6f4c2024-03-22 06:41:10 +11001292syn cluster vimEcho contains=vimEcho,vimEchohl
dkearns61887b32024-03-15 23:45:48 +11001293
Doug Kearnsa9313712025-06-23 21:51:44 +02001294syn region vimExecute
1295 \ matchgroup=vimCommand
1296 \ start="\<exe\%[cute]\>"
1297 \ skip=+\\|\|||\|\n\s*\%(\\\|["#]\\ \)+
1298 \ end="\ze|"
1299 \ excludenl end="$"
1300 \ nextgroup=vimCmdSep
1301 \ contains=@vimContinue,@vimExprList
1302 \ transparent
dkearnsb1427b42024-02-28 05:59:30 +11001303
Doug Kearns9b171bd2025-04-10 19:59:22 +02001304" Filter: {{{2
1305" ======
1306syn match vimExFilter "\<filt\%[er]\>" skipwhite nextgroup=vimExFilterBang,vimExFilterPattern
Doug Kearns9b171bd2025-04-10 19:59:22 +02001307syn region vimExFilterPattern contained
Eisuke Kawashima6acca4b2025-06-07 17:55:58 +02001308 \ start="[[:ident:]]"
Doug Kearns9b171bd2025-04-10 19:59:22 +02001309 \ end="\ze[[:space:]\n]"
1310 \ skipwhite nextgroup=@vimCmdList
1311 \ contains=@vimSubstList
1312 \ oneline
1313syn region vimExFilterPattern contained
1314 \ matchgroup=Delimiter
1315 \ start="\z([^[:space:][:ident:]|"]\)"
1316 \ skip="\\\\\|\\\z1"
1317 \ end="\z1"
1318 \ skipwhite nextgroup=@vimCmdList
1319 \ contains=@vimSubstList
1320 \ oneline
Doug Kearnsa9b5e4a2025-07-03 20:47:50 +02001321syn match vimExFilterBang contained "\a\@1<=!" skipwhite nextgroup=vimExFilterPattern
Doug Kearns9b171bd2025-04-10 19:59:22 +02001322
1323" Grep and Make: {{{2
1324" =============
1325" | is the command separator, escaped with \| all other backslashes are passed through literally, no tail comments
1326syn match vimGrep "\<l\=gr\%[ep]\>" skipwhite nextgroup=vimGrepBang,vimGrepArgs,vimCmdSep
1327syn match vimGrepadd "\<l\=grepa\%[dd]\>" skipwhite nextgroup=vimGrepBang,vimGrepArgs,vimCmdSep
1328syn region vimGrepArgs contained
1329 \ start="|\@!\S"
1330 \ skip=+\n\s*\%(\\\|[#"]\\ \)+
1331 \ matchgroup=vimCmdSep
1332 \ end="|"
1333 \ end="$"
1334 "\ TODO: include vimSpecFile
1335 \ contains=vimGrepBarEscape
1336syn match vimGrepBarEscape contained "\\|"
1337syn match vimGrepBang contained "\a\@1<=!" skipwhite nextgroup=vimGrepArgs,vimCmdSep
1338
1339syn match vimMake "\<l\=make\=\>" skipwhite nextgroup=vimMakeBang,vimMakeArgs,vimCmdSep
1340syn region vimMakeArgs contained
1341 \ start="|\@!\S"
1342 \ skip=+\n\s*\%(\\\|[#"]\\ \)+
1343 \ matchgroup=vimCmdSep
1344 \ end="|"
1345 \ end="$"
1346 "\ TODO: include vimSpecFile
1347 \ contains=vimMakeBarEscape
1348syn match vimMakeBarEscape contained "\\|"
1349syn match vimMakeBang contained "\a\@1<=!" skipwhite nextgroup=vimMakeArgs,vimCmdSep
1350
1351syn match vimHelpgrep "\<l\=helpg\%[rep]\>" skipwhite nextgroup=vimHelpgrepBang,vimHelpgrepPattern
1352syn region vimHelpgrepPattern contained
1353 \ start="\S"
1354 \ matchgroup=Special
1355 \ end="@\w\w\>"
1356 \ end="$"
1357 \ contains=@vimSubstList
1358 \ oneline
1359
1360" Vimgrep: {{{2
1361" =======
1362syn match vimVimgrep "\<l\=vim\%[grep]\>" skipwhite nextgroup=vimVimgrepBang,vimVimgrepPattern
1363syn match vimVimgrepadd "\<l\=vimgrepa\%[dd]\>" skipwhite nextgroup=vimVimgrepBang,vimVimgrepPattern
1364syn match vimVimgrepBang contained "\a\@1<=!" skipwhite nextgroup=vimVimgrepPattern
1365syn region vimVimgrepPattern contained
Eisuke Kawashima6acca4b2025-06-07 17:55:58 +02001366 \ start="[[:ident:]]"
Doug Kearns9b171bd2025-04-10 19:59:22 +02001367 \ end="\ze[[:space:]\n]"
1368 \ skipwhite nextgroup=vimVimgrepFile,vimCmdSep
1369 \ contains=@vimSubstList
1370 \ oneline
1371syn region vimVimgrepPattern contained
1372 \ matchgroup=Delimiter
1373 \ start="\z([^[:space:][:ident:]|"]\)"
1374 \ skip="\\\\\|\\\z1"
1375 \ end="\z1"
1376 \ skipwhite nextgroup=vimVimgrepFlags,vimVimgrepFile,vimCmdSep
1377 \ contains=@vimSubstList
1378 \ oneline
1379syn match vimVimgrepEscape contained "\\\%(\\|\|.\)"
1380syn match vimVimgrepBarEscape contained "\\|"
1381syn region vimVimgrepFile contained
1382 \ start="|\@!\S"
1383 \ matchgroup=vimCmdSep
1384 \ end="|"
1385 \ end="\ze\s"
1386 \ end="$"
1387 \ skipwhite nextgroup=vimVimgrepFile
1388 \ contains=vimSpecFile,vimVimgrepEscape,vimVimgrepBarEscape
1389syn match vimVimgrepFlags contained "\<[gjf]\{,3\}\>" skipwhite nextgroup=vimVimgrepfile
1390
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001391" Maps: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001392" ====
Doug Kearns99984fc2024-07-18 20:45:19 +02001393" GEN_SYN_VIM: vimCommand map, START_STR='syn keyword vimMap', END_STR='skipwhite nextgroup=vimMapMod,vimMapLhs'
1394syn 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
1395syn match vimMap "\<map\>" skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
1396syn keyword vimMap no[remap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
dkearns16249702024-02-23 05:45:05 +11001397" GEN_SYN_VIM: vimCommand mapclear, START_STR='syn keyword vimMap', END_STR='skipwhite nextgroup=vimMapMod'
1398syn 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 +02001399syn keyword vimMap mapc[lear] skipwhite nextgroup=vimMapBang,vimMapMod
1400" GEN_SYN_VIM: vimCommand unmap, START_STR='syn keyword vimUnmap', END_STR='skipwhite nextgroup=vimMapMod,vimMapLhs'
1401syn keyword vimUnmap cu[nmap] iu[nmap] lu[nmap] nun[map] ou[nmap] sunm[ap] tunma[p] vu[nmap] xu[nmap] skipwhite nextgroup=vimMapMod,vimMapLhs
1402syn keyword vimUnmap unm[ap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
1403
Doug Kearns6bdfeb02025-03-07 18:49:11 +01001404syn match vimMapLhs contained "\%(.\|\S\)\+" contains=vimCtrlChar,vimNotation,vimMapLeader skipwhite nextgroup=vimMapRhs
1405syn match vimMapLhs contained "\%(.\|\S\)\+\ze\s*$" contains=vimCtrlChar,vimNotation,vimMapLeader skipwhite skipnl nextgroup=vimMapRhsContinue
dkearns5d67aef2024-03-10 04:01:22 +11001406syn match vimMapBang contained "\a\@1<=!" skipwhite nextgroup=vimMapMod,vimMapLhs
Doug Kearns6bdfeb02025-03-07 18:49:11 +01001407syn match vimMapMod contained "\%#=1<\%(buffer\|expr\|nowait\|script\|silent\|special\|unique\)\+>" contains=vimMapModKey,vimMapModErr skipwhite nextgroup=vimMapMod,vimMapLhs
1408syn region vimMapRhs contained start="\S" skip=+\\|\|\@1<=|\|\n\s*\\\|\n\s*"\\ + end="|" end="$" contains=@vimContinue,vimCtrlChar,vimNotation,vimMapLeader skipnl nextgroup=vimMapRhsContinue
dkearns5d67aef2024-03-10 04:01:22 +11001409" assume a continuation comment introduces the RHS
Doug Kearns6bdfeb02025-03-07 18:49:11 +01001410syn region vimMapRhsContinue contained start=+^\s*\%(\\\|"\\ \)+ skip=+\\|\|\@1<=|\|\n\s*\\\|\n\s*"\\ + end="|" end="$" contains=@vimContinue,vimCtrlChar,vimNotation,vimMapLeader
1411syn match vimMapLeader contained "\%#=1\c<\%(local\)\=leader>" contains=vimMapLeaderKey
1412syn keyword vimMapModKey contained buffer expr nowait script silent special unique
Bram Moolenaar071d4272004-06-13 20:20:40 +00001413syn case ignore
Doug Kearns6bdfeb02025-03-07 18:49:11 +01001414syn keyword vimMapLeaderKey contained leader localleader
Bram Moolenaar071d4272004-06-13 20:20:40 +00001415syn case match
1416
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001417" Menus: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001418" =====
dkearns62b26042024-03-10 03:43:28 +11001419" NOTE: tail comments disallowed
1420" GEN_SYN_VIM: vimCommand menu, START_STR='syn keyword vimMenu', END_STR='skipwhite nextgroup=vimMenuBang,vimMenuMod,vimMenuName,vimMenuPriority,vimMenuStatus'
1421syn 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
1422syn keyword vimMenu popu[p] skipwhite nextgroup=vimMenuBang,vimMenuName
1423syn region vimMenuRhs contained contains=@vimContinue,vimNotation start="|\@!\S" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + end="$" matchgroup=vimSep end="|"
1424syn region vimMenuRhsContinue contained contains=@vimContinue,vimNotation start=+^\s*\%(\\\|"\\ \)+ skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + end="$" matchgroup=vimSep end="|"
dkearnsec21baf2024-03-20 04:04:42 +11001425syn match vimMenuName "\.\@!\%(\\\s\|\S\)\+" contained contains=vimMenuNotation,vimNotation skipwhite nextgroup=vimCmdSep,vimMenuRhs
1426syn match vimMenuName "\.\@!\%(\\\s\|\S\)\+\ze\s*$" contained contains=vimMenuNotation,vimNotation skipwhite skipnl nextgroup=vimCmdSep,vimMenuRhsContinue
dkearns62b26042024-03-10 03:43:28 +11001427syn match vimMenuNotation "&\a\|&&\|\\\s\|\\\." contained
1428syn match vimMenuPriority "\<\d\+\%(\.\d\+\)*\>" contained skipwhite nextgroup=vimMenuName
1429syn match vimMenuMod "\c<\%(script\|silent\|special\)>" contained skipwhite nextgroup=vimMenuName,vimMenuPriority,vimMenuMod contains=vimMapModKey,vimMapModErr
1430syn keyword vimMenuStatus enable disable nextgroup=vimMenuName skipwhite
1431syn match vimMenuBang "\a\@1<=!" contained skipwhite nextgroup=vimMenuName,vimMenuMod
1432
1433syn region vimMenutranslate
1434 \ matchgroup=vimCommand start="\<menut\%[ranslate]\>"
1435 \ skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ +
1436 \ end="$" matchgroup=vimCmdSep end="|" matchgroup=vimMenuClear end="\<clear\ze\s*\%(["#|]\|$\)"
1437 \ contains=@vimContinue,vimMenutranslateName keepend transparent
1438" oneline is sufficient to match the current formatting in runtime/lang/*.vim
1439syn match vimMenutranslateName "\%(\\\s\|\S\)\+" contained contains=vimMenuNotation,vimNotation
1440syn match vimMenutranslateComment +".*+ contained containedin=vimMenutranslate
Bram Moolenaar071d4272004-06-13 20:20:40 +00001441
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001442" Angle-Bracket Notation: (tnx to Michael Geddes) {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001443" ======================
1444syn case ignore
Doug Kearns68ba6c22025-02-16 16:40:12 +01001445syn 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 +11001446
Doug Kearns68ba6c22025-02-16 16:40:12 +01001447syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}\%(net\|dec\|jsb\|pterm\|urxvt\|sgr\)mouse>" contains=vimBracket
1448syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}\%(left\|middle\|right\)\%(mouse\|drag\|release\)>" contains=vimBracket
1449syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}left\%(mouse\|release\)nm>" contains=vimBracket
1450syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}x[12]\%(mouse\|drag\|release\)>" contains=vimBracket
1451syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}sgrmouserelease>" contains=vimBracket
1452syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}mouse\%(up\|down\|move\)>" contains=vimBracket
1453syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}scrollwheel\%(up\|down\|right\|left\)>" contains=vimBracket
dkearnse3e39342024-02-02 07:44:26 +11001454
Doug Kearns68ba6c22025-02-16 16:40:12 +01001455syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%(sid\|nop\|nul\|lt\|drop\)>" contains=vimBracket
1456syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%(snr\|plug\|cursorhold\|ignore\|cmd\|scriptcmd\|focus\%(gained\|lost\)\)>" contains=vimBracket
Doug Kearnsc29b5332025-04-26 20:14:15 +02001457" syn match vimNotation contained '\%(\\\|<lt>\)\=<C-R>[0-9a-z"%#:.\-=]'he=e-1 contains=vimBracket
Doug Kearnsa8b86602025-07-05 15:21:03 +02001458syn match vimNotation contained '\%#=1\%(\\\|<lt>\)\=<\%([fq]-\)\=\%(line[12]\|count\|bang\|reg\|args\|mods\|lt\)>' contains=vimBracket skipwhite nextgroup=vimSubst1
Doug Kearns68ba6c22025-02-16 16:40:12 +01001459syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([cas]file\|abuf\|amatch\|cexpr\|cword\|cWORD\|client\|stack\|script\|sf\=lnum\)>" contains=vimBracket
1460syn match vimNotation contained "\%#=1\%(\\\|<lt>\)\=<\%([scamd]-\)\{0,4}char-\%(\d\+\|0\o\+\|0x\x\+\)>" contains=vimBracket
dkearnse3e39342024-02-02 07:44:26 +11001461
Bram Moolenaar5c736222010-01-06 20:54:52 +01001462syn match vimBracket contained "[\\<>]"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001463syn case match
1464
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001465" User Function Highlighting: {{{2
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00001466" (following Gautam Iyer's suggestion)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001467" ==========================
Doug Kearns1aa287e2025-02-10 22:00:27 +01001468syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" skipwhite nextgroup=vimOperParen contains=vimFuncEcho,vimFuncName,vimUserFunc,vimExecute
1469syn 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 +11001470syn keyword vimFuncEcho contained ec ech echo
1471
Doug Kearns99984fc2024-07-18 20:45:19 +02001472syn match vimMap "\<map\%(\s\+(\)\@=" skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
1473
Bram Moolenaar2547aa92020-07-26 17:00:44 +02001474" User Command Highlighting: {{{2
Bram Moolenaard2ea7cf2021-05-30 20:54:13 +02001475syn match vimUsrCmd '^\s*\zs\u\%(\w*\)\@>\%([(#[]\|\s\+\%([-+*/%]\=\|\.\.\)=\)\@!'
Bram Moolenaar2547aa92020-07-26 17:00:44 +02001476
Doug Kearns025dc482025-02-23 15:48:52 +01001477" Vim user commands
1478
1479" Compiler plugins
Doug Kearns6bdfeb02025-03-07 18:49:11 +01001480syn match vimCompilerSet "\<CompilerSet\>" skipwhite nextgroup=vimSetArgs
Doug Kearns025dc482025-02-23 15:48:52 +01001481
1482" runtime/makemenu.vim
1483syn match vimSynMenu "\<SynMenu\>" skipwhite nextgroup=vimSynMenuPath
1484syn match vimSynMenuPath contained ".*\ze:" nextgroup=vimSynMenuColon contains=vimMenuNotation
1485syn match vimSynMenuColon contained ":" nextgroup=vimSynMenuName
1486syn match vimSynMenuName contained "\w\+"
1487
Doug Kearnsc233c2e2025-07-03 20:57:03 +02001488" runtime/syntax/syncolor.vim
1489syn match vimSynColor "\<SynColor\>" skipwhite nextgroup=vimSynColorGroup
1490syn match vimSynColorGroup contained "\<\h\w*\>" skipwhite nextgroup=vimHiKeyList contains=vimGroup
1491syn match vimSynLink "\<SynLink\>" skipwhite nextgroup=vimSynLinkGroup
1492syn match vimSynLinkGroup contained "\<\h\w*\>" skipwhite nextgroup=vimGroup contains=vimGroup
1493
1494syn cluster vimExUserCmdList contains=vimCompilerSet,vimSynColor,vimSynLink,vimSynMenu
Doug Kearns025dc482025-02-23 15:48:52 +01001495
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00001496" Errors And Warnings: {{{2
1497" ====================
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001498if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimfunctionerror")
Doug Kearns51289202025-06-11 21:16:14 +02001499 syn match vimFunctionError contained "[[:space:]!]\@1<=\<[a-z0-9]\w\{-}\ze\s*("
1500 syn match vimFunctionError contained "\%(<[sS][iI][dD]>\|[sg]:\)\d\w\{-}\ze\s*("
Bram Moolenaar5c736222010-01-06 20:54:52 +01001501 syn match vimElseIfErr "\<else\s\+if\>"
1502 syn match vimBufnrWarn /\<bufnr\s*(\s*["']\.['"]\s*)/
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00001503endif
1504
Doug Kearnsc29b5332025-04-26 20:14:15 +02001505" If, While and Return: {{{2
1506" ====================
Doug Kearns68ba6c22025-02-16 16:40:12 +01001507syn match vimNotFunc "\%#=1\<\%(if\|el\%[seif]\|retu\%[rn]\|while\)\>" skipwhite nextgroup=@vimExprList,vimNotation
Doug Kearnsc29b5332025-04-26 20:14:15 +02001508syn match vimElse "\<el\%[se]\>" skipwhite nextgroup=vimComment,vim9Comment
1509syn match vimEndif "\<en\%[dif]\>" skipwhite nextgroup=vimComment,vim9Comment
Bram Moolenaar6c1e1572019-06-22 02:13:00 +02001510
Doug Kearnse85fdc72024-07-07 20:45:37 +02001511" Match: {{{2
1512" =====
1513syn match vimMatch "\<[23]\=mat\%[ch]\>" skipwhite nextgroup=vimMatchGroup,vimMatchNone
1514syn match vimMatchGroup contained "[[:alnum:]._-]\+" skipwhite nextgroup=vimMatchPattern
1515syn case ignore
1516syn keyword vimMatchNone contained none
1517syn case match
1518syn region vimMatchPattern contained matchgroup=Delimiter start="\z([!#$%&'()*+,-./:;<=>?@[\]^_`{}~]\)" skip="\\\\\|\\\z1" end="\z1" contains=@vimSubstList oneline
1519
Doug Kearnsbbe52522024-11-09 19:11:25 +01001520" Normal: {{{2
1521" ======
1522syn match vimNormal "\<norm\%[al]\>!\=" skipwhite nextgroup=vimNormalArg contains=vimBang
1523syn region vimNormalArg contained start="\S" skip=+\n\s*\\\|\n\s*["#]\\ + end="$" contains=@vimContinue
Bram Moolenaar05159a02005-02-26 23:04:13 +00001524
Doug Kearns0aaf6f82025-06-01 18:26:39 +02001525" Profile: {{{2
1526" =======
1527syn match vimProfileBang contained "\a\@1<=!" skipwhite nextgroup=vimProfileArg
1528syn keyword vimProfileArg contained start skipwhite nextgroup=vimProfilePattern
1529syn keyword vimProfileArg contained func skipwhite nextgroup=vimProfilePattern
1530syn keyword vimProfileArg contained file skipwhite nextgroup=vimProfilePattern
1531syn keyword vimProfileArg contained stop pause skipwhite nextgroup=vimCmdSep,@vimComment
1532syn keyword vimProfileArg contained continue dump skipwhite nextgroup=vimCmdSep,@vimComment
1533" TODO: match file pattern
1534syn region vimProfilePattern contained
1535 \ start="\S"
1536 \ skip=+\\[|"#]+
1537 \ end="$" end=+\ze\s*[|"#]+
1538 \ skipwhite nextgroup=vimCmdSep,vimComment,vim9Comment
1539syn match vimProfile "\<prof\%[ile]\>" skipwhite nextgroup=vimProfileBang,vimProfileArg
1540
Doug Kearns3993cd62025-06-02 19:31:10 +02001541syn keyword vimProfdelArg contained func skipwhite nextgroup=vimProfilePattern
1542syn keyword vimProfdelArg contained file skipwhite nextgroup=vimProfilePattern
1543syn keyword vimProfdelArg contained here skipwhite nextgroup=vimCmdSep,@vimComment
Doug Kearns0aaf6f82025-06-01 18:26:39 +02001544syn match vimProfdel "\<profd\%[el]\>" skipwhite nextgroup=vimProfdelArg
1545
Doug Kearns2f5a8c02025-04-05 15:55:36 +02001546" Redir: {{{2
1547" =====
1548syn match vimRedir "\<redir\=\>" skipwhite nextgroup=vimRedirBang,vimRedirFileOperator,vimRedirVariableOperator,vimRedirRegister,vimRedirEnd
1549syn match vimRedirBang contained "\a\@1<=!" skipwhite nextgroup=vimRedirFileOperator
1550
1551syn match vimRedirFileOperator contained ">>\=" skipwhite nextgroup=vimRedirFile
1552syn region vimRedirFile contained
1553 \ start="\S"
1554 \ matchgroup=Normal
1555 \ end="\s*$"
1556 \ end="\s*\ze[|"]"
1557 \ nextgroup=vimCmdSep,vimComment
1558 \ contains=vimSpecFile
1559syn match vimRedirRegisterOperator contained ">>\="
1560syn match vimRedirRegister contained "@[a-zA-Z*+"]" nextgroup=vimRedirRegisterOperator
1561syn match vimRedirVariableOperator contained "=>>\=" skipwhite nextgroup=vimVar
1562syn keyword vimRedirEnd contained END
1563
Doug Kearns262e25e2024-06-14 20:16:35 +02001564" Sleep: {{{2
1565" =====
1566syn keyword vimSleep sl[eep] skipwhite nextgroup=vimSleepBang,vimSleepArg
1567syn match vimSleepBang contained "\a\@1<=!" skipwhite nextgroup=vimSleepArg
1568syn match vimSleepArg contained "\<\%(\d\+\)\=m\=\>"
1569
Doug Kearns9b171bd2025-04-10 19:59:22 +02001570" Sort: {{{2
1571" ====
1572syn match vimSort "\<sort\=\>" skipwhite nextgroup=vimSortBang,@vimSortOptions,vimSortPattern,vimCmdSep
1573syn match vimSortBang contained "\a\@1<=!" skipwhite nextgroup=@vimSortOptions,vimSortPattern,vimCmdSep
1574syn match vimSortOptionsError contained "\a\+"
1575syn match vimSortOptions contained "\<[ilur]*[nfxob]\=[ilur]*\>" skipwhite nextgroup=vimSortPattern,vimCmdSep
1576syn region vimSortPattern contained
1577 \ matchgroup=Delimiter
1578 \ start="\z([^[:space:][:alpha:]|]\)"
1579 \ skip="\\\\\|\\\z1"
1580 \ end="\z1"
1581 \ skipwhite nextgroup=@vimSortOptions,vimCmdSep
1582 \ contains=@vimSubstList
1583 \ oneline
1584
1585syn cluster vimSortOptions contains=vimSortOptions,vimSortOptionsError
1586
Doug Kearnsca793e62025-06-24 20:23:34 +02001587" Uniq: {{{2
1588" ====
1589syn match vimUniq "\<uniq\=\>" skipwhite nextgroup=vimUniqBang,@vimUniqOptions,vimUniqPattern,vimCmdSep
1590syn match vimUniqBang contained "\a\@1<=!" skipwhite nextgroup=@vimUniqOptions,vimUniqPattern,vimCmdSep
1591syn match vimUniqOptionsError contained "\a\+"
1592syn match vimUniqOptions contained "\<[ilur]*\>" skipwhite nextgroup=vimUniqPattern,vimCmdSep
1593syn region vimUniqPattern contained
1594 \ matchgroup=Delimiter
1595 \ start="\z([^[:space:][:alpha:]|]\)"
1596 \ skip="\\\\\|\\\z1"
1597 \ end="\z1"
1598 \ skipwhite nextgroup=@vimUniqOptions,vimCmdSep
1599 \ contains=@vimSubstList
1600 \ oneline
1601
1602syn cluster vimUniqOptions contains=vimUniqOptions,vimUniqOptionsError
1603
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001604" Syntax: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001605"=======
dkearns21ce1592024-01-29 04:54:08 +11001606syn match vimGroupList contained "[^[:space:],]\+\%(\s*,\s*[^[:space:],]\+\)*" contains=vimGroupSpecial
1607syn 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
1608syn keyword vimGroupSpecial contained ALL ALLBUT CONTAINED TOP
1609
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001610if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsynerror")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001611 syn match vimSynError contained "\i\+"
1612 syn match vimSynError contained "\i\+=" nextgroup=vimGroupList
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001613endif
dkearns21ce1592024-01-29 04:54:08 +11001614syn match vimSynContains contained "\<contain\%(s\|edin\)=" skipwhite skipnl nextgroup=vimGroupList
1615syn match vimSynKeyContainedin contained "\<containedin=" skipwhite skipnl nextgroup=vimGroupList
1616syn match vimSynNextgroup contained "\<nextgroup=" skipwhite skipnl nextgroup=vimGroupList
dkearnsc79646d2024-01-05 08:58:48 +11001617if has("conceal")
dkearns21ce1592024-01-29 04:54:08 +11001618 " no whitespace allowed after '='
dkearnsc79646d2024-01-05 08:58:48 +11001619 syn match vimSynCchar contained "\<cchar=" nextgroup=vimSynCcharValue
1620 syn match vimSynCcharValue contained "\S"
1621endif
1622
dkearns04e53632024-04-11 06:18:37 +10001623syn match vimSyntax "\<sy\%[ntax]\>" contains=vimCommand skipwhite nextgroup=vimSynType,@vimComment
Doug Kearns51289202025-06-11 21:16:14 +02001624syn cluster vimFunctionBodyList add=vimSyntax
Bram Moolenaar071d4272004-06-13 20:20:40 +00001625
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001626" Syntax: case {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +01001627syn keyword vimSynType contained case skipwhite nextgroup=vimSynCase,vimSynCaseError
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001628if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsyncaseerror")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001629 syn match vimSynCaseError contained "\i\+"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001630endif
Bram Moolenaar5c736222010-01-06 20:54:52 +01001631syn keyword vimSynCase contained ignore match
Bram Moolenaar071d4272004-06-13 20:20:40 +00001632
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001633" Syntax: clear {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +01001634syn keyword vimSynType contained clear skipwhite nextgroup=vimGroupList
Bram Moolenaar071d4272004-06-13 20:20:40 +00001635
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001636" Syntax: cluster {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +01001637syn keyword vimSynType contained cluster skipwhite nextgroup=vimClusterName
dkearns21ce1592024-01-29 04:54:08 +11001638syn region vimClusterName contained keepend matchgroup=vimGroupName start="\h\w*\>" skip=+\\\\\|\\\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="$\||" contains=@vimContinue,vimGroupAdd,vimGroupRem,vimSynContains,vimSynError
1639syn match vimGroupAdd contained keepend "\<add=" skipwhite skipnl nextgroup=vimGroupList
1640syn match vimGroupRem contained keepend "\<remove=" skipwhite skipnl nextgroup=vimGroupList
Bram Moolenaar071d4272004-06-13 20:20:40 +00001641
Doug Kearns0fab8912025-03-10 21:04:53 +01001642" Syntax: conceal {{{2
1643syn match vimSynType contained "\<conceal\>" skipwhite nextgroup=vimSynConceal,vimSynConcealError
1644if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsynconcealerror")
1645 syn match vimSynConcealError contained "\i\+"
Brad Kingd4634a22024-01-03 10:17:24 -05001646endif
Doug Kearns0fab8912025-03-10 21:04:53 +01001647syn keyword vimSynConceal contained on off
1648
1649" Syntax: foldlevel {{{2
1650syn keyword vimSynType contained foldlevel skipwhite nextgroup=vimSynFoldlevel,vimSynFoldlevelError
1651if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsynfoldlevelerror")
1652 syn match vimSynFoldlevelError contained "\i\+"
1653endif
1654syn keyword vimSynFoldlevel contained start minimum
Brad Kingd4634a22024-01-03 10:17:24 -05001655
Bram Moolenaar13d5aee2016-01-21 23:36:05 +01001656" Syntax: iskeyword {{{2
Doug Kearns0fab8912025-03-10 21:04:53 +01001657syn keyword vimSynType contained iskeyword skipwhite nextgroup=vimSynIskeyword
1658syn keyword vimSynIskeyword contained clear
1659syn match vimSynIskeyword contained "\S\+" contains=vimSynIskeywordSep
1660syn match vimSynIskeywordSep contained ","
Bram Moolenaar13d5aee2016-01-21 23:36:05 +01001661
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001662" Syntax: include {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +01001663syn keyword vimSynType contained include skipwhite nextgroup=vimGroupList
Bram Moolenaar071d4272004-06-13 20:20:40 +00001664
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001665" Syntax: keyword {{{2
dkearns21ce1592024-01-29 04:54:08 +11001666syn cluster vimSynKeyGroup contains=@vimContinue,vimSynCchar,vimSynNextgroup,vimSynKeyOpt,vimSynKeyContainedin
Bram Moolenaar5c736222010-01-06 20:54:52 +01001667syn keyword vimSynType contained keyword skipwhite nextgroup=vimSynKeyRegion
dkearns21ce1592024-01-29 04:54:08 +11001668syn region vimSynKeyRegion contained keepend matchgroup=vimGroupName start="\h\w*\>" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|\|$" contains=@vimSynKeyGroup
Doug Kearns0fab8912025-03-10 21:04:53 +01001669syn match vimSynKeyOpt contained "\%#=1\<\%(conceal\|contained\|transparent\|skipempty\|skipwhite\|skipnl\)\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001670
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001671" Syntax: match {{{2
dkearns21ce1592024-01-29 04:54:08 +11001672syn cluster vimSynMtchGroup contains=@vimContinue,vimSynCchar,vimSynContains,vimSynError,vimSynMtchOpt,vimSynNextgroup,vimSynRegPat,vimNotation,vimMtchComment
Bram Moolenaar5c736222010-01-06 20:54:52 +01001673syn keyword vimSynType contained match skipwhite nextgroup=vimSynMatchRegion
dkearns21ce1592024-01-29 04:54:08 +11001674syn region vimSynMatchRegion contained keepend matchgroup=vimGroupName start="\h\w*\>" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|\|$" contains=@vimSynMtchGroup
Doug Kearns0fab8912025-03-10 21:04:53 +01001675syn match vimSynMtchOpt contained "\%#=1\<\%(conceal\|transparent\|contained\|excludenl\|keepend\|skipempty\|skipwhite\|display\|extend\|skipnl\|fold\)\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001676
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001677" Syntax: off and on {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +01001678syn keyword vimSynType contained enable list manual off on reset
Bram Moolenaar071d4272004-06-13 20:20:40 +00001679
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001680" Syntax: region {{{2
dkearns21ce1592024-01-29 04:54:08 +11001681syn cluster vimSynRegPatGroup contains=@vimContinue,vimPatSep,vimNotPatSep,vimSynPatRange,vimSynNotPatRange,vimSubstSubstr,vimPatRegion,vimPatSepErr,vimNotation
1682syn cluster vimSynRegGroup contains=@vimContinue,vimSynCchar,vimSynContains,vimSynNextgroup,vimSynRegOpt,vimSynReg,vimSynMtchGrp
Bram Moolenaar5c736222010-01-06 20:54:52 +01001683syn keyword vimSynType contained region skipwhite nextgroup=vimSynRegion
Doug Kearns0fab8912025-03-10 21:04:53 +01001684syn region vimSynRegion contained keepend matchgroup=vimGroupName start="\h\w*" skip=+\\\\\|\\\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|\|$" contains=@vimSynRegGroup
1685syn match vimSynRegOpt contained "\%#=1\<\%(conceal\%(ends\)\=\|transparent\|contained\|excludenl\|skipempty\|skipwhite\|display\|keepend\|oneline\|extend\|skipnl\|fold\)\>"
dkearns21ce1592024-01-29 04:54:08 +11001686syn match vimSynReg contained "\<\%(start\|skip\|end\)=" nextgroup=vimSynRegPat
Bram Moolenaar5c736222010-01-06 20:54:52 +01001687syn match vimSynMtchGrp contained "matchgroup=" nextgroup=vimGroup,vimHLGroup
dkearns21ce1592024-01-29 04:54:08 +11001688syn region vimSynRegPat contained extend start="\z([-`~!@#$%^&*_=+;:'",./?]\)" skip=/\\\\\|\\\z1\|\n\s*\\\|\n\s*"\\ / end="\z1" contains=@vimSynRegPatGroup skipwhite nextgroup=vimSynPatMod,vimSynReg
Doug Kearns0fab8912025-03-10 21:04:53 +01001689syn match vimSynPatMod contained "\%#=1\%(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\%([-+]\d\+\)\="
1690syn match vimSynPatMod contained "\%#=1\%(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\%([-+]\d\+\)\=," nextgroup=vimSynPatMod
Bram Moolenaar5c736222010-01-06 20:54:52 +01001691syn match vimSynPatMod contained "lc=\d\+"
1692syn match vimSynPatMod contained "lc=\d\+," nextgroup=vimSynPatMod
1693syn region vimSynPatRange contained start="\[" skip="\\\\\|\\]" end="]"
1694syn match vimSynNotPatRange contained "\\\\\|\\\["
1695syn match vimMtchComment contained '"[^"]\+$'
Bram Moolenaar071d4272004-06-13 20:20:40 +00001696
Doug Kearns0fab8912025-03-10 21:04:53 +01001697" Syntax: spell {{{2
1698syn keyword vimSynType contained spell skipwhite nextgroup=vimSynSpell,vimSynSpellError
1699if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsynspellerror")
1700 syn match vimSynSpellError contained "\i\+"
1701endif
1702syn keyword vimSynSpell contained default notoplevel toplevel
1703
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001704" Syntax: sync {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001705" ============
Doug Kearns0fab8912025-03-10 21:04:53 +01001706syn keyword vimSynType contained sync skipwhite nextgroup=vimSyncClear,vimSyncMatch,vimSyncError,vimSyncRegion,vimSyncArgs
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001707if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsyncerror")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001708 syn match vimSyncError contained "\i\+"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001709endif
Doug Kearns0fab8912025-03-10 21:04:53 +01001710
1711syn region vimSyncArgs contained start="\S" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|\|$" contains=vimSyncLines,vimSyncLinebreak,vimSyncLinecont,vimSyncFromstart,vimSyncCcomment
1712
1713syn keyword vimSyncCcomment contained ccomment skipwhite nextgroup=vimGroupName
1714syn keyword vimSyncClear contained clear skipwhite nextgroup=vimSyncGroupName
1715syn keyword vimSyncFromstart contained fromstart
Bram Moolenaar5c736222010-01-06 20:54:52 +01001716syn keyword vimSyncMatch contained match skipwhite nextgroup=vimSyncGroupName
Doug Kearnsb55f0222025-03-15 09:29:31 +01001717syn keyword vimSyncRegion contained region skipwhite nextgroup=vimSynRegion
Doug Kearns0fab8912025-03-10 21:04:53 +01001718syn match vimSyncLinebreak contained "\<linebreaks=" nextgroup=vimNumber
Bram Moolenaar5c736222010-01-06 20:54:52 +01001719syn keyword vimSyncLinecont contained linecont skipwhite nextgroup=vimSynRegPat
Doug Kearns0fab8912025-03-10 21:04:53 +01001720syn match vimSyncLines contained "\<lines=" nextgroup=vimNumber
1721syn match vimSyncLines contained "\<minlines=" nextgroup=vimNumber
1722syn match vimSyncLines contained "\<maxlines=" nextgroup=vimNumber
1723syn match vimSyncGroupName contained "\<\h\w*\>" skipwhite nextgroup=vimSyncKey
1724syn match vimSyncKey contained "\<grouphere\>" skipwhite nextgroup=vimSyncGroup
1725syn match vimSyncKey contained "\<groupthere\>" skipwhite nextgroup=vimSyncGroup
1726syn match vimSyncGroup contained "\<\h\w*\>" skipwhite nextgroup=vimSynRegPat,vimSyncNone
Bram Moolenaar5c736222010-01-06 20:54:52 +01001727syn keyword vimSyncNone contained NONE
Bram Moolenaar071d4272004-06-13 20:20:40 +00001728
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001729" Additional IsCommand: here by reasons of precedence {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001730" ====================
Bram Moolenaar5c736222010-01-06 20:54:52 +01001731syn match vimIsCommand "<Bar>\s*\a\+" transparent contains=vimCommand,vimNotation
Bram Moolenaar071d4272004-06-13 20:20:40 +00001732
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001733" Highlighting: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001734" ============
dkearns04e53632024-04-11 06:18:37 +10001735syn cluster vimHighlightCluster contains=vimHiLink,vimHiClear,vimHiKeyList,@vimComment
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001736if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimhictermerror")
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001737 syn match vimHiCtermError contained "\D\i*"
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001738endif
Bram Moolenaar5c736222010-01-06 20:54:52 +01001739syn match vimHighlight "\<hi\%[ghlight]\>" skipwhite nextgroup=vimHiBang,@vimHighlightCluster
dkearns9530fe42024-03-19 05:19:51 +11001740syn match vimHiBang contained "\a\@1<=!" skipwhite nextgroup=@vimHighlightCluster
Bram Moolenaard960d762011-09-21 19:22:10 +02001741
Bram Moolenaar071d4272004-06-13 20:20:40 +00001742syn case ignore
Doug Kearnsc233c2e2025-07-03 20:57:03 +02001743" Conceal is a generated low-priority match
1744syn match vimHiGroup contained "\%(\<Conceal\>\)\@!\i\+"
Doug Kearns0fab8912025-03-10 21:04:53 +01001745syn keyword vimHiNone contained NONE
dkearnsb614b282024-02-12 03:13:34 +11001746syn keyword vimHiAttrib contained none bold inverse italic nocombine reverse standout strikethrough underline undercurl underdashed underdotted underdouble
Bram Moolenaar5c736222010-01-06 20:54:52 +01001747syn keyword vimFgBgAttrib contained none bg background fg foreground
Bram Moolenaar071d4272004-06-13 20:20:40 +00001748syn case match
Bram Moolenaar5c736222010-01-06 20:54:52 +01001749syn match vimHiAttribList contained "\i\+" contains=vimHiAttrib
1750syn match vimHiAttribList contained "\i\+,"he=e-1 contains=vimHiAttrib nextgroup=vimHiAttribList
Bram Moolenaar071d4272004-06-13 20:20:40 +00001751syn case ignore
Bram Moolenaard2ea7cf2021-05-30 20:54:13 +02001752syn 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 +01001753syn match vimHiCtermColor contained "\<color\d\{1,3}\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001754syn case match
Doug Kearns0fab8912025-03-10 21:04:53 +01001755
Bram Moolenaar5c736222010-01-06 20:54:52 +01001756syn match vimHiFontname contained "[a-zA-Z\-*]\+"
1757syn match vimHiGuiFontname contained "'[a-zA-Z\-* ]\+'"
1758syn match vimHiGuiRgb contained "#\x\{6}"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001759
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001760" Highlighting: hi group key=arg ... {{{2
Eisuke Kawashima834bb852025-06-07 17:59:11 +02001761syn cluster vimHiCluster contains=vimGroup,vimHLGroup,vimHiGroup,vimHiNone,vimHiTerm,vimHiCTerm,vimHiStartStop,vimHiCtermFgBg,vimHiCtermul,vimHiCtermfont,vimHiGui,vimHiGuiFont,vimHiGuiFgBg,vimHiKeyError,vimNotation,vimComment,vim9comment
dkearns9530fe42024-03-19 05:19:51 +11001762syn 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 +01001763if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_vimhikeyerror")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001764 syn match vimHiKeyError contained "\i\+="he=e-1
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001765endif
Bram Moolenaar5c736222010-01-06 20:54:52 +01001766syn match vimHiTerm contained "\cterm="he=e-1 nextgroup=vimHiAttribList
dkearns9530fe42024-03-19 05:19:51 +11001767syn match vimHiStartStop contained "\c\%(start\|stop\)="he=e-1 nextgroup=vimHiTermcap,vimOption
Bram Moolenaar5c736222010-01-06 20:54:52 +01001768syn match vimHiCTerm contained "\ccterm="he=e-1 nextgroup=vimHiAttribList
Bram Moolenaar83d1b192015-04-13 14:22:40 +02001769syn match vimHiCtermFgBg contained "\ccterm[fb]g="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
Bram Moolenaar2547aa92020-07-26 17:00:44 +02001770syn match vimHiCtermul contained "\cctermul="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
PMuncha606f3a2023-11-15 15:35:49 +01001771syn match vimHiCtermfont contained "\cctermfont="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
Bram Moolenaar5c736222010-01-06 20:54:52 +01001772syn match vimHiGui contained "\cgui="he=e-1 nextgroup=vimHiAttribList
1773syn match vimHiGuiFont contained "\cfont="he=e-1 nextgroup=vimHiFontname
1774syn match vimHiGuiFgBg contained "\cgui\%([fb]g\|sp\)="he=e-1 nextgroup=vimHiGroup,vimHiGuiFontname,vimHiGuiRgb,vimFgBgAttrib
1775syn match vimHiTermcap contained "\S\+" contains=vimNotation
Bram Moolenaar83d1b192015-04-13 14:22:40 +02001776syn match vimHiNmbr contained '\d\+'
Bram Moolenaar071d4272004-06-13 20:20:40 +00001777
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001778" Highlight: clear {{{2
Eisuke Kawashima834bb852025-06-07 17:59:11 +02001779syn keyword vimHiClear contained clear skipwhite nextgroup=vimGroup,vimHLGroup,vimHiGroup
Bram Moolenaar071d4272004-06-13 20:20:40 +00001780
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001781" Highlight: link {{{2
Bram Moolenaard2855f52018-07-31 22:23:58 +02001782" see tst24 (hi def vs hi) (Jul 06, 2018)
1783"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 +11001784" TODO: simplify and allow line continuations --djk
1785syn 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 +00001786
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001787" Control Characters: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001788" ==================
Bram Moolenaar5c736222010-01-06 20:54:52 +01001789syn match vimCtrlChar "[- -]"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001790
Doug Kearnsa577e422025-05-17 16:29:13 +02001791" Embedded Scripts: {{{2
1792" ================
1793" perl,ruby : Benoit Cerrina
1794" python,tcl : Johannes Zellner
1795" mzscheme, lua : Charles Campbell
1796
1797" Allows users to specify the type of embedded script highlighting
1798" they want: (lua/mzscheme/perl/python/ruby/tcl support)
1799" g:vimsyn_embed == 0 : don't embed any scripts
1800" g:vimsyn_embed =~# 'l' : embed Lua
1801" g:vimsyn_embed =~# 'm' : embed MzScheme
1802" g:vimsyn_embed =~# 'p' : embed Perl
1803" g:vimsyn_embed =~# 'P' : embed Python
1804" g:vimsyn_embed =~# 'r' : embed Ruby
1805" g:vimsyn_embed =~# 't' : embed Tcl
1806
1807let s:interfaces = get(g:, "vimsyn_embed", "lP")
1808
1809" [-- lua --] {{{3
1810if s:interfaces =~# 'l'
1811 syn include @vimLuaScript syntax/lua.vim
1812 unlet b:current_syntax
Doug Kearnsa577e422025-05-17 16:29:13 +02001813endif
1814
1815syn keyword vimLua lua skipwhite nextgroup=vimLuaHeredoc,vimLuaStatement
1816syn keyword vimLua luado skipwhite nextgroup=vimLuaStatement
1817syn keyword vimLua luafile
1818
1819syn region vimLuaStatement contained
1820 \ start="\S"
1821 \ skip=+\n\s*\%(\\\|["#]\\ \)+
1822 \ end="$"
1823 \ contains=@vimLuaScript,@vimContinue
1824VimFoldl syn region vimLuaHeredoc contained
1825 \ matchgroup=vimScriptHeredocStart
1826 \ start=+<<\s*\z(\S\+\)\ze\s*$+
1827 \ matchgroup=vimScriptHeredocStop
1828 \ end=+^\z1$+
1829 \ contains=@vimLuaScript
1830VimFoldl syn region vimLuaHeredoc contained
1831 \ matchgroup=vimScriptHeredocStart
1832 \ start=+<<\ze\s*$+
1833 \ matchgroup=vimScriptHeredocStop
1834 \ end=+^\.$+
1835 \ contains=@vimLuaScript
1836VimFoldl syn region vimLuaHeredoc contained
1837 \ matchgroup=vimScriptHeredocStart
1838 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\s\+\z(\S\+\)\ze\s*$+
1839 \ matchgroup=vimScriptHeredocStop
1840 \ end=+^\z1\=\z2$+
1841 \ contains=@vimLuaScript
1842VimFoldl syn region vimLuaHeredoc contained
1843 \ matchgroup=vimScriptHeredocStart
1844 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\ze\s*$+
1845 \ matchgroup=vimScriptHeredocStop
1846 \ end=+^\z1\=\.$+
1847 \ contains=@vimLuaScript
1848
1849" [-- mzscheme --] {{{3
1850if s:interfaces =~# 'm'
1851 let s:iskKeep = &isk
1852 syn include @vimMzSchemeScript syntax/scheme.vim
1853 unlet b:current_syntax
1854 let &isk = s:iskKeep
1855endif
1856
1857syn keyword vimMzScheme mz[scheme] skipwhite nextgroup=vimMzSchemeHeredoc,vimMzSchemeStatement
1858syn keyword vimMzScheme mzf[ile]
1859
1860syn region vimMzSchemeStatement contained
1861 \ start="\S"
1862 \ skip=+\n\s*\%(\\\|["#]\\ \)+
1863 \ end="$"
1864 \ contains=@vimMzSchemeScript,@vimContinue
1865VimFoldm syn region vimMzSchemeHeredoc contained
1866 \ matchgroup=vimScriptHeredocStart
1867 \ start=+<<\s*\z(\S\+\)\ze\s*$+
1868 \ matchgroup=vimScriptHeredocStop
1869 \ end=+^\z1$+
1870 \ contains=@vimMzSchemeScript
1871VimFoldm syn region vimMzSchemeHeredoc contained
1872 \ matchgroup=vimScriptHeredocStart
1873 \ start=+<<\ze\s*$+
1874 \ matchgroup=vimScriptHeredocStop
1875 \ end=+^\.$+
1876 \ contains=@vimMzSchemeScript
1877VimFoldm syn region vimMzSchemeHeredoc contained
1878 \ matchgroup=vimScriptHeredocStart
1879 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\s\+\z(\S\+\)\ze\s*$+
1880 \ matchgroup=vimScriptHeredocStop
1881 \ end=+^\z1\=\z2$+
1882 \ contains=@vimMzSchemeScript
1883VimFoldm syn region vimMzSchemeHeredoc contained
1884 \ matchgroup=vimScriptHeredocStart
1885 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\ze\s*$+
1886 \ matchgroup=vimScriptHeredocStop
1887 \ end=+^\z1\=\.$+
1888 \ contains=@vimMzSchemeScript
1889
1890" [-- perl --] {{{3
1891if s:interfaces =~# 'p'
1892 syn include @vimPerlScript syntax/perl.vim
1893 unlet b:current_syntax
1894endif
1895
1896syn keyword vimPerl pe[rl] skipwhite nextgroup=vimPerlHeredoc,vimPerlStatement
1897syn keyword vimPerl perld[o] skipwhite nextgroup=vimPerlStatement
1898
1899syn region vimPerlStatement contained
1900 \ start="\S"
1901 \ skip=+\n\s*\%(\\\|["#]\\ \)+
1902 \ end="$"
1903 \ contains=@vimPerlScript,@vimContinue
1904VimFoldp syn region vimPerlHeredoc contained
1905 \ matchgroup=vimScriptHeredocStart
1906 \ start=+<<\s*\z(\S\+\)\ze\s*$+
1907 \ matchgroup=vimScriptHeredocStop
1908 \ end=+^\z1$+ contains=@vimPerlScript
1909VimFoldp syn region vimPerlHeredoc contained
1910 \ matchgroup=vimScriptHeredocStart
1911 \ start=+<<\ze\s*$+ matchgroup=vimScriptHeredocStop
1912 \ end=+^\.$+
1913 \ contains=@vimPerlScript
1914VimFoldp syn region vimPerlHeredoc contained
1915 \ matchgroup=vimScriptHeredocStart
1916 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\s\+\z(\S\+\)\ze\s*$+
1917 \ matchgroup=vimScriptHeredocStop
1918 \ end=+^\z1\=\z2$+
1919 \ contains=@vimPerlScript
1920VimFoldp syn region vimPerlHeredoc contained
1921 \ matchgroup=vimScriptHeredocStart
1922 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\ze\s*$+
1923 \ matchgroup=vimScriptHeredocStop
1924 \ end=+^\z1\=\.$+
1925 \ contains=@vimPerlScript
1926
1927" [-- python --] {{{3
1928if s:interfaces =~# 'P'
1929 syn include @vimPythonScript syntax/python2.vim
1930 unlet b:current_syntax
1931endif
1932
1933syn keyword vimPython py[thon] skipwhite nextgroup=vimPythonHeredoc,vimPythonStatement
1934syn keyword vimPython pydo skipwhite nextgroup=vimPythonStatement
1935syn keyword vimPython pyfile
1936
1937syn region vimPythonStatement contained
1938 \ start="\S"
1939 \ skip=+\n\s*\%(\\\|["#]\\ \)+
1940 \ end="$"
1941 \ contains=@vimPythonScript,@vimContinue
1942VimFoldP syn region vimPythonHeredoc contained
1943 \ matchgroup=vimScriptHeredocStart
1944 \ start=+<<\s*\z(\S\+\)\ze\s*$+
1945 \ matchgroup=vimScriptHeredocStop
1946 \ end=+^\z1$+
1947 \ contains=@vimPythonScript
1948VimFoldP syn region vimPythonHeredoc contained
1949 \ matchgroup=vimScriptHeredocStart
1950 \ start=+<<\ze\s*$+
1951 \ matchgroup=vimScriptHeredocStop
1952 \ end=+^\.$+
1953 \ contains=@vimPythonScript
1954VimFoldP syn region vimPythonHeredoc contained
1955 \ matchgroup=vimScriptHeredocStart
1956 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\s\+\z(\S\+\)\ze\s*$+
1957 \ matchgroup=vimScriptHeredocStop
1958 \ end=+^\z1\=\z2$+
1959 \ contains=@vimPythonScript
1960VimFoldP syn region vimPythonHeredoc contained
1961 \ matchgroup=vimScriptHeredocStart
1962 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\ze\s*$+
1963 \ matchgroup=vimScriptHeredocStop
1964 \ end=+^\z1\=\.$+
1965 \ contains=@vimPythonScript
1966
1967" [-- python3 --] {{{3
1968if s:interfaces =~# 'P'
1969 syn include @vimPython3Script syntax/python.vim
1970 unlet b:current_syntax
1971endif
1972
1973syn keyword vimPython3 python3 py3 skipwhite nextgroup=vimPython3Heredoc,vimPython3Statement
1974syn keyword vimPython3 py3do skipwhite nextgroup=vimPython3Statement
1975syn keyword vimPython3 py3file
1976
1977syn region vimPython3Statement contained
1978 \ start="\S"
1979 \ skip=+\n\s*\%(\\\|["#]\\ \)+
1980 \ end="$"
1981 \ contains=@vimPython3Script,@vimContinue
1982VimFoldP syn region vimPython3Heredoc contained
1983 \ matchgroup=vimScriptHeredocStart
1984 \ start=+<<\s*\z(\S\+\)\ze\s*$+
1985 \ matchgroup=vimScriptHeredocStop
1986 \ end=+^\z1$+
1987 \ contains=@vimPython3Script
1988VimFoldP syn region vimPython3Heredoc contained
1989 \ matchgroup=vimScriptHeredocStart
1990 \ start=+<<\ze\s*$+
1991 \ matchgroup=vimScriptHeredocStop
1992 \ end=+^\.$+
1993 \ contains=@vimPython3Script
1994VimFoldP syn region vimPython3Heredoc contained
1995 \ matchgroup=vimScriptHeredocStart
1996 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\s\+\z(\S\+\)\ze\s*$+
1997 \ matchgroup=vimScriptHeredocStop
1998 \ end=+^\z1\=\z2$+
1999 \ contains=@vimPython3Script
2000VimFoldP syn region vimPython3Heredoc contained
2001 \ matchgroup=vimScriptHeredocStart
2002 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\ze\s*$+
2003 \ matchgroup=vimScriptHeredocStop
2004 \ end=+^\z1\=\.$+
2005 \ contains=@vimPython3Script
2006
2007" [-- pythonx --] {{{3
2008if s:interfaces =~# 'P'
2009 if &pyxversion == 2
2010 syn cluster vimPythonXScript contains=@vimPythonScript
2011 else
2012 syn cluster vimPythonXScript contains=@vimPython3Script
2013 endif
2014endif
2015
2016syn keyword vimPythonX pythonx pyx skipwhite nextgroup=vimPythonXHeredoc,vimPythonXStatement
2017syn keyword vimPythonX pyxdo skipwhite nextgroup=vimPythonXStatement
2018syn keyword vimPythonX pyxfile
2019
2020syn region vimPythonXStatement contained
2021 \ start="\S"
2022 \ skip=+\n\s*\%(\\\|["#]\\ \)+
2023 \ end="$"
2024 \ contains=@vimPythonXScript,@vimContinue
2025VimFoldP syn region vimPythonXHeredoc contained
2026 \ matchgroup=vimScriptHeredocStart
2027 \ start=+<<\s*\z(\S\+\)\ze\s*$+
2028 \ matchgroup=vimScriptHeredocStop
2029 \ end=+^\z1$+
2030 \ contains=@vimPythonXScript
2031VimFoldP syn region vimPythonXHeredoc contained
2032 \ matchgroup=vimScriptHeredocStart
2033 \ start=+<<\ze\s*$+
2034 \ matchgroup=vimScriptHeredocStop
2035 \ end=+^\.$+
2036 \ contains=@vimPythonXScript
2037VimFoldP syn region vimPythonXHeredoc contained
2038 \ matchgroup=vimScriptHeredocStart
2039 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\s\+\z(\S\+\)\ze\s*$+
2040 \ matchgroup=vimScriptHeredocStop
2041 \ end=+^\z1\=\z2$+
2042 \ contains=@vimPythonXScript
2043VimFoldP syn region vimPythonXHeredoc contained
2044 \ matchgroup=vimScriptHeredocStart
2045 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\ze\s*$+
2046 \ matchgroup=vimScriptHeredocStop
2047 \ end=+^\z1\=\.$+
2048 \ contains=@vimPythonXScript
2049
2050" [-- ruby --] {{{3
2051if s:interfaces =~# 'r'
2052 syn include @vimRubyScript syntax/ruby.vim
2053 unlet b:current_syntax
2054endif
2055
2056syn keyword vimRuby rub[y] skipwhite nextgroup=vimRubyHeredoc,vimRubyStatement
2057syn keyword vimRuby rubyd[o] skipwhite nextgroup=vimRubyStatement
2058syn keyword vimRuby rubyf[ile]
2059
2060syn region vimRubyStatement contained
2061 \ start="\S"
2062 \ skip=+\n\s*\%(\\\|["#]\\ \)+
2063 \ end="$"
2064 \ contains=@vimRubyScript,@vimContinue
2065VimFoldr syn region vimRubyHeredoc contained
2066 \ matchgroup=vimScriptHeredocStart
2067 \ start=+<<\s*\z(\S\+\)\ze\s*$+
2068 \ matchgroup=vimScriptHeredocStop
2069 \ end=+^\z1$+
2070 \ contains=@vimRubyScript
2071VimFoldr syn region vimRubyHeredoc contained
2072 \ matchgroup=vimScriptHeredocStart
2073 \ start=+<<\ze\s*$+ matchgroup=vimScriptHeredocStop
2074 \ end=+^\.$+
2075 \ contains=@vimRubyScript
2076VimFoldr syn region vimRubyHeredoc contained
2077 \ matchgroup=vimScriptHeredocStart
2078 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\s\+\z(\S\+\)\ze\s*$+
2079 \ matchgroup=vimScriptHeredocStop
2080 \ end=+^\z1\=\z2$+
2081 \ contains=@vimRubyScript
2082VimFoldr syn region vimRubyHeredoc contained
2083 \ matchgroup=vimScriptHeredocStart
2084 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\ze\s*$+
2085 \ matchgroup=vimScriptHeredocStop
2086 \ end=+^\z1\.$+
2087 \ contains=@vimRubyScript
2088
2089" [-- tcl --] {{{3
2090if s:interfaces =~# 't'
2091 syn include @vimTclScript syntax/tcl.vim
2092 unlet b:current_syntax
2093endif
2094
2095syn keyword vimTcl tcl skipwhite nextgroup=vimTclHeredoc,vimTclStatement
2096syn keyword vimTcl tcld[o] skipwhite nextgroup=vimTclStatement
2097syn keyword vimTcl tclf[ile]
2098syn region vimTclStatement contained
2099 \ start="\S"
2100 \ skip=+\n\s*\%(\\\|["#]\\ \)+
2101 \ end="$"
2102 \ contains=@vimTclScript,@vimContinue
2103VimFoldt syn region vimTclHeredoc contained
2104 \ matchgroup=vimScriptHeredocStart
2105 \ start=+<<\s*\z(\S\+\)\ze\s*$+
2106 \ matchgroup=vimScriptHeredocStop
2107 \ end=+^\z1$+
2108 \ contains=@vimTclScript
2109VimFoldt syn region vimTclHeredoc contained
2110 \ matchgroup=vimScriptHeredocStart
2111 \ start=+<<\ze\s*$+
2112 \ matchgroup=vimScriptHeredocStop
2113 \ end=+^\.$+
2114 \ contains=@vimTclScript
2115VimFoldt syn region vimTclHeredoc contained
2116 \ matchgroup=vimScriptHeredocStart
2117 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\s\+\z(\S\+\)\ze\s*$+
2118 \ matchgroup=vimScriptHeredocStop
2119 \ end=+^\z1\=\z2$+
2120 \ contains=@vimTclScript
2121VimFoldt syn region vimTclHeredoc contained
2122 \ matchgroup=vimScriptHeredocStart
2123 \ start=+\%(^\z(\s*\)\S.*\)\@<=<<\s*trim\ze\s*$+
2124 \ matchgroup=vimScriptHeredocStop
2125 \ end=+^\z1\=\.$+
2126 \ contains=@vimTclScript
2127
2128unlet s:interfaces
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00002129" Beginners - Patterns that involve ^ {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00002130" =========
Doug Kearns35699f12024-09-19 19:51:59 +02002131Vim9 syn region vim9LineComment start=+^[ \t:]*\zs#.*$+ skip=+\n\s*\\\|\n\s*#\\ + end="$" contains=@vimCommentGroup,vimCommentString,vim9CommentTitle extend
2132VimL syn region vimLineComment start=+^[ \t:]*\zs".*$+ skip=+\n\s*\\\|\n\s*"\\ + end="$" contains=@vimCommentGroup,vimCommentString,vimCommentTitle extend
Doug Kearnsd65e58f2024-07-17 19:34:14 +02002133
Bram Moolenaar5c736222010-01-06 20:54:52 +01002134syn 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 +10002135syn 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 +10002136
dkearnsae321b52024-06-15 23:06:17 +10002137" allowed anywhere in the file
2138if !s:vim9script
2139 syn match vimShebangError "^\s*\zs#!.*" display
2140endif
2141syn match vimShebang "\%^#!.*" display
2142
dkearns21ce1592024-01-29 04:54:08 +11002143syn match vimContinue "^\s*\zs\\"
Doug Kearns4f010c92025-02-13 20:24:42 +01002144syn match vimContinueComment '^\s*\zs["#]\\ .*' extend
2145syn match vim9ContinueComment "^\s*\zs#\\ .*" extend
Doug Kearns818c6412024-10-06 17:00:48 +02002146syn cluster vimContinue contains=vimContinue,vimContinueComment
2147syn cluster vim9Continue contains=vimContinue,vim9ContinueComment
2148
Doug Kearnsc29b5332025-04-26 20:14:15 +02002149syn region vimString start='^\s*\\"' end='"' oneline keepend contains=@vimStringGroup,vimContinue
2150syn region vimString start="^\s*\\'" end="'" oneline keepend contains=vimQuoteEscape,vimContinue
2151
Bram Moolenaar5c736222010-01-06 20:54:52 +01002152syn match vimCommentTitleLeader '"\s\+'ms=s+1 contained
dkearns04e53632024-04-11 06:18:37 +10002153syn match vim9CommentTitleLeader '#\s\+'ms=s+1 contained
Bram Moolenaar071d4272004-06-13 20:20:40 +00002154
Bram Moolenaar18144c82006-04-12 21:52:12 +00002155" Searches And Globals: {{{2
2156" ====================
Doug Kearnsc273f1a2025-01-20 21:53:01 +01002157VimL syn match vimSearch '^\s*[/?].*' contains=vimSearchDelim
Bram Moolenaar5c736222010-01-06 20:54:52 +01002158syn match vimSearchDelim '^\s*\zs[/?]\|[/?]$' contained
Doug Kearnsc273f1a2025-01-20 21:53:01 +01002159Vim9 syn match vim9Search '^\s*:[/?].*' contains=vim9SearchDelim
2160syn match vim9SearchDelim '^\s*\zs:[/?]\|[/?]$' contained contains=vimCmdSep
dkearns2c51e152024-02-27 07:10:18 +11002161syn region vimGlobal matchgroup=Statement start='\<g\%[lobal]!\=/' skip='\\.' end='/' skipwhite nextgroup=vimSubst1
2162syn region vimGlobal matchgroup=Statement start='\<v\%[global]!\=/' skip='\\.' end='/' skipwhite nextgroup=vimSubst1
Bram Moolenaare2f98b92006-03-29 21:18:24 +00002163
Hirohito Higashifbe4a8f2025-04-27 15:28:30 +02002164" Vim9 script Regions: {{{2
dkearns04e53632024-04-11 06:18:37 +10002165" ==================
2166
2167if s:vim9script
Doug Kearnsce064932024-04-13 18:24:01 +02002168 syn cluster vimLegacyTop contains=TOP,vim9LegacyHeader,vim9Comment,vim9LineComment
2169 VimFoldH syn region vim9LegacyHeader start="\%^" end="^\ze\s*vim9s\%[cript]\>" contains=@vimLegacyTop,vimComment,vimLineComment
dkearns04e53632024-04-11 06:18:37 +10002170
Doug Kearnsce064932024-04-13 18:24:01 +02002171 syn keyword vim9Vim9ScriptArg noclear contained
2172 syn keyword vim9Vim9Script vim9s[cript] nextgroup=vim9Vim9ScriptArg skipwhite
dkearns04e53632024-04-11 06:18:37 +10002173endif
2174
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00002175" Synchronize (speed) {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00002176"============
Doug Kearnsa5b744e2025-06-30 20:22:38 +02002177
2178exe "syn sync minlines=" .. get(g:, "vimsyn_minlines", 100)
2179exe "syn sync maxlines=" .. get(g:, "vimsyn_maxlines", 200)
2180
Bram Moolenaar071d4272004-06-13 20:20:40 +00002181syn sync linecont "^\s\+\\"
Doug Kearns7b5550f2025-05-18 20:37:34 +02002182syn sync linebreaks=2
Bram Moolenaar071d4272004-06-13 20:20:40 +00002183syn sync match vimAugroupSyncA groupthere NONE "\<aug\%[roup]\>\s\+[eE][nN][dD]"
2184
Bram Moolenaar5c736222010-01-06 20:54:52 +01002185" ====================
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00002186" Highlighting Settings {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00002187" ====================
2188
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002189if !exists("skip_vim_syntax_inits")
2190 if !exists("g:vimsyn_noerror")
2191 hi def link vimBehaveError vimError
2192 hi def link vimCollClassErr vimError
2193 hi def link vimErrSetting vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002194 hi def link vimFTError vimError
2195 hi def link vimFunctionError vimError
2196 hi def link vimFunc vimError
2197 hi def link vimHiAttribList vimError
2198 hi def link vimHiCtermError vimError
2199 hi def link vimHiKeyError vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002200 hi def link vimMapModErr vimError
Doug Kearns086b3b52025-05-31 17:52:48 +02002201 hi def link vimMarkArgError vimError
dkearnsae321b52024-06-15 23:06:17 +10002202 hi def link vimShebangError vimError
Doug Kearns9b171bd2025-04-10 19:59:22 +02002203 hi def link vimSortOptionsError Error
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002204 hi def link vimSubstFlagErr vimError
2205 hi def link vimSynCaseError vimError
Doug Kearns0fab8912025-03-10 21:04:53 +01002206 hi def link vimSyncError vimError
2207 hi def link vimSynConcealError vimError
2208 hi def link vimSynError vimError
2209 hi def link vimSynFoldlevelError vimError
2210 hi def link vimSynIskeywordError vimError
2211 hi def link vimSynSpellError vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002212 hi def link vimBufnrWarn vimWarn
Doug Kearns818c6412024-10-06 17:00:48 +02002213
2214 hi def link vim9TypeAliasError vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002215 endif
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00002216
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002217 hi def link vimAbb vimCommand
2218 hi def link vimAddress vimMark
dkearnsc4aef9a2024-03-04 02:42:47 +11002219 hi def link vimAugroupBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002220 hi def link vimAugroupError vimError
2221 hi def link vimAugroupKey vimCommand
Doug Kearnsfa3b1042025-04-22 19:48:13 +02002222 hi def link vimAutocmd vimCommand
2223 hi def link vimAutocmdBang vimBang
2224 hi def link vimAutocmdPatternEscape Special
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002225 hi def link vimAutoEvent Type
Doug Kearnsfa3b1042025-04-22 19:48:13 +02002226 hi def link vimAutoEventGlob Type
2227 hi def link vimAutocmdBufferPattern Special
2228 hi def link vimAutocmdMod Special
2229 hi def link vimAutocmdPatternSep vimSep
dkearnsb614b282024-02-12 03:13:34 +11002230 hi def link vimBang vimOper
dkearns2c51e152024-02-27 07:10:18 +11002231 hi def link vimBehaveBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002232 hi def link vimBehaveModel vimBehave
2233 hi def link vimBehave vimCommand
2234 hi def link vimBracket Delimiter
Doug Kearns99984fc2024-07-18 20:45:19 +02002235 hi def link vimCall vimCommand
dkearnsa3bddb72024-06-14 01:48:10 +10002236 hi def link vimCatch vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002237 hi def link vimCmplxRepeat SpecialChar
2238 hi def link vimCommand Statement
Doug Kearnsa9b5e4a2025-07-03 20:47:50 +02002239 hi def link vimCommandModifier vimCommand
2240 hi def link vimCommandModifierBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002241 hi def link vimComment Comment
Doug Kearnsfc64ac02024-06-22 11:20:36 +02002242 hi def link vimCommentError vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002243 hi def link vimCommentString vimString
2244 hi def link vimCommentTitle PreProc
2245 hi def link vimCondHL vimCommand
dkearnsf6869212023-12-11 01:53:24 +11002246 hi def link vimConst vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002247 hi def link vimContinue Special
dkearns21ce1592024-01-29 04:54:08 +11002248 hi def link vimContinueComment vimComment
Doug Kearnsc29b5332025-04-26 20:14:15 +02002249 hi def link vimContinueString vimString
Doug Kearns4a530a62025-02-03 18:59:09 +01002250 hi def link vimCount Number
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002251 hi def link vimCtrlChar SpecialChar
Doug Kearns4a530a62025-02-03 18:59:09 +01002252 hi def link vimDebuggreedy vimCommand
Doug Kearns51289202025-06-11 21:16:14 +02002253 hi def link vimDef vimCommand
2254 hi def link vimDefBang vimBang
Doug Kearnsfc64ac02024-06-22 11:20:36 +02002255 hi def link vimDefComment vim9Comment
Doug Kearns1aa287e2025-02-10 22:00:27 +01002256 hi def link vimDefParam vimVar
Doug Kearns3c07eb02024-09-02 10:03:37 +02002257 hi def link vimDelcommand vimCommand
2258 hi def link vimDelcommandAttr vimUserCmdAttr
Doug Kearns51289202025-06-11 21:16:14 +02002259 hi def link vimDelfunction vimCommand
2260 hi def link vimDelfunctionBang vimBang
Doug Kearnsfa3b1042025-04-22 19:48:13 +02002261 hi def link vimDoautocmd vimCommand
2262 hi def link vimDoautocmdMod Special
dkearnsb1427b42024-02-28 05:59:30 +11002263 hi def link vimEcho vimCommand
dkearns61887b32024-03-15 23:45:48 +11002264 hi def link vimEchohlNone vimGroup
2265 hi def link vimEchohl vimCommand
Doug Kearnsc29b5332025-04-26 20:14:15 +02002266 hi def link vimElse vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002267 hi def link vimElseIfErr Error
dkearns35e6f4c2024-03-22 06:41:10 +11002268 hi def link vimEndfunction vimCommand
2269 hi def link vimEnddef vimCommand
Doug Kearnsc29b5332025-04-26 20:14:15 +02002270 hi def link vimEndif vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002271 hi def link vimEnvvar PreProc
2272 hi def link vimError Error
Bram Moolenaar6ba83ba2022-06-12 22:15:57 +01002273 hi def link vimEscape Special
Doug Kearns9b171bd2025-04-10 19:59:22 +02002274 hi def link vimExFilter vimCommand
Doug Kearnsa9b5e4a2025-07-03 20:47:50 +02002275 hi def link vimExFilterBang vimBang
Doug Kearns086b3b52025-05-31 17:52:48 +02002276 hi def link vimExMark vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002277 hi def link vimFBVar vimVar
2278 hi def link vimFgBgAttrib vimHiAttrib
Bram Moolenaarcbaff5e2022-04-08 17:45:08 +01002279 hi def link vimFuncEcho vimCommand
dkearns1c97b5c2023-12-13 02:47:43 +11002280 hi def link vimFor vimCommand
Doug Kearns1aa287e2025-02-10 22:00:27 +01002281 hi def link vimForInContinue vimContinue
2282 hi def link vimForInContinueComment vimContinueComment
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002283 hi def link vimFTCmd vimCommand
2284 hi def link vimFTOption vimSynType
Doug Kearns51289202025-06-11 21:16:14 +02002285 hi def link vimFunction vimCommand
2286 hi def link vimFunctionBang vimBang
2287 hi def link vimFunctionComment vimComment
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002288 hi def link vimFuncName Function
Doug Kearns51289202025-06-11 21:16:14 +02002289 hi def link vimFunctionMod Special
2290 hi def link vimFunctionParam vimVar
2291 hi def link vimFunctionParamEquals vimOper
2292 hi def link vimFunctionScope vimVarScope
2293 hi def link vimFunctionSID vimNotation
Doug Kearns9b171bd2025-04-10 19:59:22 +02002294 hi def link vimGrep vimCommand
2295 hi def link vimGrepadd vimCommand
2296 hi def link vimGrepBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002297 hi def link vimGroupAdd vimSynOption
Doug Kearns0fab8912025-03-10 21:04:53 +01002298 hi def link vimGroupName Normal
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002299 hi def link vimGroupRem vimSynOption
2300 hi def link vimGroupSpecial Special
2301 hi def link vimGroup Type
Doug Kearns9b171bd2025-04-10 19:59:22 +02002302 hi def link vimHelpgrep vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002303 hi def link vimHiAttrib PreProc
dkearnsb614b282024-02-12 03:13:34 +11002304 hi def link vimHiBang vimBang
dkearns9530fe42024-03-19 05:19:51 +11002305 hi def link vimHiClear Type
2306 hi def link vimHiCtermColor Constant
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002307 hi def link vimHiCtermFgBg vimHiTerm
dkearns9530fe42024-03-19 05:19:51 +11002308 hi def link vimHiCtermfont vimHiTerm
2309 hi def link vimHiCtermul vimHiTerm
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002310 hi def link vimHiCTerm vimHiTerm
2311 hi def link vimHighlight vimCommand
2312 hi def link vimHiGroup vimGroupName
2313 hi def link vimHiGuiFgBg vimHiTerm
2314 hi def link vimHiGuiFont vimHiTerm
2315 hi def link vimHiGuiRgb vimNumber
2316 hi def link vimHiGui vimHiTerm
2317 hi def link vimHiNmbr Number
Doug Kearns0fab8912025-03-10 21:04:53 +01002318 hi def link vimHiNone vimGroup
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002319 hi def link vimHiStartStop vimHiTerm
2320 hi def link vimHiTerm Type
2321 hi def link vimHLGroup vimGroup
Doug Kearns7b5550f2025-05-18 20:37:34 +02002322 hi def link vimImport vimCommand
2323 hi def link vimImportAutoload Special
2324 hi def link vimImportAs vimImport
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002325 hi def link vimInsert vimString
dkearns04e53632024-04-11 06:18:37 +10002326 hi def link vim9KeymapLineComment vimKeymapLineComment
dkearns69866442023-11-22 05:43:40 +11002327 hi def link vimKeymapLineComment vimComment
2328 hi def link vimKeymapTailComment vimComment
Doug Kearns722fbd12025-03-28 19:36:37 +01002329 hi def link vimLambdaBrace Delimiter
Doug Kearns1aa287e2025-02-10 22:00:27 +01002330 hi def link vimLambdaOperator vimOper
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002331 hi def link vimLet vimCommand
Doug Kearnsa577e422025-05-17 16:29:13 +02002332 hi def link vimLetHeredoc vimString
2333 hi def link vimLetHeredocStart Special
2334 hi def link vimLetHeredocStop Special
Doug Kearns2f5a8c02025-04-05 15:55:36 +02002335 hi def link vimLetRegister vimRegister
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002336 hi def link vimLineComment vimComment
Doug Kearnsa577e422025-05-17 16:29:13 +02002337 hi def link vimLua vimCommand
Doug Kearns9b171bd2025-04-10 19:59:22 +02002338 hi def link vimMake vimCommand
2339 hi def link vimMakeadd vimCommand
2340 hi def link vimMakeBang vimBang
dkearnsb614b282024-02-12 03:13:34 +11002341 hi def link vimMapBang vimBang
Doug Kearns6bdfeb02025-03-07 18:49:11 +01002342 hi def link vimMapLeader vimBracket
2343 hi def link vimMapLeaderKey vimNotation
Doug Kearns51289202025-06-11 21:16:14 +02002344 hi def link vimMapModKey vimFunctionSID
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002345 hi def link vimMapMod vimBracket
2346 hi def link vimMap vimCommand
2347 hi def link vimMark Number
2348 hi def link vimMarkNumber vimNumber
Doug Kearnse85fdc72024-07-07 20:45:37 +02002349 hi def link vimMatch vimCommand
2350 hi def link vimMatchGroup vimGroup
2351 hi def link vimMatchNone vimGroup
dkearnsb614b282024-02-12 03:13:34 +11002352 hi def link vimMenuBang vimBang
dkearns62b26042024-03-10 03:43:28 +11002353 hi def link vimMenuClear Special
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002354 hi def link vimMenuMod vimMapMod
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002355 hi def link vimMenuName PreProc
dkearns62b26042024-03-10 03:43:28 +11002356 hi def link vimMenu vimCommand
2357 hi def link vimMenuNotation vimNotation
2358 hi def link vimMenuPriority Number
2359 hi def link vimMenuStatus Special
2360 hi def link vimMenutranslateComment vimComment
Doug Kearns818c6412024-10-06 17:00:48 +02002361 hi def link vim9MethodName vimFuncName
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002362 hi def link vimMtchComment vimComment
Doug Kearnsa577e422025-05-17 16:29:13 +02002363 hi def link vimMzScheme vimCommand
2364 hi def link vimNonText NonText
Doug Kearnsbbe52522024-11-09 19:11:25 +01002365 hi def link vimNormal vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002366 hi def link vimNotation Special
2367 hi def link vimNotFunc vimCommand
2368 hi def link vimNotPatSep vimString
2369 hi def link vimNumber Number
2370 hi def link vimOperError Error
2371 hi def link vimOper Operator
Doug Kearns1aa287e2025-02-10 22:00:27 +01002372 hi def link vimOperContinue vimContinue
2373 hi def link vimOperContinueComment vimContinueComment
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002374 hi def link vimOption PreProc
Doug Kearns1aa287e2025-02-10 22:00:27 +01002375 hi def link vimOptionVar Identifier
Doug Kearns3dca5122025-03-09 16:30:28 +01002376 hi def link vimOptionVarName Identifier
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002377 hi def link vimParenSep Delimiter
Bram Moolenaard2855f52018-07-31 22:23:58 +02002378 hi def link vimPatSepErr vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002379 hi def link vimPatSepR vimPatSep
2380 hi def link vimPatSep SpecialChar
2381 hi def link vimPatSepZone vimString
2382 hi def link vimPatSepZ vimPatSep
2383 hi def link vimPattern Type
Doug Kearnsa577e422025-05-17 16:29:13 +02002384 hi def link vimPerl vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002385 hi def link vimPlainMark vimMark
Doug Kearns0aaf6f82025-06-01 18:26:39 +02002386 hi def link vimProfile vimCommand
2387 hi def link vimProfileArg vimSpecial
2388 hi def link vimProfileBang vimBang
2389 hi def link vimProfdel vimCommand
2390 hi def link vimProfdelArg vimSpecial
Doug Kearnsa577e422025-05-17 16:29:13 +02002391 hi def link vimPython vimCommand
2392 hi def link vimPython3 vimCommand
2393 hi def link vimPythonX vimCommand
Doug Kearns695522d2025-01-10 20:02:17 +01002394 hi def link vimQuoteEscape vimEscape
Doug Kearns2f5a8c02025-04-05 15:55:36 +02002395 hi def link vimRedir vimCommand
2396 hi def link vimRedirBang vimBang
2397 hi def link vimRedirFileOperator vimOper
2398 hi def link vimRedirRegisterOperator vimOper
2399 hi def link vimRedirVariableOperator vimOper
2400 hi def link vimRedirEnd Special
2401 hi def link vimRedirRegister vimRegister
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002402 hi def link vimRegister SpecialChar
Doug Kearnsa577e422025-05-17 16:29:13 +02002403 hi def link vimRuby vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002404 hi def link vimScriptDelim Comment
Doug Kearnsa577e422025-05-17 16:29:13 +02002405 hi def link vimScriptHeredocStart vimLetHeredocStart
2406 hi def link vimScriptHeredocStop vimLetHeredocStop
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002407 hi def link vimSearch vimString
Doug Kearnsc273f1a2025-01-20 21:53:01 +01002408 hi def link vimSearchDelim Delimiter
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002409 hi def link vimSep Delimiter
Doug Kearnsddbb6fe2024-07-24 20:21:22 +02002410 hi def link vimSet vimCommand
2411 hi def link vimSetAll vimOption
2412 hi def link vimSetBang vimBang
Doug Kearns2a6be832025-04-03 21:39:24 +02002413 hi def link vimSetComment vimComment
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002414 hi def link vimSetMod vimOption
Doug Kearnsddbb6fe2024-07-24 20:21:22 +02002415 hi def link vimSetSep vimSep
Doug Kearnsddbb6fe2024-07-24 20:21:22 +02002416 hi def link vimSetTermcap vimOption
dkearnsae321b52024-06-15 23:06:17 +10002417 hi def link vimShebang PreProc
Doug Kearns262e25e2024-06-14 20:16:35 +02002418 hi def link vimSleep vimCommand
2419 hi def link vimSleepArg Constant
2420 hi def link vimSleepBang vimBang
Doug Kearns9b171bd2025-04-10 19:59:22 +02002421 hi def link vimSort vimCommand
2422 hi def link vimSortBang vimBang
2423 hi def link vimSortOptions Special
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002424 hi def link vimSpecFile Identifier
2425 hi def link vimSpecFileMod vimSpecFile
2426 hi def link vimSpecial Type
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002427 hi def link vimStringCont vimString
2428 hi def link vimString String
Bram Moolenaard2855f52018-07-31 22:23:58 +02002429 hi def link vimStringEnd vimString
thincacf8695d2024-01-28 18:57:23 +01002430 hi def link vimStringInterpolationBrace vimEscape
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002431 hi def link vimSubst1 vimSubst
Doug Kearns086b3b52025-05-31 17:52:48 +02002432 hi def link vimSubstCount Number
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002433 hi def link vimSubstDelim Delimiter
2434 hi def link vimSubstFlags Special
2435 hi def link vimSubstSubstr SpecialChar
2436 hi def link vimSubstTwoBS vimString
2437 hi def link vimSubst vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002438 hi def link vimSynCase Type
Doug Kearns0fab8912025-03-10 21:04:53 +01002439 hi def link vimSyncCcomment Type
dkearnsc79646d2024-01-05 08:58:48 +11002440 hi def link vimSynCchar vimSynOption
2441 hi def link vimSynCcharValue Character
Doug Kearns0fab8912025-03-10 21:04:53 +01002442 hi def link vimSyncClear Type
2443 hi def link vimSyncFromstart Type
2444 hi def link vimSyncGroup vimGroupName
2445 hi def link vimSyncGroupName vimGroupName
2446 hi def link vimSyncKey Type
2447 hi def link vimSyncLinebreak Type
2448 hi def link vimSyncLinecont Type
2449 hi def link vimSyncLines Type
2450 hi def link vimSyncMatch Type
2451 hi def link vimSyncNone Type
2452 hi def link vimSynConceal Type
2453 hi def link vimSynContains vimSynOption
2454 hi def link vimSyncRegion Type
2455 hi def link vimSynFoldlevel Type
2456 hi def link vimSynIskeyword Type
2457 hi def link vimSynIskeywordSep Delimiter
2458 hi def link vimSynKeyContainedin vimSynContains
2459 hi def link vimSynKeyOpt vimSynOption
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002460 hi def link vimSynMtchGrp vimSynOption
2461 hi def link vimSynMtchOpt vimSynOption
2462 hi def link vimSynNextgroup vimSynOption
2463 hi def link vimSynNotPatRange vimSynRegPat
2464 hi def link vimSynOption Special
2465 hi def link vimSynPatRange vimString
Doug Kearns0fab8912025-03-10 21:04:53 +01002466 hi def link vimSynReg Type
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002467 hi def link vimSynRegOpt vimSynOption
2468 hi def link vimSynRegPat vimString
Doug Kearns0fab8912025-03-10 21:04:53 +01002469 hi def link vimSynSpell Type
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002470 hi def link vimSyntax vimCommand
2471 hi def link vimSynType vimSpecial
Doug Kearnsa577e422025-05-17 16:29:13 +02002472 hi def link vimTcl vimCommand
dkearnsa3bddb72024-06-14 01:48:10 +10002473 hi def link vimThrow vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002474 hi def link vimTodo Todo
Bram Moolenaar4d8f4762021-06-27 15:18:56 +02002475 hi def link vimType Type
Doug Kearnsca793e62025-06-24 20:23:34 +02002476 hi def link vimUniq vimCommand
2477 hi def link vimUniqBang vimBang
2478 hi def link vimUniqOptions Special
dkearnsf6869212023-12-11 01:53:24 +11002479 hi def link vimUnlet vimCommand
dkearnsb614b282024-02-12 03:13:34 +11002480 hi def link vimUnletBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002481 hi def link vimUnmap vimMap
Doug Kearns520a2c72025-04-08 20:50:00 +02002482 hi def link vimUserCmd vimCommand
Doug Kearns3c07eb02024-09-02 10:03:37 +02002483 hi def link vimUserCmdAttrAddr vimSpecial
Doug Kearns520a2c72025-04-08 20:50:00 +02002484 hi def link vimUserCmdAttrComplete vimSpecial
2485 hi def link vimUserCmdAttrCompleteFunc vimVar
Doug Kearns3c07eb02024-09-02 10:03:37 +02002486 hi def link vimUserCmdAttrNargs vimSpecial
2487 hi def link vimUserCmdAttrRange vimSpecial
2488 hi def link vimUserCmdAttrKey vimUserCmdAttr
2489 hi def link vimUserCmdAttr Special
2490 hi def link vimUserCmdAttrError Error
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002491 hi def link vimUserCmdError Error
Doug Kearns3c07eb02024-09-02 10:03:37 +02002492 hi def link vimUserCmdKey vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002493 hi def link vimUserFunc Normal
Doug Kearns1aa287e2025-02-10 22:00:27 +01002494 hi def link vimVar Normal
Doug Kearns3dca5122025-03-09 16:30:28 +01002495 hi def link vimVarScope Identifier
Doug Kearns9b171bd2025-04-10 19:59:22 +02002496 hi def link vimVimgrep vimCommand
2497 hi def link vimVimgrepadd vimCommand
2498 hi def link vimVimgrepBang vimBang
2499 hi def link vimVimgrepFlags Special
Doug Kearns3dca5122025-03-09 16:30:28 +01002500 hi def link vimVimVar Identifier
2501 hi def link vimVimVarName Identifier
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002502 hi def link vimWarn WarningMsg
Doug Kearnsfa3b1042025-04-22 19:48:13 +02002503 hi def link vimWildcard Special
2504 hi def link vimWildcardBraceComma vimWildcard
2505 hi def link vimWildcardBracket vimWildcard
2506 hi def link vimWildcardBracketCaret vimWildcard
2507 hi def link vimWildcardBracketCharacter Normal
2508 hi def link vimWildcardBracketCharacter Normal
2509 hi def link vimWildcardBracketCharacterClass vimWildCard
2510 hi def link vimWildcardBracketCollatingSymbol vimWildCard
2511 hi def link vimWildcardBracketEnd vimWildcard
2512 hi def link vimWildcardBracketEquivalenceClass vimWildCard
2513 hi def link vimWildcardBracketEscape vimWildcard
2514 hi def link vimWildcardBracketHyphen vimWildcard
2515 hi def link vimWildcardBracketRightBracket vimWildcardBracketCharacter
2516 hi def link vimWildcardBracketStart vimWildcard
2517 hi def link vimWildcardEscape vimWildcard
2518 hi def link vimWildcardInterval vimWildcard
2519 hi def link vimWildcardQuestion vimWildcard
2520 hi def link vimWildcardStar vimWildcard
Doug Kearnsd65e58f2024-07-17 19:34:14 +02002521
Doug Kearns818c6412024-10-06 17:00:48 +02002522 hi def link vim9Abstract vimCommand
Doug Kearnsd65e58f2024-07-17 19:34:14 +02002523 hi def link vim9Boolean Boolean
Doug Kearns818c6412024-10-06 17:00:48 +02002524 hi def link vim9Class vimCommand
Doug Kearnsd65e58f2024-07-17 19:34:14 +02002525 hi def link vim9Comment Comment
2526 hi def link vim9CommentError vimError
2527 hi def link vim9CommentTitle PreProc
Doug Kearns1aa287e2025-02-10 22:00:27 +01002528 hi def link vim9ConstructorDefParam vimVar
Doug Kearnsd65e58f2024-07-17 19:34:14 +02002529 hi def link vim9Const vimCommand
Doug Kearns818c6412024-10-06 17:00:48 +02002530 hi def link vim9ContinueComment vimContinueComment
2531 hi def link vim9Enum vimCommand
Doug Kearns1c580192025-05-01 17:43:17 +02002532 hi def link vim9EnumImplementedInterfaceComment vim9Comment
2533 hi def link vim9EnumImplements vim9Implements
2534 hi def link vim9EnumNameComment vim9Comment
2535 hi def link vim9EnumNameContinue vimContinue
2536 hi def link vim9EnumNameContinueComment vim9Comment
2537 hi def link vim9EnumValueListCommaComment vim9Comment
Doug Kearns818c6412024-10-06 17:00:48 +02002538 hi def link vim9Export vimCommand
2539 hi def link vim9Extends Keyword
Doug Kearnsd65e58f2024-07-17 19:34:14 +02002540 hi def link vim9Final vimCommand
2541 hi def link vim9For vimCommand
Doug Kearns1aa287e2025-02-10 22:00:27 +01002542 hi def link vim9ForInComment vim9Comment
Doug Kearns818c6412024-10-06 17:00:48 +02002543 hi def link vim9Implements Keyword
2544 hi def link vim9AbstractDef vimCommand
2545 hi def link vim9Interface vimCommand
Doug Kearns1aa287e2025-02-10 22:00:27 +01002546 hi def link vim9LambdaOperator vimOper
2547 hi def link vim9LambdaOperatorComment vim9Comment
Doug Kearns722fbd12025-03-28 19:36:37 +01002548 hi def link vim9LambdaParen vimParenSep
Doug Kearns1aa287e2025-02-10 22:00:27 +01002549 hi def link vim9LhsRegister vimLetRegister
2550 hi def link vim9LhsVariable vimVar
Doug Kearnsd65e58f2024-07-17 19:34:14 +02002551 hi def link vim9LineComment vimComment
Doug Kearns818c6412024-10-06 17:00:48 +02002552 hi def link vim9MethodDef vimCommand
Doug Kearnsdd3f1c02025-03-17 20:27:13 +01002553 hi def link vim9MethodDefComment vimDefComment
Doug Kearns818c6412024-10-06 17:00:48 +02002554 hi def link vim9MethodNameError vimFunctionError
Doug Kearnsd65e58f2024-07-17 19:34:14 +02002555 hi def link vim9Null Constant
Doug Kearns818c6412024-10-06 17:00:48 +02002556 hi def link vim9Public vimCommand
Doug Kearnsc273f1a2025-01-20 21:53:01 +01002557 hi def link vim9Search vimString
2558 hi def link vim9SearchDelim Delimiter
Doug Kearns818c6412024-10-06 17:00:48 +02002559 hi def link vim9Static vimCommand
2560 hi def link vim9Super Identifier
2561 hi def link vim9This Identifier
2562 hi def link vim9Type vimCommand
2563 hi def link vim9TypeEquals vimOper
Doug Kearnsd65e58f2024-07-17 19:34:14 +02002564 hi def link vim9Variable vimVar
Doug Kearns274efcc2025-06-10 21:02:43 +02002565 hi def link vim9VariableType vimType
Doug Kearns818c6412024-10-06 17:00:48 +02002566 hi def link vim9Var vimCommand
Doug Kearnsd65e58f2024-07-17 19:34:14 +02002567 hi def link vim9Vim9ScriptArg Special
Doug Kearns818c6412024-10-06 17:00:48 +02002568 hi def link vim9Vim9Script vimCommand
Doug Kearns025dc482025-02-23 15:48:52 +01002569
2570 hi def link vimCompilerSet vimCommand
Doug Kearnsc233c2e2025-07-03 20:57:03 +02002571 hi def link vimSynColor vimCommand
2572 hi def link vimSynLink vimCommand
Doug Kearns025dc482025-02-23 15:48:52 +01002573 hi def link vimSynMenu vimCommand
2574 hi def link vimSynMenuPath vimMenuName
Bram Moolenaarf37506f2016-08-31 22:22:10 +02002575endif
Bram Moolenaar071d4272004-06-13 20:20:40 +00002576
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00002577" Current Syntax Variable: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00002578let b:current_syntax = "vim"
Bram Moolenaar6be7f872012-01-20 21:08:56 +01002579
2580" ---------------------------------------------------------------------
2581" Cleanup: {{{1
Doug Kearnsd65e58f2024-07-17 19:34:14 +02002582delc Vim9
2583delc VimL
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002584delc VimFolda
Doug Kearns818c6412024-10-06 17:00:48 +02002585delc VimFoldc
2586delc VimFolde
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002587delc VimFoldf
Doug Kearnsce064932024-04-13 18:24:01 +02002588delc VimFoldh
2589delc VimFoldH
Doug Kearns818c6412024-10-06 17:00:48 +02002590delc VimFoldi
Bram Moolenaara0f849e2015-10-30 14:37:44 +01002591delc VimFoldl
2592delc VimFoldm
2593delc VimFoldp
2594delc VimFoldP
2595delc VimFoldr
2596delc VimFoldt
Bram Moolenaar6be7f872012-01-20 21:08:56 +01002597let &cpo = s:keepcpo
dkearns04e53632024-04-11 06:18:37 +10002598unlet s:keepcpo s:vim9script
dkearns5d67aef2024-03-10 04:01:22 +11002599" vim:ts=18 fdm=marker ft=vim