blob: 54e6486b5f193a0b52fe1afcb7c0ffa444ff631a [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
dkearns982e1912024-03-28 20:06:03 +11002" Language: Vim script
3" Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com>
4" Doug Kearns <dougkearns@gmail.com>
Doug Kearns35699f12024-09-19 19:51:59 +02005" Last Change: 2024 Sep 16
Christian Brabandtf9ca1392024-02-19 20:37:11 +01006" Former Maintainer: Charles E. Campbell
h-east9b53c052024-02-13 21:09:22 +01007
8" DO NOT CHANGE DIRECTLY.
9" THIS FILE PARTLY GENERATED BY gen_syntax_vim.vim.
10" (Search string "GEN_SYN_VIM:" in this file)
11
Bram Moolenaar071d4272004-06-13 20:20:40 +000012" Automatically generated keyword lists: {{{1
13
14" Quit when a syntax file was already loaded {{{2
15if exists("b:current_syntax")
16 finish
17endif
Bram Moolenaar113cb512021-11-07 20:27:04 +000018let s:keepcpo= &cpo
Bram Moolenaar6be7f872012-01-20 21:08:56 +010019set cpo&vim
Bram Moolenaar071d4272004-06-13 20:20:40 +000020
dkearns04e53632024-04-11 06:18:37 +100021let s:vim9script = "\n" .. getline(1, 32)->join("\n") =~# '\n\s*vim9\%[script]\>'
22
Bram Moolenaar071d4272004-06-13 20:20:40 +000023" vimTodo: contains common special-notices for comments {{{2
24" Use the vimCommentGroup cluster to add your own.
Bram Moolenaare2719092015-01-10 15:09:25 +010025syn keyword vimTodo contained COMBAK FIXME TODO XXX
Bram Moolenaar217ad922005-03-20 22:37:15 +000026syn cluster vimCommentGroup contains=vimTodo,@Spell
Bram Moolenaar071d4272004-06-13 20:20:40 +000027
28" regular vim commands {{{2
h-east9b53c052024-02-13 21:09:22 +010029" GEN_SYN_VIM: vimCommand normal, START_STR='syn keyword vimCommand contained', END_STR=''
Doug Kearns99984fc2024-07-18 20:45:19 +020030syn keyword vimCommand contained abo[veleft] abs[tract] al[l] ar[gs] arga[dd] argd[elete] argdo argded[upe] arge[dit] argg[lobal] argl[ocal] argu[ment] as[cii] b[uffer] bN[ext] ba[ll] bad[d] balt bd[elete] bel[owright] bf[irst] bl[ast] bm[odified] bn[ext] bo[tright] bp[revious] br[ewind] brea[k] breaka[dd] breakd[el] breakl[ist] bro[wse] buffers bufd[o] bun[load] bw[ipeout] c[hange] cN[ext] cNf[ile] cabo[ve] cad[dbuffer] cadde[xpr] caddf[ile] caf[ter] cb[uffer] cbe[fore] cbel[ow] cbo[ttom] cc ccl[ose] cd cdo ce[nter] cex[pr] cf[ile] cfd[o] cfir[st] cg[etfile] cgetb[uffer] cgete[xpr] chd[ir] changes che[ckpath] checkt[ime] chi[story] cl[ist] cla[st] class clo[se] cle[arjumps] cn[ext] cnew[er] cnf[ile] co[py] col[der] colo[rscheme] com[mand] comc[lear] comp[iler]
Doug Kearns4d427d42024-09-15 19:21:18 +020031syn keyword vimCommand contained con[tinue] conf[irm] cons[t] cope[n] cp[revious] cpf[ile] cq[uit] cr[ewind] cs[cope] cst[ag] cw[indow] d[elete] delm[arks] deb[ug] debugg[reedy] defc[ompile] defe[r] delf[unction] di[splay] dif[fupdate] diffg[et] diffo[ff] diffp[atch] diffpu[t] diffs[plit] difft[his] dig[raphs] disa[ssemble] dj[ump] dli[st] dr[op] ds[earch] dsp[lit] e[dit] ea[rlier] el[se] em[enu] en[dif] endin[terface] endc[lass] ende[num] endfo[r] endt[ry] endw[hile] ene[w] enu[m] ev[al] ex exi[t] exp[ort] exu[sage] f[ile] files filet[ype] filt[er] fin[d] finall[y] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] foldd[oopen] folddoc[losed] foldo[pen] g[lobal] go[to] gr[ep] grepa[dd] gu[i] gv[im] h[elp] helpc[lose] helpf[ind] helpg[rep] helpt[ags] ha[rdcopy] hi[ghlight]
32syn keyword vimCommand contained hid[e] his[tory] ho[rizontal] ij[ump] il[ist] imp[ort] int[ro] inte[rface] is[earch] isp[lit] j[oin] ju[mps] k kee[pmarks] keepj[umps] keepp[atterns] keepa[lt] l[ist] lN[ext] lNf[ile] la[st] lab[ove] lan[guage] lad[dexpr] laddb[uffer] laddf[ile] laf[ter] lat[er] lb[uffer] lbe[fore] lbel[ow] lbo[ttom] lc[d] lch[dir] lcl[ose] lcs[cope] ld[o] le[ft] lefta[bove] lex[pr] leg[acy] lf[ile] lfd[o] lfir[st] lg[etfile] lgetb[uffer] lgete[xpr] lgr[ep] lgrepa[dd] lh[elpgrep] lhi[story] ll lla[st] lli[st] lmak[e] lne[xt] lnew[er] lnf[ile] lo[adview] loc[kmarks] lockv[ar] lol[der] lop[en] lp[revious] lpf[ile] lr[ewind] lt[ag] lua luad[o] luaf[ile] lv[imgrep] lvimgrepa[dd] lw[indow] ls m[ove] ma[rk] mak[e] marks menut[ranslate] mes[sages] mk[exrc]
33syn keyword vimCommand contained mks[ession] mksp[ell] mkv[imrc] mkvie[w] mod[e] mz[scheme] mzf[ile] n[ext] nb[key] nbc[lose] nbs[tart] noa[utocmd] noh[lsearch] nos[wapfile] nu[mber] o[pen] ol[dfiles] on[ly] opt[ions] ow[nsyntax] p[rint] pa[ckadd] packl[oadall] pc[lose] pe[rl] perld[o] ped[it] po[p] pp[op] pre[serve] prev[ious] pro[mptfind] promptr[epl] prof[ile] profd[el] ps[earch] pt[ag] ptN[ext] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pub[lic] pw[d] py[thon] pyd[o] pyf[ile] py3 py3d[o] python3 py3f[ile] pyx pyxd[o] pythonx pyxf[ile] q[uit] quita[ll] qa[ll] r[ead] rec[over] red[o] redi[r] redr[aw] redraws[tatus] redrawt[abline] reg[isters] res[ize] ret[ab] rew[ind] ri[ght] rightb[elow] ru[ntime] rub[y] rubyd[o] rubyf[ile]
34syn keyword vimCommand contained rund[o] rv[iminfo] sN[ext] sa[rgument] sal[l] san[dbox] sav[eas] sb[uffer] sbN[ext] sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbp[revious] sbr[ewind] sc[riptnames] scripte[ncoding] scriptv[ersion] scs[cope] setf[iletype] sf[ind] sfir[st] sh[ell] si[malt] sig[n] sil[ent] sla[st] sn[ext] so[urce] sor[t] sp[lit] spe[llgood] spelld[ump] spelli[nfo] spellr[epall] spellra[re] spellu[ndo] spellw[rong] spr[evious] sr[ewind] st[op] sta[g] star[tinsert] startg[replace] startr[eplace] stat[ic] stopi[nsert] stj[ump] sts[elect] sun[hide] sus[pend] sv[iew] sw[apname] synti[me] sync[bind] smi[le] t tN[ext] ta[g] tags tab tabc[lose] tabd[o] tabe[dit] tabf[ind] tabfir[st] tabm[ove] tabl[ast] tabn[ext] tabnew tabo[nly] tabp[revious] tabN[ext]
35syn keyword vimCommand contained tabr[ewind] tabs tc[d] tch[dir] tcl tcld[o] tclf[ile] te[aroff] ter[minal] tf[irst] thi[s] tj[ump] tl[ast] tn[ext] to[pleft] tp[revious] tr[ewind] try ts[elect] ty[pe] u[ndo] undoj[oin] undol[ist] unh[ide] unlo[ckvar] uns[ilent] up[date] v[global] ve[rsion] verb[ose] vert[ical] vi[sual] vie[w] vim[grep] vimgrepa[dd] vim9[cmd] viu[sage] vne[w] vs[plit] w[rite] wN[ext] wa[ll] wi[nsize] winc[md] wind[o] winp[os] wn[ext] wp[revious] wq wqa[ll] wu[ndo] wv[iminfo] x[it] xa[ll] xr[estore] y[ank] z dl dell delel deletl deletel dp dep delp delep deletp deletep a i
h-east9b53c052024-02-13 21:09:22 +010036
Aliaksei Budaveidfcef892024-02-18 21:02:14 +030037" Lower priority for _new_ to distinguish constructors from the command.
38syn match vimCommand contained "\<new\>(\@!"
Bram Moolenaare2719092015-01-10 15:09:25 +010039syn match vimCommand contained "\<z[-+^.=]\=\>"
h-east9b53c052024-02-13 21:09:22 +010040syn keyword vimStdPlugin contained Arguments Asm Break Cfilter Clear Continue DiffOrig Evaluate Finish Gdb Lfilter Man Over Program Run S Source Step Stop Termdebug TermdebugCommand TOhtml Until Winbar XMLent XMLns
Bram Moolenaar071d4272004-06-13 20:20:40 +000041
42" vimOptions are caught only when contained in a vimSet {{{2
Doug Kearnsddbb6fe2024-07-24 20:21:22 +020043" GEN_SYN_VIM: vimOption normal, START_STR='syn keyword vimOption contained', END_STR='skipwhite nextgroup=vimSetEqual,vimSetMod'
44syn keyword vimOption contained al aleph ari allowrevins ambw ambiwidth arab arabic arshape arabicshape acd autochdir ai autoindent ar autoread asd autoshelldir aw autowrite awa autowriteall bg background bs backspace bk backup bkc backupcopy bdir backupdir bex backupext bsk backupskip bdlay balloondelay beval ballooneval bevalterm balloonevalterm bexpr balloonexpr bo belloff bin binary bomb brk breakat bri breakindent briopt breakindentopt bsdir browsedir bh bufhidden bl buflisted bt buftype cmp casemap cdh cdhome cd cdpath cedit ccv charconvert cin cindent cink cinkeys cino cinoptions cinsd cinscopedecls cinw cinwords cb clipboard ch cmdheight cwh cmdwinheight cc colorcolumn co columns com comments cms commentstring cp compatible cpt complete cfu completefunc skipwhite nextgroup=vimSetEqual,vimSetMod
45syn keyword vimOption contained 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 et expandtab ex exrc fenc fileencoding fencs fileencodings ff fileformat ffs fileformats fic fileignorecase skipwhite nextgroup=vimSetEqual,vimSetMod
46syn keyword vimOption contained ft filetype fcs fillchars fixeol fixendofline fcl foldclose fdc foldcolumn fen foldenable fde foldexpr fdi foldignore fdl foldlevel fdls foldlevelstart fmr foldmarker fdm foldmethod fml foldminlines fdn foldnestmax fdo foldopen fdt foldtext fex formatexpr flp formatlistpat fo formatoptions fp formatprg fs fsync gd gdefault gfm grepformat gp grepprg gcr guicursor gfn guifont gfs guifontset gfw guifontwide ghr guiheadroom gli guiligatures go guioptions guipty gtl guitablabel gtt guitabtooltip hf helpfile hh helpheight hlg helplang hid hidden hl highlight hi history hk hkmap hkp hkmapp hls hlsearch icon iconstring ic ignorecase imaf imactivatefunc imak imactivatekey imc imcmdline imd imdisable imi iminsert ims imsearch imsf imstatusfunc skipwhite nextgroup=vimSetEqual,vimSetMod
47syn keyword vimOption contained imst imstyle inc include inex includeexpr is incsearch inde indentexpr indk indentkeys inf infercase im insertmode isf isfname isi isident isk iskeyword isp isprint js joinspaces jop jumpoptions key kmp keymap km keymodel kpc keyprotocol kp keywordprg lmap langmap lm langmenu lnr langnoremap lrm langremap ls laststatus lz lazyredraw lbr linebreak lines lsp linespace lisp lop lispoptions lw lispwords list lcs listchars lpl loadplugins luadll magic mef makeef menc makeencoding mp makeprg mps matchpairs mat matchtime mco maxcombine mfd maxfuncdepth mmd maxmapdepth mm maxmem mmp maxmempattern mmt maxmemtot mis menuitems msm mkspellmem ml modeline mle modelineexpr mls modelines ma modifiable mod modified more mouse mousef mousefocus skipwhite nextgroup=vimSetEqual,vimSetMod
48syn keyword vimOption contained mh mousehide mousem mousemodel mousemev mousemoveevent mouses mouseshape mouset mousetime mzq mzquantum mzschemedll mzschemegcdll nf nrformats nu number nuw numberwidth ofu omnifunc odev opendevice opfunc operatorfunc pp packpath para paragraphs paste pt pastetoggle pex patchexpr pm patchmode pa path perldll pi preserveindent pvh previewheight pvp previewpopup pvw previewwindow pdev printdevice penc printencoding pexpr printexpr pfn printfont pheader printheader pmbcs printmbcharset pmbfn printmbfont popt printoptions prompt ph pumheight pw pumwidth pythondll pythonhome pythonthreedll pythonthreehome pyx pyxversion qftf quickfixtextfunc qe quoteescape ro readonly rdt redrawtime re regexpengine rnu relativenumber remap rop renderoptions skipwhite nextgroup=vimSetEqual,vimSetMod
49syn keyword vimOption contained report rs restorescreen ri revins rl rightleft rlc rightleftcmd rubydll ru ruler ruf rulerformat rtp runtimepath scr scroll scb scrollbind scf scrollfocus sj scrolljump so scrolloff sbo scrollopt sect sections secure sel selection slm selectmode ssop sessionoptions sh shell shcf shellcmdflag sp shellpipe shq shellquote srr shellredir ssl shellslash stmp shelltemp st shelltype sxe shellxescape sxq shellxquote sr shiftround sw shiftwidth shm shortmess sn shortname sbr showbreak sc showcmd sloc showcmdloc sft showfulltag sm showmatch smd showmode stal showtabline ss sidescroll siso sidescrolloff scl signcolumn scs smartcase si smartindent sta smarttab sms smoothscroll sts softtabstop spell spc spellcapcheck spf spellfile spl spelllang skipwhite nextgroup=vimSetEqual,vimSetMod
50syn keyword vimOption contained spo spelloptions sps spellsuggest sb splitbelow spk splitkeep spr splitright sol startofline stl statusline su suffixes sua suffixesadd swf swapfile sws swapsync swb switchbuf smc synmaxcol syn syntax tcl tabclose tal tabline tpm tabpagemax ts tabstop tbs tagbsearch tc tagcase tfu tagfunc tl taglength tr tagrelative tag tags tgst tagstack tcldll term tbidi termbidi tenc termencoding tgc termguicolors twk termwinkey twsl termwinscroll tws termwinsize twt termwintype terse ta textauto tx textmode tw textwidth tsr thesaurus tsrfu thesaurusfunc top tildeop to timeout tm timeoutlen title titlelen titleold titlestring tb toolbar tbis toolbariconsize ttimeout ttm ttimeoutlen tbi ttybuiltin tf ttyfast ttym ttymouse tsl ttyscroll tty ttytype skipwhite nextgroup=vimSetEqual,vimSetMod
51syn keyword vimOption contained udir undodir udf undofile ul undolevels ur undoreload uc updatecount ut updatetime vsts varsofttabstop vts vartabstop vbs verbose vfile verbosefile vdir viewdir vop viewoptions vi viminfo vif viminfofile ve virtualedit vb visualbell warn wiv weirdinvert ww whichwrap wc wildchar wcm wildcharm wig wildignore wic wildignorecase wmnu wildmenu wim wildmode wop wildoptions wak winaltkeys wcr wincolor wi window wfb winfixbuf wfh winfixheight wfw winfixwidth wh winheight wmh winminheight wmw winminwidth winptydll wiw winwidth wrap wm wrapmargin ws wrapscan write wa writeany wb writebackup wd writedelay xtermcodes skipwhite nextgroup=vimSetEqual,vimSetMod
Bram Moolenaar071d4272004-06-13 20:20:40 +000052
53" vimOptions: These are the turn-off setting variants {{{2
h-east9b53c052024-02-13 21:09:22 +010054" GEN_SYN_VIM: vimOption turn-off, START_STR='syn keyword vimOption contained', END_STR=''
55syn keyword vimOption contained noari noallowrevins noarab noarabic noarshape noarabicshape noacd noautochdir noai noautoindent noar noautoread noasd noautoshelldir noaw noautowrite noawa noautowriteall nobk nobackup nobeval noballooneval nobevalterm noballoonevalterm nobin nobinary nobomb nobri nobreakindent nobl nobuflisted nocdh nocdhome nocin nocindent nocp nocompatible nocf noconfirm noci nocopyindent nocsre nocscoperelative nocst nocscopetag nocsverb nocscopeverbose nocrb nocursorbind nocuc nocursorcolumn nocul nocursorline nodeco nodelcombine nodiff nodg nodigraph noed noedcompatible noemo noemoji noeof noendoffile noeol noendofline noea noequalalways noeb noerrorbells noek noesckeys noet noexpandtab noex noexrc nofic nofileignorecase nofixeol nofixendofline
56syn keyword vimOption contained nofen nofoldenable nofs nofsync nogd nogdefault noguipty nohid nohidden nohk nohkmap nohkp nohkmapp nohls nohlsearch noicon noic noignorecase noimc noimcmdline noimd noimdisable nois noincsearch noinf noinfercase noim noinsertmode nojs nojoinspaces nolnr nolangnoremap nolrm nolangremap nolz nolazyredraw nolbr nolinebreak nolisp nolist nolpl noloadplugins nomagic noml nomodeline nomle nomodelineexpr noma nomodifiable nomod nomodified nomore nomousef nomousefocus nomh nomousehide nomousemev nomousemoveevent nonu nonumber noodev noopendevice nopaste nopi nopreserveindent nopvw nopreviewwindow noprompt noro noreadonly nornu norelativenumber noremap nors norestorescreen nori norevins norl norightleft noru noruler noscb noscrollbind noscf noscrollfocus
dkearns691aee82024-03-04 05:02:47 +110057syn keyword vimOption contained nosecure nossl noshellslash nostmp noshelltemp nosr noshiftround nosn noshortname nosc noshowcmd nosft noshowfulltag nosm noshowmatch nosmd noshowmode noscs nosmartcase nosi nosmartindent nosta nosmarttab nosms nosmoothscroll nospell nosb nosplitbelow nospr nosplitright nosol nostartofline noswf noswapfile notbs notagbsearch notr notagrelative notgst notagstack notbidi notermbidi notgc notermguicolors noterse nota notextauto notx notextmode notop notildeop noto notimeout notitle nottimeout notbi nottybuiltin notf nottyfast noudf noundofile novb novisualbell nowarn nowiv noweirdinvert nowic nowildignorecase nowmnu nowildmenu nowfb nowinfixbuf nowfh nowinfixheight nowfw nowinfixwidth nowrap nows nowrapscan nowrite nowa nowriteany
58syn keyword vimOption contained nowb nowritebackup noxtermcodes
Bram Moolenaar071d4272004-06-13 20:20:40 +000059
60" vimOptions: These are the invertible variants {{{2
h-east9b53c052024-02-13 21:09:22 +010061" GEN_SYN_VIM: vimOption invertible, START_STR='syn keyword vimOption contained', END_STR=''
62syn keyword vimOption contained invari invallowrevins invarab invarabic invarshape invarabicshape invacd invautochdir invai invautoindent invar invautoread invasd invautoshelldir invaw invautowrite invawa invautowriteall invbk invbackup invbeval invballooneval invbevalterm invballoonevalterm invbin invbinary invbomb invbri invbreakindent invbl invbuflisted invcdh invcdhome invcin invcindent invcp invcompatible invcf invconfirm invci invcopyindent invcsre invcscoperelative invcst invcscopetag invcsverb invcscopeverbose invcrb invcursorbind invcuc invcursorcolumn invcul invcursorline invdeco invdelcombine invdiff invdg invdigraph inved invedcompatible invemo invemoji inveof invendoffile inveol invendofline invea invequalalways inveb inverrorbells invek invesckeys
63syn keyword vimOption contained invet invexpandtab invex invexrc invfic invfileignorecase invfixeol invfixendofline invfen invfoldenable invfs invfsync invgd invgdefault invguipty invhid invhidden invhk invhkmap invhkp invhkmapp invhls invhlsearch invicon invic invignorecase invimc invimcmdline invimd invimdisable invis invincsearch invinf invinfercase invim invinsertmode invjs invjoinspaces invlnr invlangnoremap invlrm invlangremap invlz invlazyredraw invlbr invlinebreak invlisp invlist invlpl invloadplugins invmagic invml invmodeline invmle invmodelineexpr invma invmodifiable invmod invmodified invmore invmousef invmousefocus invmh invmousehide invmousemev invmousemoveevent invnu invnumber invodev invopendevice invpaste invpi invpreserveindent invpvw invpreviewwindow
64syn keyword vimOption contained invprompt invro invreadonly invrnu invrelativenumber invremap invrs invrestorescreen invri invrevins invrl invrightleft invru invruler invscb invscrollbind invscf invscrollfocus invsecure invssl invshellslash invstmp invshelltemp invsr invshiftround invsn invshortname invsc invshowcmd invsft invshowfulltag invsm invshowmatch invsmd invshowmode invscs invsmartcase invsi invsmartindent invsta invsmarttab invsms invsmoothscroll invspell invsb invsplitbelow invspr invsplitright invsol invstartofline invswf invswapfile invtbs invtagbsearch invtr invtagrelative invtgst invtagstack invtbidi invtermbidi invtgc invtermguicolors invterse invta invtextauto invtx invtextmode invtop invtildeop invto invtimeout invtitle invttimeout invtbi invttybuiltin
dkearns691aee82024-03-04 05:02:47 +110065syn keyword vimOption contained invtf invttyfast invudf invundofile invvb invvisualbell invwarn invwiv invweirdinvert invwic invwildignorecase invwmnu invwildmenu invwfb invwinfixbuf invwfh invwinfixheight invwfw invwinfixwidth invwrap invws invwrapscan invwrite invwa invwriteany invwb invwritebackup invxtermcodes
Bram Moolenaar071d4272004-06-13 20:20:40 +000066
67" termcap codes (which can also be set) {{{2
Doug Kearnsddbb6fe2024-07-24 20:21:22 +020068" GEN_SYN_VIM: vimOption term output code, START_STR='syn keyword vimOption contained', END_STR='skipwhite nextgroup=vimSetEqual,vimSetMod'
69syn keyword vimOption contained t_AB t_AF t_AU t_AL t_al t_bc t_BE t_BD t_cd t_ce t_Ce t_CF t_cl t_cm t_Co t_CS t_Cs t_cs t_CV t_da t_db t_DL t_dl t_ds t_Ds t_EC t_EI t_fs t_fd t_fe t_GP t_IE t_IS t_ke t_ks t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_RF t_RB t_RC t_RI t_Ri t_RK t_RS t_RT t_RV t_Sb t_SC t_se t_Sf t_SH t_SI t_Si t_so t_SR t_sr t_ST t_Te t_te t_TE t_ti t_TI t_Ts t_ts t_u7 t_ue t_us t_Us t_ut t_vb t_ve t_vi t_VS t_vs t_WP t_WS t_XM t_xn t_xs t_ZH t_ZR t_8f t_8b t_8u t_xo skipwhite nextgroup=vimSetEqual,vimSetMod
h-east9b53c052024-02-13 21:09:22 +010070" term key codes
71syn keyword vimOption contained t_F1 t_F2 t_F3 t_F4 t_F5 t_F6 t_F7 t_F8 t_F9 t_k1 t_K1 t_k2 t_k3 t_K3 t_k4 t_K4 t_k5 t_K5 t_k6 t_K6 t_k7 t_K7 t_k8 t_K8 t_k9 t_K9 t_KA t_kb t_kB t_KB t_KC t_kd t_kD t_KD t_KE t_KF t_KG t_kh t_KH t_kI t_KI t_KJ t_KK t_kl t_KL t_kN t_kP t_kr t_ku
Bram Moolenaarb0d45e72017-11-05 18:19:24 +010072syn match vimOption contained "t_%1"
Bram Moolenaar071d4272004-06-13 20:20:40 +000073syn match vimOption contained "t_#2"
74syn match vimOption contained "t_#4"
Bram Moolenaar6d5ad4c2016-10-27 17:00:16 +020075syn match vimOption contained "t_@7"
Bram Moolenaarb0d45e72017-11-05 18:19:24 +010076syn match vimOption contained "t_*7"
77syn match vimOption contained "t_&8"
78syn match vimOption contained "t_%i"
Bram Moolenaar071d4272004-06-13 20:20:40 +000079syn match vimOption contained "t_k;"
80
Bram Moolenaar03413f42016-04-12 21:07:15 +020081" unsupported settings: some were supported by vi but don't do anything in vim {{{2
h-east9b53c052024-02-13 21:09:22 +010082" GEN_SYN_VIM: Missing vimOption, START_STR='syn keyword vimErrSetting contained', END_STR=''
83syn keyword vimErrSetting contained akm altkeymap anti antialias ap autoprint bf beautify biosk bioskey consk conskey fk fkmap fl flash gr graphic ht hardtabs macatsui mesg novice open opt optimize oft osfiletype redraw slow slowopen sourceany w1200 w300 w9600
84syn keyword vimErrSetting contained noakm noaltkeymap noanti noantialias noap noautoprint nobf nobeautify nobiosk nobioskey noconsk noconskey nofk nofkmap nofl noflash nogr nographic nomacatsui nomesg nonovice noopen noopt nooptimize noredraw noslow noslowopen nosourceany
85syn keyword vimErrSetting contained invakm invaltkeymap invanti invantialias invap invautoprint invbf invbeautify invbiosk invbioskey invconsk invconskey invfk invfkmap invfl invflash invgr invgraphic invmacatsui invmesg invnovice invopen invopt invoptimize invredraw invslow invslowopen invsourceany
Bram Moolenaar071d4272004-06-13 20:20:40 +000086
Bram Moolenaar80a94a52006-02-23 21:26:58 +000087" AutoCmd Events {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +000088syn case ignore
h-east9b53c052024-02-13 21:09:22 +010089" GEN_SYN_VIM: vimAutoEvent, START_STR='syn keyword vimAutoEvent contained', END_STR=''
Doug Kearnse85fdc72024-07-07 20:45:37 +020090syn keyword vimAutoEvent contained BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre CmdlineChanged CmdlineEnter CmdlineLeave CmdUndefined CmdwinEnter CmdwinLeave ColorScheme ColorSchemePre CompleteChanged CompleteDone CompleteDonePre CursorHold CursorHoldI CursorMoved CursorMovedC CursorMovedI DiffUpdated DirChanged DirChangedPre EncodingChanged ExitPre FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost
Ernie Rael05124252024-07-11 22:10:45 +020091syn keyword vimAutoEvent contained FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave InsertLeavePre KeyInputPre MenuPopup ModeChanged OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SafeState SafeStateAgain SessionLoadPost SessionWritePost ShellCmdPost ShellFilterPost SigUSR1 SourceCmd SourcePost SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabClosed TabEnter TabLeave TabNew TermChanged TerminalOpen TerminalWinOpen TermResponse TermResponseAll TextChanged TextChangedI TextChangedP TextChangedT TextYankPost User VimEnter VimLeave VimLeavePre VimResized VimResume VimSuspend WinClosed WinEnter WinLeave WinNew WinNewPre WinResized WinScrolled
Bram Moolenaar071d4272004-06-13 20:20:40 +000092
93" Highlight commonly used Groupnames {{{2
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +020094syn keyword vimGroup contained Comment Constant String Character Number Boolean Float Identifier Function Statement Conditional Repeat Label Operator Keyword Exception PreProc Include Define Macro PreCondit Type StorageClass Structure Typedef Special SpecialChar Tag Delimiter SpecialComment Debug Underlined Ignore Error Todo
Bram Moolenaar071d4272004-06-13 20:20:40 +000095
96" Default highlighting groups {{{2
h-east9b53c052024-02-13 21:09:22 +010097" GEN_SYN_VIM: vimHLGroup, START_STR='syn keyword vimHLGroup contained', END_STR=''
dkearnsa3bddb72024-06-14 01:48:10 +100098syn keyword vimHLGroup contained ErrorMsg IncSearch ModeMsg NonText StatusLine StatusLineNC EndOfBuffer VertSplit VisualNOS DiffText PmenuSbar TabLineSel TabLineFill Cursor lCursor QuickFixLine CursorLineSign CursorLineFold CurSearch PmenuKind PmenuKindSel PmenuMatch PmenuMatchSel PmenuExtra PmenuExtraSel Normal Directory LineNr CursorLineNr MoreMsg Question Search SpellBad SpellCap SpellRare SpellLocal PmenuThumb Pmenu PmenuSel SpecialKey Title WarningMsg WildMenu Folded FoldColumn SignColumn Visual DiffAdd DiffChange DiffDelete TabLine CursorColumn CursorLine ColorColumn MatchParen StatusLineTerm StatusLineTermNC ToolbarLine ToolbarButton Menu Tooltip Scrollbar CursorIM LineNrAbove LineNrBelow
Christian Brabandt393708c2024-05-27 15:50:07 +020099syn match vimHLGroup contained "\<Conceal\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000100syn case match
101
102" Function Names {{{2
h-east9b53c052024-02-13 21:09:22 +0100103" GEN_SYN_VIM: vimFuncName, START_STR='syn keyword vimFuncName contained', END_STR=''
Doug Kearnse85fdc72024-07-07 20:45:37 +0200104syn 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 bindtextdomain blob2list 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 char2nr charclass charcol charidx
105syn keyword vimFuncName contained chdir cindent clearmatches col complete complete_add complete_check complete_info confirm copy cos cosh count cscope_connection cursor debugbreak deepcopy delete deletebufline did_filetype diff diff_filler diff_hlID digraph_get digraph_getlist digraph_set digraph_setlist echoraw empty environ err_teapot escape eval eventhandler executable execute exepath exists exists_compiled exp expand expandcmd extend extendnew feedkeys filecopy filereadable filewritable filter finddir findfile flatten flattennew float2nr floor fmod fnameescape fnamemodify foldclosed foldclosedend foldlevel foldtext foldtextresult foreach foreground fullcommand funcref function garbagecollect get getbufinfo getbufline getbufoneline getbufvar getcellwidths getchangelist
Ernie Rael05124252024-07-11 22:10:45 +0200106syn keyword vimFuncName contained getchar getcharmod getcharpos getcharsearch getcharstr getcmdcompltype getcmdline getcmdpos getcmdscreenpos getcmdtype getcmdwintype getcompletion getcurpos getcursorcharpos getcwd getenv getfontname getfperm getfsize getftime getftype getimstatus getjumplist getline getloclist getmarklist getmatches getmousepos getmouseshape getpid getpos getqflist getreg getreginfo getregion getregionpos getregtype getscriptinfo gettabinfo gettabvar gettabwinvar gettagstack gettext getwininfo getwinpos getwinposx getwinposy getwinvar glob glob2regpat globpath has has_key haslocaldir hasmapto histadd histdel histget histnr hlID hlexists hlget hlset hostname iconv id indent index indexof input inputdialog inputlist inputrestore inputsave inputsecret
Doug Kearnse85fdc72024-07-07 20:45:37 +0200107syn keyword vimFuncName contained insert instanceof interrupt invert isabsolutepath isdirectory isinf islocked isnan items job_getchannel job_info job_setoptions job_start job_status job_stop join js_decode js_encode json_decode json_encode keys keytrans len libcall libcallnr line line2byte lispindent list2blob list2str listener_add listener_flush listener_remove localtime log log10 luaeval map maparg mapcheck maplist mapnew mapset match matchadd matchaddpos matcharg matchbufline matchdelete matchend matchfuzzy matchfuzzypos matchlist matchstr matchstrlist matchstrpos max menu_info min mkdir mode mzeval nextnonblank nr2char or pathshorten perleval popup_atcursor popup_beval popup_clear popup_close popup_create popup_dialog popup_filter_menu popup_filter_yesno
108syn keyword vimFuncName contained popup_findecho popup_findinfo popup_findpreview popup_getoptions popup_getpos popup_hide popup_list popup_locate popup_menu popup_move popup_notification popup_setbuf popup_setoptions popup_settext popup_show pow prevnonblank printf prompt_getprompt prompt_setcallback prompt_setinterrupt prompt_setprompt prop_add prop_add_list prop_clear prop_find prop_list prop_remove prop_type_add prop_type_change prop_type_delete prop_type_get prop_type_list pum_getpos pumvisible py3eval pyeval pyxeval rand range readblob readdir readdirex readfile reduce reg_executing reg_recording reltime reltimefloat reltimestr remote_expr remote_foreground remote_peek remote_read remote_send remote_startserver remove rename repeat resolve reverse round
109syn keyword vimFuncName contained rubyeval screenattr screenchar screenchars screencol screenpos screenrow screenstring search searchcount searchdecl searchpair searchpairpos searchpos server2client serverlist setbufline setbufvar setcellwidths setcharpos setcharsearch setcmdline setcmdpos setcursorcharpos setenv setfperm setline setloclist setmatches setpos setqflist setreg settabvar settabwinvar settagstack setwinvar sha256 shellescape shiftwidth sign_define sign_getdefined sign_getplaced sign_jump sign_place sign_placelist sign_undefine sign_unplace sign_unplacelist simplify sin sinh slice sort sound_clear sound_playevent sound_playfile sound_stop soundfold spellbadword spellsuggest split sqrt srand state str2float str2list str2nr strcharlen strcharpart strchars
110syn keyword vimFuncName contained strdisplaywidth strftime strgetchar stridx string strlen strpart strptime strridx strtrans strutf16len strwidth submatch substitute swapfilelist swapinfo swapname synID synIDattr synIDtrans synconcealed synstack system systemlist tabpagebuflist tabpagenr tabpagewinnr tagfiles taglist tan tanh tempname term_dumpdiff term_dumpload term_dumpwrite term_getaltscreen term_getansicolors term_getattr term_getcursor term_getjob term_getline term_getscrolled term_getsize term_getstatus term_gettitle term_gettty term_list term_scrape term_sendkeys term_setansicolors term_setapi term_setkill term_setrestore term_setsize term_start term_wait terminalprops test_alloc_fail test_autochdir test_feedinput test_garbagecollect_now test_garbagecollect_soon
111syn keyword vimFuncName contained test_getvalue test_gui_event test_ignore_error test_mswin_event test_null_blob test_null_channel test_null_dict test_null_function test_null_job test_null_list test_null_partial test_null_string test_option_not_set test_override test_refcount test_setmouse test_settime test_srand_seed test_unknown test_void timer_info timer_pause timer_start timer_stop timer_stopall tolower toupper tr trim trunc type typename undofile undotree uniq utf16idx values virtcol virtcol2col visualmode wildmenumode win_execute win_findbuf win_getid win_gettype win_gotoid win_id2tabwin win_id2win win_move_separator win_move_statusline win_screenpos win_splitmove winbufnr wincol windowsversion winheight winlayout winline winnr winrestcmd winrestview winsaveview
112syn keyword vimFuncName contained winwidth wordcount writefile xor
Bram Moolenaar071d4272004-06-13 20:20:40 +0000113
Bram Moolenaarac7bd632013-03-19 11:35:58 +0100114"--- syntax here and above generated by mkvimvim ---
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000115" Special Vim Highlighting (not automatic) {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000116
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200117" Set up commands for this syntax highlighting file {{{2
118
119com! -nargs=* Vim9 execute <q-args> s:vim9script ? "" : "contained"
120com! -nargs=* VimL execute <q-args> s:vim9script ? "contained" : ""
121
Doug Kearnsce064932024-04-13 18:24:01 +0200122if exists("g:vimsyn_folding") && g:vimsyn_folding =~# '[afhHlmpPrt]'
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200123 if g:vimsyn_folding =~# 'a'
124 com! -nargs=* VimFolda <args> fold
125 else
126 com! -nargs=* VimFolda <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100127 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200128 if g:vimsyn_folding =~# 'f'
129 com! -nargs=* VimFoldf <args> fold
130 else
131 com! -nargs=* VimFoldf <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100132 endif
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100133 if g:vimsyn_folding =~# 'h'
134 com! -nargs=* VimFoldh <args> fold
135 else
136 com! -nargs=* VimFoldh <args>
137 endif
Doug Kearnsce064932024-04-13 18:24:01 +0200138 if g:vimsyn_folding =~# 'H'
139 com! -nargs=* VimFoldH <args> fold
140 else
141 com! -nargs=* VimFoldH <args>
142 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200143 if g:vimsyn_folding =~# 'l'
144 com! -nargs=* VimFoldl <args> fold
145 else
146 com! -nargs=* VimFoldl <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100147 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200148 if g:vimsyn_folding =~# 'm'
149 com! -nargs=* VimFoldm <args> fold
150 else
151 com! -nargs=* VimFoldm <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100152 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200153 if g:vimsyn_folding =~# 'p'
154 com! -nargs=* VimFoldp <args> fold
155 else
156 com! -nargs=* VimFoldp <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100157 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200158 if g:vimsyn_folding =~# 'P'
159 com! -nargs=* VimFoldP <args> fold
160 else
161 com! -nargs=* VimFoldP <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100162 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200163 if g:vimsyn_folding =~# 'r'
164 com! -nargs=* VimFoldr <args> fold
165 else
166 com! -nargs=* VimFoldr <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100167 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200168 if g:vimsyn_folding =~# 't'
169 com! -nargs=* VimFoldt <args> fold
170 else
171 com! -nargs=* VimFoldt <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100172 endif
173else
174 com! -nargs=* VimFolda <args>
175 com! -nargs=* VimFoldf <args>
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100176 com! -nargs=* VimFoldh <args>
Doug Kearnsce064932024-04-13 18:24:01 +0200177 com! -nargs=* VimFoldH <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100178 com! -nargs=* VimFoldl <args>
179 com! -nargs=* VimFoldm <args>
180 com! -nargs=* VimFoldp <args>
181 com! -nargs=* VimFoldP <args>
182 com! -nargs=* VimFoldr <args>
183 com! -nargs=* VimFoldt <args>
184endif
185
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000186" Deprecated variable options {{{2
187if exists("g:vim_minlines")
188 let g:vimsyn_minlines= g:vim_minlines
189endif
190if exists("g:vim_maxlines")
191 let g:vimsyn_maxlines= g:vim_maxlines
192endif
193if exists("g:vimsyntax_noerror")
194 let g:vimsyn_noerror= g:vimsyntax_noerror
195endif
196
Bram Moolenaar03413f42016-04-12 21:07:15 +0200197" Variable options {{{2
198if exists("g:vim_maxlines")
199 let s:vimsyn_maxlines= g:vim_maxlines
200else
201 let s:vimsyn_maxlines= 60
202endif
203
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200204" Nulls {{{2
205" =====
206Vim9 syn keyword vim9Null null null_blob null_channel null_class null_dict null_function null_job null_list null_object null_partial null_string
207
208" Booleans {{{2
209" ========
210Vim9 syn keyword vim9Boolean true false
211
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000212" Numbers {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000213" =======
dkearns5cd86c62024-03-12 07:40:58 +1100214syn case ignore
dkearns04e53632024-04-11 06:18:37 +1000215syn match vimNumber '\<\d\+\%(\.\d\+\%(e[+-]\=\d\+\)\=\)\=' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment
216syn match vimNumber '\<0b[01]\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment
217syn match vimNumber '\<0o\=\o\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment
218syn match vimNumber '\<0x\x\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment
219syn match vimNumber '\<0z\>' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment
220syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment
221syn match vimNumber '\%(^\|\A\)\zs#\x\{6}' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment
dkearns5cd86c62024-03-12 07:40:58 +1100222syn case match
Bram Moolenaar071d4272004-06-13 20:20:40 +0000223
Bram Moolenaar6c1e1572019-06-22 02:13:00 +0200224" All vimCommands are contained by vimIsCommand. {{{2
Doug Kearns35699f12024-09-19 19:51:59 +0200225syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutoCmd,vimAugroup,vimBehave,vimCall,vimCatch,vimConst,vimDef,vimDelcommand,@vimEcho,vimEnddef,vimEndfunction,vimExecute,vimIsCommand,vimExtCmd,vimFor,vimFunction,vimFuncFold,vimGlobal,vimHighlight,vimLet,vimLoadkeymap,vimMap,vimMark,vimMatch,vimNotFunc,vimNorm,vimSet,vimSleep,vimSyntax,vimThrow,vimUnlet,vimUnmap,vimUserCmd,vimMenu,vimMenutranslate,@vim9CmdList
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200226syn cluster vim9CmdList contains=vim9Const,vim9Final,vim9For,vim9Var
dkearnsc4aef9a2024-03-04 02:42:47 +1100227syn match vimCmdSep "[:|]\+" skipwhite nextgroup=@vimCmdList,vimSubst1
dkearns9c5b90d2024-01-24 06:34:28 +1100228syn match vimIsCommand "\<\%(\h\w*\|[23]mat\%[ch]\)\>" contains=vimCommand
Doug Kearns3c07eb02024-09-02 10:03:37 +0200229syn match vimBang contained "!"
Bram Moolenaard2855f52018-07-31 22:23:58 +0200230syn match vimVar contained "\<\h[a-zA-Z0-9#_]*\>"
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200231syn match vimVar "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>"
dkearnsf6869212023-12-11 01:53:24 +1100232syn match vimVar "\s\zs&\%([lg]:\)\=\a\+\>"
233syn match vimVar "\s\zs&t_\S[a-zA-Z0-9]\>"
234syn match vimVar "\s\zs&t_k;"
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200235syn match vimFBVar contained "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>"
Bram Moolenaar5c736222010-01-06 20:54:52 +0100236syn keyword vimCommand contained in
Bram Moolenaar071d4272004-06-13 20:20:40 +0000237
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200238syn cluster vimExprList contains=vimEnvvar,vimFunc,vimNumber,vimOper,vimOperParen,vimLetRegister,vimString,vimVar,@vim9ExprList
239syn cluster vim9ExprList contains=vim9Boolean,vim9Null
dkearnsb1427b42024-02-28 05:59:30 +1100240
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000241" Insertions And Appends: insert append {{{2
Bram Moolenaar519cc552021-11-16 19:18:26 +0000242" (buftype != nofile test avoids having append, change, insert show up in the command window)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000243" =======================
Bram Moolenaar519cc552021-11-16 19:18:26 +0000244if &buftype != 'nofile'
dkearns4ba70ca2024-04-15 04:32:56 +1000245 syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=a\%[ppend]$" matchgroup=vimCommand end="^\.$" extend
246 syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=c\%[hange]$" matchgroup=vimCommand end="^\.$" extend
247 syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=i\%[nsert]$" matchgroup=vimCommand end="^\.$" extend
Bram Moolenaar519cc552021-11-16 19:18:26 +0000248endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000249
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000250" Behave! {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000251" =======
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100252if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_nobehaveerror")
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000253 syn match vimBehaveError contained "[^ ]\+"
254endif
Doug Kearnsfe6d5b02024-02-14 21:17:43 +0100255syn match vimBehave "\<be\%[have]\>" nextgroup=vimBehaveBang,vimBehaveModel,vimBehaveError skipwhite
256syn match vimBehaveBang contained "\a\@1<=!" nextgroup=vimBehaveModel skipwhite
257syn keyword vimBehaveModel contained mswin xterm
Bram Moolenaar071d4272004-06-13 20:20:40 +0000258
Doug Kearns99984fc2024-07-18 20:45:19 +0200259" Call {{{2
260" ====
261syn match vimCall "\<call\=\>" skipwhite nextgroup=vimFunc
262
dkearnsa3bddb72024-06-14 01:48:10 +1000263" Exception Handling {{{2
264syn keyword vimThrow th[row] skipwhite nextgroup=@vimExprList
265syn keyword vimCatch cat[ch] skipwhite nextgroup=vimCatchPattern
266syn region vimCatchPattern contained matchgroup=Delimiter start="\z([!#$%&'()*+,-./:;<=>?@[\]^_`{}~]\)" skip="\\\\\|\\\z1" end="\z1" contains=@vimSubstList oneline
267
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000268" Filetypes {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000269" =========
Bram Moolenaar293ee4d2004-12-09 21:34:53 +0000270syn match vimFiletype "\<filet\%[ype]\(\s\+\I\i*\)*" skipwhite contains=vimFTCmd,vimFTOption,vimFTError
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100271if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_vimFTError")
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000272 syn match vimFTError contained "\I\i*"
273endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000274syn keyword vimFTCmd contained filet[ype]
275syn keyword vimFTOption contained detect indent off on plugin
276
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000277" Augroup : vimAugroupError removed because long augroups caused sync'ing problems. {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000278" ======= : Trade-off: Increasing synclines with slower editing vs augroup END error checking.
dkearns04e53632024-04-11 06:18:37 +1000279syn cluster vimAugroupList contains=@vimCmdList,vimFilter,vimFunc,vimLineComment,vimSpecFile,vimOper,vimNumber,vimOperParen,@vimComment,vimString,vimSubst,vimRegister,vimCmplxRepeat,vimNotation,vimCtrlChar,vimFuncVar,vimContinue
dkearnsc4aef9a2024-03-04 02:42:47 +1100280syn match vimAugroup "\<aug\%[roup]\>" contains=vimAugroupKey,vimAugroupBang skipwhite nextgroup=vimAugroupBang,vimAutoCmdGroup
Bram Moolenaarf3913272016-02-25 00:00:01 +0100281if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'a'
dkearnsc4aef9a2024-03-04 02:42:47 +1100282 syn region vimAugroup fold start="\<aug\%[roup]\>\ze\s\+\%([eE][nN][dD]\)\@!\S\+" matchgroup=vimAugroupKey end="\<aug\%[roup]\>\ze\s\+[eE][nN][dD]\>" contains=vimAutoCmd,@vimAugroupList,vimAugroupkey skipwhite nextgroup=vimAugroupEnd
Bram Moolenaarb4ff5182015-11-10 21:15:48 +0100283else
dkearnsc4aef9a2024-03-04 02:42:47 +1100284 syn region vimAugroup start="\<aug\%[roup]\>\ze\s\+\%([eE][nN][dD]\)\@!\S\+" matchgroup=vimAugroupKey end="\<aug\%[roup]\>\ze\s\+[eE][nN][dD]\>" contains=vimAutoCmd,@vimAugroupList,vimAugroupkey skipwhite nextgroup=vimAugroupEnd
Bram Moolenaarb4ff5182015-11-10 21:15:48 +0100285endif
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100286if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noaugrouperror")
dkearnsc4aef9a2024-03-04 02:42:47 +1100287 syn match vimAugroupError "\<aug\%[roup]\>\s\+[eE][nN][dD]\>"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000288endif
dkearnsc4aef9a2024-03-04 02:42:47 +1100289
290syn match vimAutoCmdGroup contained "\S\+"
291syn match vimAugroupEnd contained "\c\<END\>"
292syn match vimAugroupBang contained "\a\@1<=!" skipwhite nextgroup=vimAutoCmdGroup
293syn keyword vimAugroupKey contained aug[roup] skipwhite nextgroup=vimAugroupBang,vimAutoCmdGroup,vimAugroupEnd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000294
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000295" Operators: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000296" =========
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200297syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,@vimContinue,vim9Comment,vimVar,vimBoolean,vimNull
298syn match vimOper "||\|&&\|[-+*/%.!]" skipwhite nextgroup=vimString,vimSpecFile
Bram Moolenaar113cb512021-11-07 20:27:04 +0000299syn match vimOper "\%#=1\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\|!\~#\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile
300syn match vimOper "\(\<is\|\<isnot\)[?#]\{0,2}\>" skipwhite nextgroup=vimString,vimSpecFile
dkearns76d62982024-03-23 05:55:25 +1100301syn region vimOperParen matchgroup=vimParenSep start="(" end=")" contains=@vimOperGroup
Bram Moolenaar4072ba52020-12-23 13:56:35 +0100302syn region vimOperParen matchgroup=vimSep start="#\={" end="}" contains=@vimOperGroup nextgroup=vimVar,vimFuncVar
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100303if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noopererror")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100304 syn match vimOperError ")"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000305endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000306
dkearns4ba70ca2024-04-15 04:32:56 +1000307" Functions: Tag is provided for those who wish to highlight tagged functions {{{2
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000308" =========
dkearns35e6f4c2024-03-22 06:41:10 +1100309syn cluster vimFuncList contains=vimFuncBang,vimFunctionError,vimFuncKey,vimFuncSID,Tag
310syn cluster vimDefList contains=vimFuncBang,vimFunctionError,vimDefKey,vimFuncSID,Tag
dkearns4ba70ca2024-04-15 04:32:56 +1000311
312syn cluster vimFuncBodyCommon contains=@vimCmdList,vimCmplxRepeat,vimContinue,vimCtrlChar,vimDef,vimEnvvar,vimFBVar,vimFunc,vimFunction,vimLetHereDoc,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegister,vimSearch,vimSpecFile,vimString,vimSubst,vimFuncFold
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200313syn cluster vimFuncBodyList contains=@vimFuncBodyCommon,vimComment,vimLineComment,vimFuncVar,vimInsert,vimConst,vimLet
314syn cluster vimDefBodyList contains=@vimFuncBodyCommon,vim9Comment,vim9LineComment,vim9Const,vim9Final,vim9Var,vim9Null,vim9Boolean,vim9For
dkearns35e6f4c2024-03-22 06:41:10 +1100315
316syn region vimFuncPattern contained matchgroup=vimOper start="/" end="$" contains=@vimSubstList
317syn match vimFunction "\<fu\%[nction]\>" skipwhite nextgroup=vimCmdSep,vimComment,vimFuncPattern contains=vimFuncKey
318syn match vimDef "\<def\>" skipwhite nextgroup=vimCmdSep,vimComment,vimFuncPattern contains=vimDefKey
319
320syn match vimFunction "\<fu\%[nction]\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+" contains=@vimFuncList skipwhite nextgroup=vimFuncParams
321syn match vimDef "\<def\s\+new\%(\i\|{.\{-1,}}\)\+" contains=@vimDefList nextgroup=vimDefParams
Aliaksei Budavei80aabaa2024-03-31 19:26:32 +0300322syn match vimDef "\<def\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+" contains=@vimDefList,vimMethodName nextgroup=vimDefParams
dkearns35e6f4c2024-03-22 06:41:10 +1100323
Doug Kearns35699f12024-09-19 19:51:59 +0200324syn match vimFuncComment contained +".*+ skipwhite skipempty nextgroup=vimFuncBody,vimEndfunction
325syn match vimDefComment contained "#.*" skipwhite skipempty nextgroup=vimDefBody,vimEnddef
dkearns35e6f4c2024-03-22 06:41:10 +1100326
327syn match vimFuncBang contained "!"
328syn match vimFuncSID contained "\c<sid>"
329syn match vimFuncSID contained "\<[sg]:"
330syn keyword vimFuncKey contained fu[nction]
331syn keyword vimDefKey contained def
Aliaksei Budavei80aabaa2024-03-31 19:26:32 +0300332syn keyword vimMethodName contained empty len string
dkearns35e6f4c2024-03-22 06:41:10 +1100333
Doug Kearns35699f12024-09-19 19:51:59 +0200334syn region vimFuncParams contained matchgroup=Delimiter start="(" skip=+\n\s*\\\|\n\s*"\\ + end=")" skipwhite skipempty nextgroup=vimFuncBody,vimFuncComment,vimEndfunction,vimFuncMod,vim9CommentError contains=vimFuncParam,@vimContinue
335syn region vimDefParams contained matchgroup=Delimiter start="(" end=")" skipwhite skipempty nextgroup=vimDefBody,vimDefComment,vimEnddef,vimReturnType,vimCommentError contains=vimDefParam,vim9Comment,vimFuncParamEquals
dkearns35e6f4c2024-03-22 06:41:10 +1100336syn match vimFuncParam contained "\<\h\w*\>\|\.\.\." skipwhite nextgroup=vimFuncParamEquals
337syn match vimDefParam contained "\<\h\w*\>" skipwhite nextgroup=vimParamType,vimFuncParamEquals
338
Doug Kearns35699f12024-09-19 19:51:59 +0200339syn match vimFuncParamEquals contained "=" skipwhite nextgroup=@vimExprList
340syn match vimFuncMod contained "\<\%(abort\|closure\|dict\|range\)\>" skipwhite skipempty nextgroup=vimFuncBody,vimFuncComment,vimEndfunction,vimFuncMod,vim9CommentError
dkearns35e6f4c2024-03-22 06:41:10 +1100341
Doug Kearns35699f12024-09-19 19:51:59 +0200342syn region vimFuncBody contained start="^." matchgroup=vimCmdSep start="|" matchgroup=vimCommand end="\<endfu\%[nction]\>" contains=@vimFuncBodyList skipwhite nextgroup=vimCmdSep,vimComment,vim9CommentError
343syn region vimDefBody contained start="^." matchgroup=vimCmdSep start="|" matchgroup=vimCommand end="\<enddef\>" contains=@vimDefBodyList skipwhite nextgroup=vimCmdSep,vim9Comment,vimCommentError
dkearns35e6f4c2024-03-22 06:41:10 +1100344
Doug Kearnsfc64ac02024-06-22 11:20:36 +0200345syn match vimEndfunction "\<endf\%[unction]\>" skipwhite nextgroup=vimCmdSep,vimComment,vim9CommentError
346syn match vimEnddef "\<enddef\>" skipwhite nextgroup=vimCmdSep,vim9Comment,vimCommentError
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000347
Bram Moolenaarf3913272016-02-25 00:00:01 +0100348if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f'
Doug Kearns35699f12024-09-19 19:51:59 +0200349 syn region vimFuncFold start="\<fu\%[nction]\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+\s*(" end="\<endf\%[unction]\>" contains=vimFunction fold keepend extend transparent
350 syn region vimFuncFold start="\<def\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\)\+(" end="\<enddef\>" contains=vimDef fold keepend extend transparent
351 syn region vimFuncFold start="\<def\s\+new\i\+(" end="\<enddef\>" contains=vimDef fold keepend extend transparent
Bram Moolenaarb4ff5182015-11-10 21:15:48 +0100352endif
dkearns35e6f4c2024-03-22 06:41:10 +1100353
354syn match vimFuncVar contained "a:\%(\K\k*\|\d\+\)\>"
Bram Moolenaar5c736222010-01-06 20:54:52 +0100355syn match vimFuncBlank contained "\s\+"
356
dkearns35e6f4c2024-03-22 06:41:10 +1100357" Types: {{{2
358" =====
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200359
Doug Kearns35699f12024-09-19 19:51:59 +0200360syn region vimReturnType contained start=":\s" end="$" matchgroup=vim9Comment end="\ze[#"]" skipwhite skipempty nextgroup=vimDefBody,vimDefComment,vimEnddef,vimCommentError contains=vimTypeSep transparent
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200361syn match vimParamType contained ":\s" skipwhite skipnl nextgroup=@vimType contains=vimTypeSep
dkearns35e6f4c2024-03-22 06:41:10 +1100362
363syn match vimTypeSep contained ":\s\@=" skipwhite nextgroup=@vimType
364syn keyword vimType contained any blob bool channel float job number string void
365syn match vimType contained "\<func\>"
366syn region vimCompoundType contained matchgroup=vimType start="\<func(" end=")" nextgroup=vimTypeSep contains=@vimType oneline transparent
367syn region vimCompoundType contained matchgroup=vimType start="\<\%(list\|dict\)<" end=">" contains=@vimType oneline transparent
368syn match vimUserType contained "\<\u\w*\>"
369
370syn cluster vimType contains=vimType,vimCompoundType,vimUserType
Bram Moolenaar4d8f4762021-06-27 15:18:56 +0200371
dkearns04e53632024-04-11 06:18:37 +1000372" Keymaps: {{{2
dkearns69866442023-11-22 05:43:40 +1100373" =======
374
dkearns04e53632024-04-11 06:18:37 +1000375syn match vimKeymapStart "^" contained skipwhite nextgroup=vimKeymapLhs,@vimKeymapLineComment
dkearns69866442023-11-22 05:43:40 +1100376syn match vimKeymapLhs "\S\+" contained skipwhite nextgroup=vimKeymapRhs contains=vimNotation
377syn match vimKeymapRhs "\S\+" contained skipwhite nextgroup=vimKeymapTailComment contains=vimNotation
378syn match vimKeymapTailComment "\S.*" contained
dkearns04e53632024-04-11 06:18:37 +1000379
380" TODO: remove when :" comment is matched in parts as "ex-colon comment" --djk
381if s:vim9script
382 syn match vim9KeymapLineComment "#.*" contained contains=@vimCommentGroup,vimCommentString,vim9CommentTitle
383else
384 syn match vimKeymapLineComment +".*+ contained contains=@vimCommentGroup,vimCommentString,vimCommentTitle
385endif
386syn cluster vimKeymapLineComment contains=vim9\=KeymapLineComment
dkearns69866442023-11-22 05:43:40 +1100387
Doug Kearns7866d542024-08-23 18:37:55 +0200388syn region vimLoadkeymap matchgroup=vimCommand start="\<loadk\%[eymap]\>" end="\%$" contains=vimKeymapStart
dkearns69866442023-11-22 05:43:40 +1100389
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000390" Special Filenames, Modifiers, Extension Removal: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000391" ===============================================
dkearns2c51e152024-02-27 07:10:18 +1100392syn match vimSpecFile "<c\(word\|WORD\)>" nextgroup=vimSpecFileMod,vimSubst1
393syn match vimSpecFile "<\([acs]file\|amatch\|abuf\)>" nextgroup=vimSpecFileMod,vimSubst1
394syn match vimSpecFile "\s%[ \t:]"ms=s+1,me=e-1 nextgroup=vimSpecFileMod,vimSubst1
395syn match vimSpecFile "\s%$"ms=s+1 nextgroup=vimSpecFileMod,vimSubst1
396syn match vimSpecFile "\s%<"ms=s+1,me=e-1 nextgroup=vimSpecFileMod,vimSubst1
397syn match vimSpecFile "#\d\+\|[#%]<\>" nextgroup=vimSpecFileMod,vimSubst1
Bram Moolenaar5c736222010-01-06 20:54:52 +0100398syn match vimSpecFileMod "\(:[phtre]\)\+" contained
Bram Moolenaar071d4272004-06-13 20:20:40 +0000399
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000400" User-Specified Commands: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000401" =======================
dkearns04e53632024-04-11 06:18:37 +1000402syn cluster vimUserCmdList contains=@vimCmdList,vimCmplxRepeat,@vimComment,vimCtrlChar,vimEscapeBrace,vimFunc,vimNotation,vimNumber,vimOper,vimRegister,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange
Doug Kearns3c07eb02024-09-02 10:03:37 +0200403syn keyword vimUserCmdKey contained com[mand]
404syn match vimUserCmdName contained "\<\u[[:alnum:]]*\>" skipwhite nextgroup=vimUserCmdBlock
405syn match vimUserCmd "\<com\%[mand]\>!\=.*$" contains=vimUserCmdKey,vimBang,vimUserCmdAttr,vimUserCmdAttrError,vimUserCmdName,@vimUserCmdList,vimComFilter
406syn match vimUserCmdAttrError contained "-\a\+\ze\%(\s\|=\)"
407syn match vimUserCmdAttr contained "-addr=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrAddr
408syn match vimUserCmdAttr contained "-bang\>" contains=vimUserCmdAttrKey
409syn match vimUserCmdAttr contained "-bar\>" contains=vimUserCmdAttrKey
410syn match vimUserCmdAttr contained "-buffer\>" contains=vimUserCmdAttrKey
411syn match vimUserCmdAttr contained "-complete=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrCmplt,vimUserCmdError
412syn match vimUserCmdAttr contained "-count\>" contains=vimUserCmdAttrKey
413syn match vimUserCmdAttr contained "-count=" contains=vimUserCmdAttrKey nextgroup=vimNumber
414syn match vimUserCmdAttr contained "-keepscript\>" contains=vimUserCmdAttrKey
415syn match vimUserCmdAttr contained "-nargs=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrNargs
416syn match vimUserCmdAttr contained "-range\>" contains=vimUserCmdAttrKey
417syn match vimUserCmdAttr contained "-range=" contains=vimUserCmdAttrKey nextgroup=vimNumber,vimUserCmdAttrRange
418syn match vimUserCmdAttr contained "-register\>" contains=vimUserCmdAttrKey
419
420syn match vimUserCmdAttrNargs contained "[01*?+]"
421syn match vimUserCmdAttrRange contained "%"
422
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100423if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_nousercmderror")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100424 syn match vimUserCmdError contained "\S\+\>"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000425endif
Bram Moolenaara93fa7e2006-04-17 22:14:47 +0000426
Doug Kearns3c07eb02024-09-02 10:03:37 +0200427syn case ignore
428syn keyword vimUserCmdAttrKey contained a[ddr] ban[g] bar bu[ffer] com[plete] cou[nt] k[eepscript] n[args] ra[nge] re[gister]
429" GEN_SYN_VIM: vimUserCmdAttrCmplt, START_STR='syn keyword vimUserCmdAttrCmplt contained', END_STR=''
430syn keyword vimUserCmdAttrCmplt contained arglist augroup behave breakpoint buffer color command compiler cscope diff_buffer dir dir_in_path environment event expression file file_in_path filetype function help highlight history keymap locale mapclear mapping menu messages option packadd runtime scriptnames shellcmd sign syntax syntime tag tag_listfiles user var
431syn keyword vimUserCmdAttrCmplt contained custom customlist nextgroup=vimUserCmdAttrCmpltFunc,vimUserCmdError
432syn match vimUserCmdAttrCmpltFunc contained ",\%([sS]:\|<[sS][iI][dD]>\)\=\%(\h\w*\%([.#]\h\w*\)\+\|\h\w*\)"hs=s+1 nextgroup=vimUserCmdError
433" GEN_SYN_VIM: vimUserCmdAttrAddr, START_STR='syn keyword vimUserCmdAttrAddr contained', END_STR=''
434syn keyword vimUserCmdAttrAddr contained arguments arg buffers buf lines line loaded_buffers load other quickfix qf tabs tab windows win
435syn match vimUserCmdAttrAddr contained "?"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000436syn case match
Bram Moolenaar071d4272004-06-13 20:20:40 +0000437
dkearns04e53632024-04-11 06:18:37 +1000438syn region vimUserCmdBlock contained matchgroup=vimSep start="{" end="}" contains=@vimDefBodyList
439
Doug Kearns3c07eb02024-09-02 10:03:37 +0200440syn match vimDelcommand "\<delc\%[ommand]\>" skipwhite nextgroup=vimDelcommandAttr
441syn match vimDelcommandAttr contained "-buffer\>"
442
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000443" Lower Priority Comments: after some vim commands... {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000444" =======================
dkearns959c3c82024-06-12 04:18:08 +1000445if get(g:, "vimsyn_comment_strings", 1)
Doug Kearns35699f12024-09-19 19:51:59 +0200446 syn region vimCommentString contained oneline start='\S\s\+"'ms=e end='"' extend
dkearns959c3c82024-06-12 04:18:08 +1000447endif
dkearns04e53632024-04-11 06:18:37 +1000448
449if s:vim9script
dkearns04e53632024-04-11 06:18:37 +1000450 syn cluster vimComment contains=vim9Comment
451else
dkearns04e53632024-04-11 06:18:37 +1000452 syn cluster vimComment contains=vimComment
453endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000454
Doug Kearns35699f12024-09-19 19:51:59 +0200455VimL syn match vimComment excludenl +\s"[^\-:.%#=*].*$+lc=1 contains=@vimCommentGroup,vimCommentString extend
456VimL syn match vimComment +\<endif\s\+".*$+lc=5 contains=@vimCommentGroup,vimCommentString extend
457VimL syn match vimComment +\<else\s\+".*$+lc=4 contains=@vimCommentGroup,vimCommentString extend
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200458" Vim9 comments - TODO: might be highlighted while they don't work
Doug Kearns35699f12024-09-19 19:51:59 +0200459Vim9 syn match vim9Comment excludenl +\s#[^{].*$+lc=1 contains=@vimCommentGroup,vimCommentString extend
460Vim9 syn match vim9Comment +\<endif\s\+#[^{].*$+lc=5 contains=@vimCommentGroup,vimCommentString extend
461Vim9 syn match vim9Comment +\<else\s\+#[^{].*$+lc=4 contains=@vimCommentGroup,vimCommentString extend
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200462" Vim9 comment inside expression
Doug Kearns35699f12024-09-19 19:51:59 +0200463Vim9 syn match vim9Comment +\s\zs#[^{].*$+ms=s+1 contains=@vimCommentGroup,vimCommentString contained extend
464Vim9 syn match vim9Comment +^\s*#[^{].*$+ contains=@vimCommentGroup,vimCommentString contained extend
465Vim9 syn match vim9Comment +^\s*#$+ contains=@vimCommentGroup,vimCommentString contained extend
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200466
Doug Kearnsfc64ac02024-06-22 11:20:36 +0200467syn match vim9CommentError contained "#.*"
468syn match vimCommentError contained +".*+
469
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000470" Environment Variables: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000471" =====================
Bram Moolenaar5c736222010-01-06 20:54:52 +0100472syn match vimEnvvar "\$\I\i*"
473syn match vimEnvvar "\${\I\i*}"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000474
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000475" In-String Specials: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000476" Try to catch strings, if nothing else matches (therefore it must precede the others!)
477" vimEscapeBrace handles ["] []"] (ie. "s don't terminate string inside [])
Bram Moolenaar5c736222010-01-06 20:54:52 +0100478syn region vimEscapeBrace oneline contained transparent start="[^\\]\(\\\\\)*\[\zs\^\=\]\=" skip="\\\\\|\\\]" end="]"me=e-1
479syn match vimPatSepErr contained "\\)"
480syn match vimPatSep contained "\\|"
Bram Moolenaarb730f0c2018-11-25 03:56:26 +0100481syn region vimPatSepZone oneline contained matchgroup=vimPatSepZ start="\\%\=\ze(" skip="\\\\" end="\\)\|[^\\]['"]" contains=@vimStringGroup
Bram Moolenaar5c736222010-01-06 20:54:52 +0100482syn region vimPatRegion contained transparent matchgroup=vimPatSepR start="\\[z%]\=(" end="\\)" contains=@vimSubstList oneline
483syn match vimNotPatSep contained "\\\\"
Bram Moolenaar6ba83ba2022-06-12 22:15:57 +0100484syn cluster vimStringGroup contains=vimEscape,vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone,@Spell
Doug Kearns35699f12024-09-19 19:51:59 +0200485syn region vimString oneline keepend start=+[^a-zA-Z>!\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ contains=@vimStringGroup extend
486syn region vimString oneline keepend start=+[^a-zA-Z>!\\@]'+lc=1 end=+'+ extend
Bram Moolenaaracc22402020-06-07 21:07:18 +0200487"syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup " see tst45.vim
Bram Moolenaar5c736222010-01-06 20:54:52 +0100488syn match vimString contained +"[^"]*\\$+ skipnl nextgroup=vimStringCont
489syn match vimStringCont contained +\(\\\\\|.\)\{-}[^\\]"+
Bram Moolenaar6ba83ba2022-06-12 22:15:57 +0100490syn match vimEscape contained "\\."
dkearnse3e39342024-02-02 07:44:26 +1100491" syn match vimEscape contained +\\[befnrt\"]+
492syn match vimEscape contained "\\\o\{1,3}\|\\[xX]\x\{1,2}\|\\u\x\{1,4}\|\\U\x\{1,8}"
493syn match vimEscape contained "\\<" contains=vimNotation
494syn match vimEscape contained "\\<\*[^>]*>\=>"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000495
Doug Kearns35699f12024-09-19 19:51:59 +0200496syn region vimString oneline start=+$'+ skip=+''+ end=+'+ contains=@vimStringInterpolation extend
497syn region vimString oneline start=+$"+ end=+"+ contains=@vimStringGroup,@vimStringInterpolation extend
dkearnsb1427b42024-02-28 05:59:30 +1100498syn region vimStringInterpolationExpr oneline contained matchgroup=vimSep start=+{+ end=+}+ contains=@vimExprList
499syn match vimStringInterpolationBrace contained "{{"
500syn match vimStringInterpolationBrace contained "}}"
Doug Kearnsd164f2a2024-08-16 21:07:15 +0200501syn cluster vimStringInterpolation contains=vimStringInterpolationExpr,vimStringInterpolationBrace
thincacf8695d2024-01-28 18:57:23 +0100502
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000503" Substitutions: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000504" =============
Bram Moolenaar5c736222010-01-06 20:54:52 +0100505syn cluster vimSubstList contains=vimPatSep,vimPatRegion,vimPatSepErr,vimSubstTwoBS,vimSubstRange,vimNotation
506syn cluster vimSubstRepList contains=vimSubstSubstr,vimSubstTwoBS,vimNotation
507syn cluster vimSubstList add=vimCollection
Doug Kearns92f4e912024-06-05 19:45:43 +0200508syn match vimSubst "^\s*\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)\>" skipwhite nextgroup=vimSubstPat
509syn match vimSubst "^\s*\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)[_#]\@=" skipwhite nextgroup=vimSubstPat
510syn match vimSubst1 contained "\%(s\%[ubstitute]\|sm\%[agic]\>\|sno\%[magic]\)\>" skipwhite nextgroup=vimSubstPat
511syn match vimSubst1 contained "\%(s\%[ubstitute]\|sm\%[agic]\>\|sno\%[magic]\)[_#]\@=" skipwhite nextgroup=vimSubstPat
dkearns2c51e152024-02-27 07:10:18 +1100512" TODO: Vim9 illegal separators for abbreviated :s form are [-.:], :su\%[...] required
513" : # is allowed but "not recommended" (see :h pattern-delimiter)
514syn 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
515syn region vimSubstRep4 contained matchgroup=vimSubstDelim start="\z(.\)" skip="\\\\\|\\\z1" end="\z1" matchgroup=vimNotation end="<[cC][rR]>" contains=@vimSubstRepList nextgroup=vimSubstFlagErr oneline
516syn region vimCollection contained transparent start="\\\@<!\[" skip="\\\[" end="\]" contains=vimCollClass
517syn match vimCollClassErr contained "\[:.\{-\}:\]"
518syn match vimCollClass contained transparent "\%#=1\[:\(alnum\|alpha\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|xdigit\|retu\%[rn]\|tab\|escape\|backspace\):\]"
519syn match vimSubstSubstr contained "\\z\=\d"
520syn match vimSubstTwoBS contained "\\\\"
521syn match vimSubstFlagErr contained "[^< \t\r|]\+" contains=vimSubstFlags
522syn match vimSubstFlags contained "[&cegiIlnpr#]\+"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000523
Doug Kearns92f4e912024-06-05 19:45:43 +0200524" Vi compatibility
525syn match vimSubstDelim contained "\\"
526syn match vimSubstPat contained "\\\ze[/?&]" contains=vimSubstDelim nextgroup=vimSubstRep4
527
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000528" 'String': {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +0100529syn match vimString "[^(,]'[^']\{-}\zs'"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000530
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000531" Marks, Registers, Addresses, Filters: {{{2
dkearns2c51e152024-02-27 07:10:18 +1100532syn match vimMark "'[a-zA-Z0-9]\ze[-+,!]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
Doug Kearnsd8176092024-08-31 16:57:32 +0200533syn match vimMark "'[[\]{}()<>]\ze[-+,!]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
534syn match vimMark ",\zs'[[\]{}()<>]\ze" nextgroup=vimFilter,vimMarkNumber,vimSubst1
dkearns2c51e152024-02-27 07:10:18 +1100535syn match vimMark "[!,:]\zs'[a-zA-Z0-9]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
536syn match vimMark "\<norm\%[al]\s\zs'[a-zA-Z0-9]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
537syn match vimMarkNumber "[-+]\d\+" contained contains=vimOper nextgroup=vimSubst1
Bram Moolenaar5c736222010-01-06 20:54:52 +0100538syn match vimPlainMark contained "'[a-zA-Z0-9]"
Bram Moolenaar6c1e1572019-06-22 02:13:00 +0200539syn match vimRange "[`'][a-zA-Z0-9],[`'][a-zA-Z0-9]" contains=vimMark skipwhite nextgroup=vimFilter
Bram Moolenaar071d4272004-06-13 20:20:40 +0000540
Bram Moolenaarb4ff5182015-11-10 21:15:48 +0100541syn match vimRegister '[^,;[{: \t]\zs"[a-zA-Z0-9.%#:_\-/]\ze[^a-zA-Z_":0-9]'
Bram Moolenaar5c736222010-01-06 20:54:52 +0100542syn match vimRegister '\<norm\s\+\zs"[a-zA-Z0-9]'
543syn match vimRegister '\<normal\s\+\zs"[a-zA-Z0-9]'
544syn match vimRegister '@"'
545syn match vimPlainRegister contained '"[a-zA-Z0-9\-:.%#*+=]'
dkearnsf6869212023-12-11 01:53:24 +1100546syn match vimLetRegister contained '@["0-9\-a-zA-Z#=*+_/]'
Bram Moolenaar071d4272004-06-13 20:20:40 +0000547
Bram Moolenaar5c736222010-01-06 20:54:52 +0100548syn match vimAddress ",\zs[.$]" skipwhite nextgroup=vimSubst1
549syn match vimAddress "%\ze\a" skipwhite nextgroup=vimString,vimSubst1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000550
Bram Moolenaar6c1e1572019-06-22 02:13:00 +0200551syn match vimFilter "^!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile
Bram Moolenaard58a3bf2020-09-28 21:48:16 +0200552syn match vimFilter contained "!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile
553syn match vimComFilter contained "|!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile
Bram Moolenaar071d4272004-06-13 20:20:40 +0000554
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100555" Complex Repeats: (:h complex-repeat) {{{2
556" ===============
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100557syn match vimCmplxRepeat '[^a-zA-Z_/\\()]q[0-9a-zA-Z"]\>'lc=1
558syn match vimCmplxRepeat '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\>\)'
Bram Moolenaar071d4272004-06-13 20:20:40 +0000559
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000560" Set command and associated set-options (vimOptions) with comment {{{2
Doug Kearnsddbb6fe2024-07-24 20:21:22 +0200561syn match vimSet "\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skipwhite nextgroup=vimSetBang,vimSetRegion
562syn region vimSetRegion contained start="\S" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*["#]\\ + matchgroup=vimCmdSep end="|" end="$" matchgroup=vimNotation end="<[cC][rR]>" keepend contains=@vimComment,@vimContinue,vimErrSetting,vimOption,vimSetAll,vimSetTermcap
563syn region vimSetEqual contained matchgroup=vimOper start="[=:]\|[-+^]=" skip=+\\\\\|\\|\|\\\s\|\n\s*\\\|\n\s*["#]\\ \|^\s*\\\|^\s*["#]\\ + matchgroup=vimCmdSep end="|" end="\ze\s" end="$" contains=@vimContinue,vimCtrlChar,vimEnvvar,vimNotation,vimSetSep
564syn match vimSetBang contained "\a\@1<=!" skipwhite nextgroup=vimSetAll,vimSetTermcap
565syn keyword vimSetAll contained all nextgroup=vimSetMod
566syn keyword vimSetTermcap contained termcap
567syn region vimSetString contained start=+="+hs=s+1 skip=+\\\\\|\\"+ end=+"+ contains=vimCtrlChar
Bram Moolenaar4072ba52020-12-23 13:56:35 +0100568syn match vimSetSep contained "[,:]"
Doug Kearnsddbb6fe2024-07-24 20:21:22 +0200569syn match vimSetMod contained "\a\@1<=\%(&vim\=\|[!&?<]\)"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000570
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200571" Variable Declarations: {{{2
572" =====================
573VimL syn keyword vimLet let skipwhite nextgroup=vimVar,vimFuncVar,vimLetRegister,vimVarList
574VimL syn keyword vimConst cons[t] skipwhite nextgroup=vimVar,vimVarList
575syn region vimVarList contained start="\[" end="]" contains=vimVar,@vimContinue
dkearnsf6869212023-12-11 01:53:24 +1100576
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200577VimL syn keyword vimUnlet unl[et] skipwhite nextgroup=vimUnletBang,vimUnletVars
dkearnsf6869212023-12-11 01:53:24 +1100578syn match vimUnletBang contained "!" skipwhite nextgroup=vimUnletVars
579syn region vimUnletVars contained start="$\I\|\h" skip="\n\s*\\" end="$" end="|" contains=vimVar,vimEnvvar,vimContinue,vimString,vimNumber
580
Doug Kearns7884cc72024-08-23 18:01:35 +0200581VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='\%(^\z(\s*\)\S.*\)\@<==<<\s*trim\%(\s\+\)\@>\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\z1\=\z2$' extend
Ken Takata95e90782024-08-22 21:29:39 +0200582VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='=<<\%(\s*\)\@>\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\z1$' extend
Doug Kearns7884cc72024-08-23 18:01:35 +0200583VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='\%(^\z(\s*\)\S.*\)\@<==<<\s*\%(trim\s\+eval\|eval\s\+trim\)\%(\s\+\)\@>\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\z1\=\z2$' contains=@vimStringInterpolation extend
Ken Takata95e90782024-08-22 21:29:39 +0200584VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='=<<\s*eval\%(\s\+\)\@>\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\z1$' contains=@vimStringInterpolation extend
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200585
586Vim9 syn keyword vim9Const const skipwhite nextgroup=vim9Variable,vim9VariableList
587Vim9 syn keyword vim9Final final skipwhite nextgroup=vim9Variable,vim9VariableList
588Vim9 syn keyword vim9Var var skipwhite nextgroup=vim9Variable,vim9VariableList
589
590syn match vim9Variable contained "\<\h\w*\>" skipwhite nextgroup=vimTypeSep,vimLetHereDoc
591syn region vim9VariableList contained start="\[" end="]" contains=vim9Variable,@vimContinue
Bram Moolenaar071d4272004-06-13 20:20:40 +0000592
dkearnsf6869212023-12-11 01:53:24 +1100593" For: {{{2
594" ===
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200595if s:vim9script
596 syn keyword vim9For for skipwhite nextgroup=vim9Variable,vim9VariableList
597else
598 syn keyword vimFor for skipwhite nextgroup=vimVar,vimVarList
599endif
dkearns76d62982024-03-23 05:55:25 +1100600
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100601" Abbreviations: {{{2
Bram Moolenaare37d50a2008-08-06 17:06:04 +0000602" =============
h-east9b53c052024-02-13 21:09:22 +0100603" GEN_SYN_VIM: vimCommand abbrev, START_STR='syn keyword vimAbb', END_STR='skipwhite nextgroup=vimMapMod,vimMapLhs'
dkearns16249702024-02-23 05:45:05 +1100604syn 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 +1100605" GEN_SYN_VIM: vimCommand abclear, START_STR='syn keyword vimAbb', END_STR='skipwhite nextgroup=vimMapMod'
606syn keyword vimAbb abc[lear] cabc[lear] iabc[lear] skipwhite nextgroup=vimMapMod
Bram Moolenaare37d50a2008-08-06 17:06:04 +0000607
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100608" Autocmd: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000609" =======
Bram Moolenaar5c736222010-01-06 20:54:52 +0100610syn match vimAutoEventList contained "\(!\s\+\)\=\(\a\+,\)*\a\+" contains=vimAutoEvent nextgroup=vimAutoCmdSpace
611syn match vimAutoCmdSpace contained "\s\+" nextgroup=vimAutoCmdSfxList
dkearns04e53632024-04-11 06:18:37 +1000612syn match vimAutoCmdSfxList contained "\S*" skipwhite nextgroup=vimAutoCmdMod,vimAutoCmdBlock
Bram Moolenaar5c736222010-01-06 20:54:52 +0100613syn keyword vimAutoCmd au[tocmd] do[autocmd] doautoa[ll] skipwhite nextgroup=vimAutoEventList
dkearns04e53632024-04-11 06:18:37 +1000614syn match vimAutoCmdMod "\(++\)\=\(once\|nested\)" skipwhite nextgroup=vimAutoCmdBlock
615syn region vimAutoCmdBlock contained matchgroup=vimSep start="{" end="}" contains=@vimDefBodyList
Bram Moolenaar071d4272004-06-13 20:20:40 +0000616
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100617" Echo And Execute: -- prefer strings! {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000618" ================
dkearns61887b32024-03-15 23:45:48 +1100619" NOTE: No trailing comments
dkearnsb1427b42024-02-28 05:59:30 +1100620
dkearns61887b32024-03-15 23:45:48 +1100621syn region vimEcho
622 \ matchgroup=vimCommand
623 \ start="\<ec\%[ho]\>"
624 \ start="\<echoe\%[rr]\>"
625 \ start="\<echom\%[sg]\>"
626 \ start="\<echoc\%[onsole]\>"
627 \ start="\<echon\>"
628 \ start="\<echow\%[indow]\>"
629 \ skip=+\\|\|\n\s*\\\|\n\s*"\\ +
630 \ matchgroup=vimCmdSep end="|" excludenl end="$" contains=@vimContinue,@vimExprList transparent
631
632syn match vimEchohl "\<echohl\=\>" skipwhite nextgroup=vimGroup,vimHLGroup,vimEchohlNone
Bram Moolenaar071d4272004-06-13 20:20:40 +0000633syn case ignore
dkearns61887b32024-03-15 23:45:48 +1100634syn keyword vimEchohlNone contained none
Bram Moolenaar071d4272004-06-13 20:20:40 +0000635syn case match
636
dkearns35e6f4c2024-03-22 06:41:10 +1100637syn cluster vimEcho contains=vimEcho,vimEchohl
dkearns61887b32024-03-15 23:45:48 +1100638
639syn region vimExecute matchgroup=vimCommand start="\<exe\%[cute]\>" skip=+\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|" excludenl end="$" contains=@vimContinue,@vimExprList transparent
dkearnsb1427b42024-02-28 05:59:30 +1100640
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100641" Maps: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000642" ====
Doug Kearns99984fc2024-07-18 20:45:19 +0200643" GEN_SYN_VIM: vimCommand map, START_STR='syn keyword vimMap', END_STR='skipwhite nextgroup=vimMapMod,vimMapLhs'
644syn 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
645syn match vimMap "\<map\>" skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
646syn keyword vimMap no[remap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
dkearns16249702024-02-23 05:45:05 +1100647" GEN_SYN_VIM: vimCommand mapclear, START_STR='syn keyword vimMap', END_STR='skipwhite nextgroup=vimMapMod'
648syn 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 +0200649syn keyword vimMap mapc[lear] skipwhite nextgroup=vimMapBang,vimMapMod
650" GEN_SYN_VIM: vimCommand unmap, START_STR='syn keyword vimUnmap', END_STR='skipwhite nextgroup=vimMapMod,vimMapLhs'
651syn keyword vimUnmap cu[nmap] iu[nmap] lu[nmap] nun[map] ou[nmap] sunm[ap] tunma[p] vu[nmap] xu[nmap] skipwhite nextgroup=vimMapMod,vimMapLhs
652syn keyword vimUnmap unm[ap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
653
dkearns5d67aef2024-03-10 04:01:22 +1100654syn match vimMapLhs contained "\%(.\|\S\)\+" contains=vimCtrlChar,vimNotation skipwhite nextgroup=vimMapRhs
655syn match vimMapLhs contained "\%(.\|\S\)\+\ze\s*$" contains=vimCtrlChar,vimNotation skipwhite skipnl nextgroup=vimMapRhsContinue
656syn match vimMapBang contained "\a\@1<=!" skipwhite nextgroup=vimMapMod,vimMapLhs
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200657syn match vimMapMod contained "\%#=1\c<\(buffer\|expr\|\(local\)\=leader\|nowait\|plug\|script\|sid\|unique\|silent\)\+>" contains=vimMapModKey,vimMapModErr skipwhite nextgroup=vimMapMod,vimMapLhs
dkearns5d67aef2024-03-10 04:01:22 +1100658syn region vimMapRhs contained start="\S" skip=+\\|\|\@1<=|\|\n\s*\\\|\n\s*"\\ + end="|" end="$" contains=@vimContinue,vimCtrlChar,vimNotation skipnl nextgroup=vimMapRhsContinue
659" assume a continuation comment introduces the RHS
660syn region vimMapRhsContinue contained start=+^\s*\%(\\\|"\\ \)+ skip=+\\|\|\@1<=|\|\n\s*\\\|\n\s*"\\ + end="|" end="$" contains=@vimContinue,vimCtrlChar,vimNotation
Bram Moolenaar071d4272004-06-13 20:20:40 +0000661syn case ignore
Bram Moolenaarb4ff5182015-11-10 21:15:48 +0100662syn keyword vimMapModKey contained buffer expr leader localleader nowait plug script sid silent unique
Bram Moolenaar071d4272004-06-13 20:20:40 +0000663syn case match
664
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100665" Menus: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000666" =====
dkearns62b26042024-03-10 03:43:28 +1100667" NOTE: tail comments disallowed
668" GEN_SYN_VIM: vimCommand menu, START_STR='syn keyword vimMenu', END_STR='skipwhite nextgroup=vimMenuBang,vimMenuMod,vimMenuName,vimMenuPriority,vimMenuStatus'
669syn 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
670syn keyword vimMenu popu[p] skipwhite nextgroup=vimMenuBang,vimMenuName
671syn region vimMenuRhs contained contains=@vimContinue,vimNotation start="|\@!\S" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + end="$" matchgroup=vimSep end="|"
672syn region vimMenuRhsContinue contained contains=@vimContinue,vimNotation start=+^\s*\%(\\\|"\\ \)+ skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + end="$" matchgroup=vimSep end="|"
dkearnsec21baf2024-03-20 04:04:42 +1100673syn match vimMenuName "\.\@!\%(\\\s\|\S\)\+" contained contains=vimMenuNotation,vimNotation skipwhite nextgroup=vimCmdSep,vimMenuRhs
674syn match vimMenuName "\.\@!\%(\\\s\|\S\)\+\ze\s*$" contained contains=vimMenuNotation,vimNotation skipwhite skipnl nextgroup=vimCmdSep,vimMenuRhsContinue
dkearns62b26042024-03-10 03:43:28 +1100675syn match vimMenuNotation "&\a\|&&\|\\\s\|\\\." contained
676syn match vimMenuPriority "\<\d\+\%(\.\d\+\)*\>" contained skipwhite nextgroup=vimMenuName
677syn match vimMenuMod "\c<\%(script\|silent\|special\)>" contained skipwhite nextgroup=vimMenuName,vimMenuPriority,vimMenuMod contains=vimMapModKey,vimMapModErr
678syn keyword vimMenuStatus enable disable nextgroup=vimMenuName skipwhite
679syn match vimMenuBang "\a\@1<=!" contained skipwhite nextgroup=vimMenuName,vimMenuMod
680
681syn region vimMenutranslate
682 \ matchgroup=vimCommand start="\<menut\%[ranslate]\>"
683 \ skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ +
684 \ end="$" matchgroup=vimCmdSep end="|" matchgroup=vimMenuClear end="\<clear\ze\s*\%(["#|]\|$\)"
685 \ contains=@vimContinue,vimMenutranslateName keepend transparent
686" oneline is sufficient to match the current formatting in runtime/lang/*.vim
687syn match vimMenutranslateName "\%(\\\s\|\S\)\+" contained contains=vimMenuNotation,vimNotation
688syn match vimMenutranslateComment +".*+ contained containedin=vimMenutranslate
Bram Moolenaar071d4272004-06-13 20:20:40 +0000689
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100690" Angle-Bracket Notation: (tnx to Michael Geddes) {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000691" ======================
692syn case ignore
dkearnse3e39342024-02-02 07:44:26 +1100693syn match vimNotation "\%#=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
694
695syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}\%(net\|dec\|jsb\|pterm\|urxvt\|sgr\)mouse>" contains=vimBracket
696syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}\%(left\|middle\|right\)\%(mouse\|drag\|release\)>" contains=vimBracket
697syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}left\%(mouse\|release\)nm>" contains=vimBracket
698syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}x[12]\%(mouse\|drag\|release\)>" contains=vimBracket
699syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}sgrmouserelease>" contains=vimBracket
700syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}mouse\%(up\|down\|move\)>" contains=vimBracket
701syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}scrollwheel\%(up\|down\|right\|left\)>" contains=vimBracket
702
703syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%(sid\|nop\|nul\|lt\|drop\)>" contains=vimBracket
704syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%(snr\|plug\|cursorhold\|ignore\|cmd\|scriptcmd\|focus\%(gained\|lost\)\)>" contains=vimBracket
705syn match vimNotation '\%(\\\|<lt>\)\=<C-R>[0-9a-z"%#:.\-=]'he=e-1 contains=vimBracket
706syn match vimNotation '\%#=1\%(\\\|<lt>\)\=<\%(q-\)\=\%(line[12]\|count\|bang\|reg\|args\|mods\|f-args\|f-mods\|lt\)>' contains=vimBracket
707syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%([cas]file\|abuf\|amatch\|cexpr\|cword\|cWORD\|client\|stack\|script\|sf\=lnum\)>" contains=vimBracket
708syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%([scamd]-\)\{0,4}char-\%(\d\+\|0\o\+\|0x\x\+\)>" contains=vimBracket
709
Bram Moolenaar5c736222010-01-06 20:54:52 +0100710syn match vimBracket contained "[\\<>]"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000711syn case match
712
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100713" User Function Highlighting: {{{2
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000714" (following Gautam Iyer's suggestion)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000715" ==========================
dkearnsb4b3d7d2024-03-16 04:53:53 +1100716syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" contains=vimFuncEcho,vimFuncName,vimUserFunc,vimExecute
Aliaksei Budavei80aabaa2024-03-31 19:26:32 +0300717syn match vimUserFunc contained "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\<if\>" contains=vimNotation,vimMethodName
dkearnsb4b3d7d2024-03-16 04:53:53 +1100718syn keyword vimFuncEcho contained ec ech echo
719
Doug Kearns99984fc2024-07-18 20:45:19 +0200720syn match vimMap "\<map\%(\s\+(\)\@=" skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
721
Bram Moolenaar2547aa92020-07-26 17:00:44 +0200722" User Command Highlighting: {{{2
Bram Moolenaard2ea7cf2021-05-30 20:54:13 +0200723syn match vimUsrCmd '^\s*\zs\u\%(\w*\)\@>\%([(#[]\|\s\+\%([-+*/%]\=\|\.\.\)=\)\@!'
Bram Moolenaar2547aa92020-07-26 17:00:44 +0200724
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000725" Errors And Warnings: {{{2
726" ====================
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100727if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimfunctionerror")
Aliaksei Budaveidfcef892024-02-18 21:02:14 +0300728 " TODO: The new-prefix exception should only apply to constructor definitions.
Aliaksei Budavei80aabaa2024-03-31 19:26:32 +0300729 " TODO: The |builtin-object-methods| exception should only apply to method
730 " definitions.
731 syn match vimFunctionError "\s\zs\%(empty\|len\|new\|string\)\@![a-z0-9]\i\{-}\ze\s*(" contained contains=vimFuncKey,vimFuncBlank
Bram Moolenaar6c1e1572019-06-22 02:13:00 +0200732 syn match vimFunctionError "\s\zs\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\d\i\{-}\ze\s*(" contained contains=vimFuncKey,vimFuncBlank
Bram Moolenaar5c736222010-01-06 20:54:52 +0100733 syn match vimElseIfErr "\<else\s\+if\>"
734 syn match vimBufnrWarn /\<bufnr\s*(\s*["']\.['"]\s*)/
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000735endif
736
Doug Kearns4d427d42024-09-15 19:21:18 +0200737syn match vimNotFunc "\<if\>\|\<el\%[seif]\>\|\<retu\%[rn]\>\|\<while\>" skipwhite nextgroup=@vimExprList,vimNotation
Bram Moolenaar6c1e1572019-06-22 02:13:00 +0200738
Doug Kearnse85fdc72024-07-07 20:45:37 +0200739" Match: {{{2
740" =====
741syn match vimMatch "\<[23]\=mat\%[ch]\>" skipwhite nextgroup=vimMatchGroup,vimMatchNone
742syn match vimMatchGroup contained "[[:alnum:]._-]\+" skipwhite nextgroup=vimMatchPattern
743syn case ignore
744syn keyword vimMatchNone contained none
745syn case match
746syn region vimMatchPattern contained matchgroup=Delimiter start="\z([!#$%&'()*+,-./:;<=>?@[\]^_`{}~]\)" skip="\\\\\|\\\z1" end="\z1" contains=@vimSubstList oneline
747
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100748" Norm: {{{2
Bram Moolenaar05159a02005-02-26 23:04:13 +0000749" ====
Bram Moolenaar5c736222010-01-06 20:54:52 +0100750syn match vimNorm "\<norm\%[al]!\=" skipwhite nextgroup=vimNormCmds
751syn match vimNormCmds contained ".*$"
Bram Moolenaar05159a02005-02-26 23:04:13 +0000752
Doug Kearns262e25e2024-06-14 20:16:35 +0200753" Sleep: {{{2
754" =====
755syn keyword vimSleep sl[eep] skipwhite nextgroup=vimSleepBang,vimSleepArg
756syn match vimSleepBang contained "\a\@1<=!" skipwhite nextgroup=vimSleepArg
757syn match vimSleepArg contained "\<\%(\d\+\)\=m\=\>"
758
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100759" Syntax: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000760"=======
dkearns21ce1592024-01-29 04:54:08 +1100761syn match vimGroupList contained "[^[:space:],]\+\%(\s*,\s*[^[:space:],]\+\)*" contains=vimGroupSpecial
762syn 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
763syn keyword vimGroupSpecial contained ALL ALLBUT CONTAINED TOP
764
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100765if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsynerror")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100766 syn match vimSynError contained "\i\+"
767 syn match vimSynError contained "\i\+=" nextgroup=vimGroupList
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000768endif
dkearns21ce1592024-01-29 04:54:08 +1100769syn match vimSynContains contained "\<contain\%(s\|edin\)=" skipwhite skipnl nextgroup=vimGroupList
770syn match vimSynKeyContainedin contained "\<containedin=" skipwhite skipnl nextgroup=vimGroupList
771syn match vimSynNextgroup contained "\<nextgroup=" skipwhite skipnl nextgroup=vimGroupList
dkearnsc79646d2024-01-05 08:58:48 +1100772if has("conceal")
dkearns21ce1592024-01-29 04:54:08 +1100773 " no whitespace allowed after '='
dkearnsc79646d2024-01-05 08:58:48 +1100774 syn match vimSynCchar contained "\<cchar=" nextgroup=vimSynCcharValue
775 syn match vimSynCcharValue contained "\S"
776endif
777
dkearns04e53632024-04-11 06:18:37 +1000778syn match vimSyntax "\<sy\%[ntax]\>" contains=vimCommand skipwhite nextgroup=vimSynType,@vimComment
Bram Moolenaard960d762011-09-21 19:22:10 +0200779syn cluster vimFuncBodyList add=vimSyntax
Bram Moolenaar071d4272004-06-13 20:20:40 +0000780
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000781" Syntax: case {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +0100782syn keyword vimSynType contained case skipwhite nextgroup=vimSynCase,vimSynCaseError
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100783if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsyncaseerror")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100784 syn match vimSynCaseError contained "\i\+"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000785endif
Bram Moolenaar5c736222010-01-06 20:54:52 +0100786syn keyword vimSynCase contained ignore match
Bram Moolenaar071d4272004-06-13 20:20:40 +0000787
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000788" Syntax: clear {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +0100789syn keyword vimSynType contained clear skipwhite nextgroup=vimGroupList
Bram Moolenaar071d4272004-06-13 20:20:40 +0000790
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000791" Syntax: cluster {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +0100792syn keyword vimSynType contained cluster skipwhite nextgroup=vimClusterName
dkearns21ce1592024-01-29 04:54:08 +1100793syn region vimClusterName contained keepend matchgroup=vimGroupName start="\h\w*\>" skip=+\\\\\|\\\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="$\||" contains=@vimContinue,vimGroupAdd,vimGroupRem,vimSynContains,vimSynError
794syn match vimGroupAdd contained keepend "\<add=" skipwhite skipnl nextgroup=vimGroupList
795syn match vimGroupRem contained keepend "\<remove=" skipwhite skipnl nextgroup=vimGroupList
Bram Moolenaar071d4272004-06-13 20:20:40 +0000796
Brad Kingd4634a22024-01-03 10:17:24 -0500797" Syntax: foldlevel {{{2
798syn keyword vimSynType contained foldlevel skipwhite nextgroup=vimSynFoldMethod,vimSynFoldMethodError
799if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsynfoldmethoderror")
800 syn match vimSynFoldMethodError contained "\i\+"
801endif
802syn keyword vimSynFoldMethod contained start minimum
803
Bram Moolenaar13d5aee2016-01-21 23:36:05 +0100804" Syntax: iskeyword {{{2
805syn keyword vimSynType contained iskeyword skipwhite nextgroup=vimIskList
806syn match vimIskList contained '\S\+' contains=vimIskSep
807syn match vimIskSep contained ','
808
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000809" Syntax: include {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +0100810syn keyword vimSynType contained include skipwhite nextgroup=vimGroupList
Bram Moolenaar071d4272004-06-13 20:20:40 +0000811
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000812" Syntax: keyword {{{2
dkearns21ce1592024-01-29 04:54:08 +1100813syn cluster vimSynKeyGroup contains=@vimContinue,vimSynCchar,vimSynNextgroup,vimSynKeyOpt,vimSynKeyContainedin
Bram Moolenaar5c736222010-01-06 20:54:52 +0100814syn keyword vimSynType contained keyword skipwhite nextgroup=vimSynKeyRegion
dkearns21ce1592024-01-29 04:54:08 +1100815syn region vimSynKeyRegion contained keepend matchgroup=vimGroupName start="\h\w*\>" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|\|$" contains=@vimSynKeyGroup
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200816syn match vimSynKeyOpt contained "\%#=1\<\(conceal\|contained\|transparent\|skipempty\|skipwhite\|skipnl\)\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000817
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000818" Syntax: match {{{2
dkearns21ce1592024-01-29 04:54:08 +1100819syn cluster vimSynMtchGroup contains=@vimContinue,vimSynCchar,vimSynContains,vimSynError,vimSynMtchOpt,vimSynNextgroup,vimSynRegPat,vimNotation,vimMtchComment
Bram Moolenaar5c736222010-01-06 20:54:52 +0100820syn keyword vimSynType contained match skipwhite nextgroup=vimSynMatchRegion
dkearns21ce1592024-01-29 04:54:08 +1100821syn region vimSynMatchRegion contained keepend matchgroup=vimGroupName start="\h\w*\>" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|\|$" contains=@vimSynMtchGroup
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200822syn match vimSynMtchOpt contained "\%#=1\<\(conceal\|transparent\|contained\|excludenl\|keepend\|skipempty\|skipwhite\|display\|extend\|skipnl\|fold\)\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000823
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000824" Syntax: off and on {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +0100825syn keyword vimSynType contained enable list manual off on reset
Bram Moolenaar071d4272004-06-13 20:20:40 +0000826
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000827" Syntax: region {{{2
dkearns21ce1592024-01-29 04:54:08 +1100828syn cluster vimSynRegPatGroup contains=@vimContinue,vimPatSep,vimNotPatSep,vimSynPatRange,vimSynNotPatRange,vimSubstSubstr,vimPatRegion,vimPatSepErr,vimNotation
829syn cluster vimSynRegGroup contains=@vimContinue,vimSynCchar,vimSynContains,vimSynNextgroup,vimSynRegOpt,vimSynReg,vimSynMtchGrp
Bram Moolenaar5c736222010-01-06 20:54:52 +0100830syn keyword vimSynType contained region skipwhite nextgroup=vimSynRegion
dkearns21ce1592024-01-29 04:54:08 +1100831syn region vimSynRegion contained keepend matchgroup=vimGroupName start="\h\w*" skip=+\\\\\|\\\|\n\s*\\\|\n\s*"\\ + end="|\|$" contains=@vimSynRegGroup
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200832syn match vimSynRegOpt contained "\%#=1\<\(conceal\(ends\)\=\|transparent\|contained\|excludenl\|skipempty\|skipwhite\|display\|keepend\|oneline\|extend\|skipnl\|fold\)\>"
dkearns21ce1592024-01-29 04:54:08 +1100833syn match vimSynReg contained "\<\%(start\|skip\|end\)=" nextgroup=vimSynRegPat
Bram Moolenaar5c736222010-01-06 20:54:52 +0100834syn match vimSynMtchGrp contained "matchgroup=" nextgroup=vimGroup,vimHLGroup
dkearns21ce1592024-01-29 04:54:08 +1100835syn region vimSynRegPat contained extend start="\z([-`~!@#$%^&*_=+;:'",./?]\)" skip=/\\\\\|\\\z1\|\n\s*\\\|\n\s*"\\ / end="\z1" contains=@vimSynRegPatGroup skipwhite nextgroup=vimSynPatMod,vimSynReg
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200836syn match vimSynPatMod contained "\%#=1\(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\([-+]\d\+\)\="
837syn match vimSynPatMod contained "\%#=1\(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\([-+]\d\+\)\=," nextgroup=vimSynPatMod
Bram Moolenaar5c736222010-01-06 20:54:52 +0100838syn match vimSynPatMod contained "lc=\d\+"
839syn match vimSynPatMod contained "lc=\d\+," nextgroup=vimSynPatMod
840syn region vimSynPatRange contained start="\[" skip="\\\\\|\\]" end="]"
841syn match vimSynNotPatRange contained "\\\\\|\\\["
842syn match vimMtchComment contained '"[^"]\+$'
Bram Moolenaar071d4272004-06-13 20:20:40 +0000843
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000844" Syntax: sync {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000845" ============
Bram Moolenaardf177f62005-02-22 08:39:57 +0000846syn keyword vimSynType contained sync skipwhite nextgroup=vimSyncC,vimSyncLines,vimSyncMatch,vimSyncError,vimSyncLinebreak,vimSyncLinecont,vimSyncRegion
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100847if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsyncerror")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100848 syn match vimSyncError contained "\i\+"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000849endif
Bram Moolenaar5c736222010-01-06 20:54:52 +0100850syn keyword vimSyncC contained ccomment clear fromstart
851syn keyword vimSyncMatch contained match skipwhite nextgroup=vimSyncGroupName
852syn keyword vimSyncRegion contained region skipwhite nextgroup=vimSynReg
853syn match vimSyncLinebreak contained "\<linebreaks=" skipwhite nextgroup=vimNumber
854syn keyword vimSyncLinecont contained linecont skipwhite nextgroup=vimSynRegPat
855syn match vimSyncLines contained "\(min\|max\)\=lines=" nextgroup=vimNumber
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100856syn match vimSyncGroupName contained "\h\w*" skipwhite nextgroup=vimSyncKey
Bram Moolenaar5c736222010-01-06 20:54:52 +0100857syn match vimSyncKey contained "\<groupthere\|grouphere\>" skipwhite nextgroup=vimSyncGroup
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100858syn match vimSyncGroup contained "\h\w*" skipwhite nextgroup=vimSynRegPat,vimSyncNone
Bram Moolenaar5c736222010-01-06 20:54:52 +0100859syn keyword vimSyncNone contained NONE
Bram Moolenaar071d4272004-06-13 20:20:40 +0000860
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100861" Additional IsCommand: here by reasons of precedence {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000862" ====================
Bram Moolenaar5c736222010-01-06 20:54:52 +0100863syn match vimIsCommand "<Bar>\s*\a\+" transparent contains=vimCommand,vimNotation
Bram Moolenaar071d4272004-06-13 20:20:40 +0000864
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100865" Highlighting: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000866" ============
dkearns04e53632024-04-11 06:18:37 +1000867syn cluster vimHighlightCluster contains=vimHiLink,vimHiClear,vimHiKeyList,@vimComment
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100868if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimhictermerror")
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200869 syn match vimHiCtermError contained "\D\i*"
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100870endif
Bram Moolenaar5c736222010-01-06 20:54:52 +0100871syn match vimHighlight "\<hi\%[ghlight]\>" skipwhite nextgroup=vimHiBang,@vimHighlightCluster
dkearns9530fe42024-03-19 05:19:51 +1100872syn match vimHiBang contained "\a\@1<=!" skipwhite nextgroup=@vimHighlightCluster
Bram Moolenaard960d762011-09-21 19:22:10 +0200873
Bram Moolenaar5c736222010-01-06 20:54:52 +0100874syn match vimHiGroup contained "\i\+"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000875syn case ignore
dkearnsb614b282024-02-12 03:13:34 +1100876syn keyword vimHiAttrib contained none bold inverse italic nocombine reverse standout strikethrough underline undercurl underdashed underdotted underdouble
Bram Moolenaar5c736222010-01-06 20:54:52 +0100877syn keyword vimFgBgAttrib contained none bg background fg foreground
Bram Moolenaar071d4272004-06-13 20:20:40 +0000878syn case match
Bram Moolenaar5c736222010-01-06 20:54:52 +0100879syn match vimHiAttribList contained "\i\+" contains=vimHiAttrib
880syn match vimHiAttribList contained "\i\+,"he=e-1 contains=vimHiAttrib nextgroup=vimHiAttribList
Bram Moolenaar071d4272004-06-13 20:20:40 +0000881syn case ignore
Bram Moolenaard2ea7cf2021-05-30 20:54:13 +0200882syn 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 +0100883syn match vimHiCtermColor contained "\<color\d\{1,3}\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000884
885syn case match
Bram Moolenaar5c736222010-01-06 20:54:52 +0100886syn match vimHiFontname contained "[a-zA-Z\-*]\+"
887syn match vimHiGuiFontname contained "'[a-zA-Z\-* ]\+'"
888syn match vimHiGuiRgb contained "#\x\{6}"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000889
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000890" Highlighting: hi group key=arg ... {{{2
dkearnsb614b282024-02-12 03:13:34 +1100891syn cluster vimHiCluster contains=vimGroup,vimHiGroup,vimHiTerm,vimHiCTerm,vimHiStartStop,vimHiCtermFgBg,vimHiCtermul,vimHiCtermfont,vimHiGui,vimHiGuiFont,vimHiGuiFgBg,vimHiKeyError,vimNotation,vimComment,vim9comment
dkearns9530fe42024-03-19 05:19:51 +1100892syn 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 +0100893if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_vimhikeyerror")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100894 syn match vimHiKeyError contained "\i\+="he=e-1
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000895endif
Bram Moolenaar5c736222010-01-06 20:54:52 +0100896syn match vimHiTerm contained "\cterm="he=e-1 nextgroup=vimHiAttribList
dkearns9530fe42024-03-19 05:19:51 +1100897syn match vimHiStartStop contained "\c\%(start\|stop\)="he=e-1 nextgroup=vimHiTermcap,vimOption
Bram Moolenaar5c736222010-01-06 20:54:52 +0100898syn match vimHiCTerm contained "\ccterm="he=e-1 nextgroup=vimHiAttribList
Bram Moolenaar83d1b192015-04-13 14:22:40 +0200899syn match vimHiCtermFgBg contained "\ccterm[fb]g="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
Bram Moolenaar2547aa92020-07-26 17:00:44 +0200900syn match vimHiCtermul contained "\cctermul="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
PMuncha606f3a2023-11-15 15:35:49 +0100901syn match vimHiCtermfont contained "\cctermfont="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
Bram Moolenaar5c736222010-01-06 20:54:52 +0100902syn match vimHiGui contained "\cgui="he=e-1 nextgroup=vimHiAttribList
903syn match vimHiGuiFont contained "\cfont="he=e-1 nextgroup=vimHiFontname
904syn match vimHiGuiFgBg contained "\cgui\%([fb]g\|sp\)="he=e-1 nextgroup=vimHiGroup,vimHiGuiFontname,vimHiGuiRgb,vimFgBgAttrib
905syn match vimHiTermcap contained "\S\+" contains=vimNotation
Bram Moolenaar83d1b192015-04-13 14:22:40 +0200906syn match vimHiNmbr contained '\d\+'
Bram Moolenaar071d4272004-06-13 20:20:40 +0000907
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000908" Highlight: clear {{{2
dkearns9530fe42024-03-19 05:19:51 +1100909syn keyword vimHiClear contained clear skipwhite nextgroup=vimGroup,vimHiGroup
Bram Moolenaar071d4272004-06-13 20:20:40 +0000910
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000911" Highlight: link {{{2
Bram Moolenaard2855f52018-07-31 22:23:58 +0200912" see tst24 (hi def vs hi) (Jul 06, 2018)
913"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 +1100914" TODO: simplify and allow line continuations --djk
915syn 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 +0000916
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100917" Control Characters: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000918" ==================
Bram Moolenaar5c736222010-01-06 20:54:52 +0100919syn match vimCtrlChar "[- -]"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000920
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000921" Beginners - Patterns that involve ^ {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000922" =========
Doug Kearns35699f12024-09-19 19:51:59 +0200923Vim9 syn region vim9LineComment start=+^[ \t:]*\zs#.*$+ skip=+\n\s*\\\|\n\s*#\\ + end="$" contains=@vimCommentGroup,vimCommentString,vim9CommentTitle extend
924VimL syn region vimLineComment start=+^[ \t:]*\zs".*$+ skip=+\n\s*\\\|\n\s*"\\ + end="$" contains=@vimCommentGroup,vimCommentString,vimCommentTitle extend
Doug Kearnsd65e58f2024-07-17 19:34:14 +0200925
Bram Moolenaar5c736222010-01-06 20:54:52 +0100926syn 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 +1000927syn 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 +1000928
dkearnsae321b52024-06-15 23:06:17 +1000929" allowed anywhere in the file
930if !s:vim9script
931 syn match vimShebangError "^\s*\zs#!.*" display
932endif
933syn match vimShebang "\%^#!.*" display
934
dkearns21ce1592024-01-29 04:54:08 +1100935syn match vimContinue "^\s*\zs\\"
dkearns059cbe82024-06-12 03:27:53 +1000936syn match vimContinueComment '^\s*\zs["#]\\ .*'
dkearns21ce1592024-01-29 04:54:08 +1100937syn cluster vimContinue contains=vimContinue,vimContinueComment
Bram Moolenaar5c736222010-01-06 20:54:52 +0100938syn region vimString start="^\s*\\\z(['"]\)" skip='\\\\\|\\\z1' end="\z1" oneline keepend contains=@vimStringGroup,vimContinue
939syn match vimCommentTitleLeader '"\s\+'ms=s+1 contained
dkearns04e53632024-04-11 06:18:37 +1000940syn match vim9CommentTitleLeader '#\s\+'ms=s+1 contained
Bram Moolenaar071d4272004-06-13 20:20:40 +0000941
Bram Moolenaar18144c82006-04-12 21:52:12 +0000942" Searches And Globals: {{{2
943" ====================
Bram Moolenaar5c736222010-01-06 20:54:52 +0100944syn match vimSearch '^\s*[/?].*' contains=vimSearchDelim
945syn match vimSearchDelim '^\s*\zs[/?]\|[/?]$' contained
dkearns2c51e152024-02-27 07:10:18 +1100946syn region vimGlobal matchgroup=Statement start='\<g\%[lobal]!\=/' skip='\\.' end='/' skipwhite nextgroup=vimSubst1
947syn region vimGlobal matchgroup=Statement start='\<v\%[global]!\=/' skip='\\.' end='/' skipwhite nextgroup=vimSubst1
Bram Moolenaare2f98b92006-03-29 21:18:24 +0000948
dkearns04e53632024-04-11 06:18:37 +1000949" Vim9 Script Regions: {{{2
950" ==================
951
952if s:vim9script
Doug Kearnsce064932024-04-13 18:24:01 +0200953 syn cluster vimLegacyTop contains=TOP,vim9LegacyHeader,vim9Comment,vim9LineComment
954 VimFoldH syn region vim9LegacyHeader start="\%^" end="^\ze\s*vim9s\%[cript]\>" contains=@vimLegacyTop,vimComment,vimLineComment
dkearns04e53632024-04-11 06:18:37 +1000955
Doug Kearnsce064932024-04-13 18:24:01 +0200956 syn keyword vim9Vim9ScriptArg noclear contained
957 syn keyword vim9Vim9Script vim9s[cript] nextgroup=vim9Vim9ScriptArg skipwhite
dkearns04e53632024-04-11 06:18:37 +1000958endif
959
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100960" Embedded Scripts: {{{2
961" ================
962" perl,ruby : Benoit Cerrina
963" python,tcl : Johannes Zellner
964" mzscheme, lua : Charles Campbell
Bram Moolenaar071d4272004-06-13 20:20:40 +0000965
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000966" Allows users to specify the type of embedded script highlighting
967" they want: (perl/python/ruby/tcl support)
968" g:vimsyn_embed == 0 : don't embed any scripts
Doug Kearnsfc64ac02024-06-22 11:20:36 +0200969" g:vimsyn_embed =~# 'l' : embed Lua (but only if vim supports it)
970" g:vimsyn_embed =~# 'm' : embed MzScheme (but only if vim supports it)
971" g:vimsyn_embed =~# 'p' : embed Perl (but only if vim supports it)
972" g:vimsyn_embed =~# 'P' : embed Python (but only if vim supports it)
973" g:vimsyn_embed =~# 'r' : embed Ruby (but only if vim supports it)
974" g:vimsyn_embed =~# 't' : embed Tcl (but only if vim supports it)
Bram Moolenaar7cba6c02013-09-05 22:13:31 +0200975if !exists("g:vimsyn_embed")
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100976 let g:vimsyn_embed= "lmpPr"
Bram Moolenaar7cba6c02013-09-05 22:13:31 +0200977endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000978
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +0200979" [-- lua --] {{{3
Bram Moolenaaradc21822011-04-01 18:03:16 +0200980let s:luapath= fnameescape(expand("<sfile>:p:h")."/lua.vim")
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +0200981if !filereadable(s:luapath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100982 for s:luapath in split(globpath(&rtp,"syntax/lua.vim"),"\n")
983 if filereadable(fnameescape(s:luapath))
984 let s:luapath= fnameescape(s:luapath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +0100985 break
986 endif
987 endfor
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +0200988endif
Bram Moolenaarf3913272016-02-25 00:00:01 +0100989if (g:vimsyn_embed =~# 'l' && has("lua")) && filereadable(s:luapath)
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +0200990 unlet! b:current_syntax
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200991 syn cluster vimFuncBodyList add=vimLuaRegion
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +0200992 exe "syn include @vimLuaScript ".s:luapath
Ken Takata95e90782024-08-22 21:29:39 +0200993 VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+^\z(\s*\)lua\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ contains=@vimLuaScript
994 VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+lua\s*<<\s*\z(\S*\)+ end=+^\z1$+ contains=@vimLuaScript
995 VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+^\z(\s*\)lua\s*<<\s*trim\s*$+ end=+^\z1\.$+ contains=@vimLuaScript
996 VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+lua\s*<<\s*$+ end=+^\.$+ contains=@vimLuaScript
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +0200997 syn cluster vimFuncBodyList add=vimLuaRegion
998else
Ken Takata95e90782024-08-22 21:29:39 +0200999 syn region vimEmbedError start=+^\z(\s*\)lua\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+
1000 syn region vimEmbedError start=+lua\s*<<\s*\z(\S*\)+ end=+^\z1$+
1001 syn region vimEmbedError start=+^\z(\s*\)lua\s*<<\s*trim\s\*$+ end=+^\z1\.$+
1002 syn region vimEmbedError start=+lua\s*<<\s*$+ end=+^\.$+
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +02001003endif
1004unlet s:luapath
1005
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001006" [-- perl --] {{{3
Bram Moolenaaradc21822011-04-01 18:03:16 +02001007let s:perlpath= fnameescape(expand("<sfile>:p:h")."/perl.vim")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001008if !filereadable(s:perlpath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001009 for s:perlpath in split(globpath(&rtp,"syntax/perl.vim"),"\n")
1010 if filereadable(fnameescape(s:perlpath))
1011 let s:perlpath= fnameescape(s:perlpath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +01001012 break
1013 endif
1014 endfor
Bram Moolenaar5c736222010-01-06 20:54:52 +01001015endif
Bram Moolenaarf3913272016-02-25 00:00:01 +01001016if (g:vimsyn_embed =~# 'p' && has("perl")) && filereadable(s:perlpath)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001017 unlet! b:current_syntax
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001018 syn cluster vimFuncBodyList add=vimPerlRegion
Bram Moolenaar5c736222010-01-06 20:54:52 +01001019 exe "syn include @vimPerlScript ".s:perlpath
Ken Takata95e90782024-08-22 21:29:39 +02001020 VimFoldp syn region vimPerlRegion matchgroup=vimScriptDelim start=+^\z(\s*\)pe\%[rl]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ contains=@vimPerlScript
1021 VimFoldp syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*\z(\S*\)+ end=+^\z1$+ contains=@vimPerlScript
1022 VimFoldp syn region vimPerlRegion matchgroup=vimScriptDelim start=+^\z(\s*\)pe\%[rl]\s*<<\s*trim\s*$+ end=+^\z1\.$+ contains=@vimPerlScript
1023 VimFoldp syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*$+ end=+\.$+ contains=@vimPerlScript
Bram Moolenaar5c736222010-01-06 20:54:52 +01001024 syn cluster vimFuncBodyList add=vimPerlRegion
Bram Moolenaarc236c162008-07-13 17:41:49 +00001025else
Ken Takata95e90782024-08-22 21:29:39 +02001026 syn region vimEmbedError start=+^\z(\s*\)pe\%[rl]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+
1027 syn region vimEmbedError start=+pe\%[rl]\s*<<\s*\z(\S*\)+ end=+^\z1$+
1028 syn region vimEmbedError start=+^\z(\s*\)pe\%[rl]\s*<<\s*trim\s\*$+ end=+^\z1\.$+
1029 syn region vimEmbedError start=+pe\%[rl]\s*<<\s*$+ end=+^\.$+
Bram Moolenaar071d4272004-06-13 20:20:40 +00001030endif
Bram Moolenaar5c736222010-01-06 20:54:52 +01001031unlet s:perlpath
Bram Moolenaar071d4272004-06-13 20:20:40 +00001032
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001033" [-- ruby --] {{{3
Bram Moolenaaradc21822011-04-01 18:03:16 +02001034let s:rubypath= fnameescape(expand("<sfile>:p:h")."/ruby.vim")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001035if !filereadable(s:rubypath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001036 for s:rubypath in split(globpath(&rtp,"syntax/ruby.vim"),"\n")
1037 if filereadable(fnameescape(s:rubypath))
1038 let s:rubypath= fnameescape(s:rubypath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +01001039 break
1040 endif
1041 endfor
Bram Moolenaar5c736222010-01-06 20:54:52 +01001042endif
Bram Moolenaarf3913272016-02-25 00:00:01 +01001043if (g:vimsyn_embed =~# 'r' && has("ruby")) && filereadable(s:rubypath)
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001044 syn cluster vimFuncBodyList add=vimRubyRegion
Bram Moolenaar071d4272004-06-13 20:20:40 +00001045 unlet! b:current_syntax
Bram Moolenaar5c736222010-01-06 20:54:52 +01001046 exe "syn include @vimRubyScript ".s:rubypath
Ken Takata95e90782024-08-22 21:29:39 +02001047 VimFoldr syn region vimRubyRegion matchgroup=vimScriptDelim start=+^\z(\s*\)rub\%[y]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ contains=@vimRubyScript
1048 VimFoldr syn region vimRubyRegion matchgroup=vimScriptDelim start=+rub\%[y]\s*<<\s*\z(\S*\)+ end=+^\z1$+ contains=@vimRubyScript
1049 VimFoldr syn region vimRubyRegion matchgroup=vimScriptDelim start=+^\z(\s*\)rub\%[y]\s*<<\s*trim\s*$+ end=+^\z1\.$+ contains=@vimRubyScript
1050 VimFoldr syn region vimRubyRegion matchgroup=vimScriptDelim start=+rub\%[y]\s*<<\s*$+ end=+\.$+ contains=@vimRubyScript
Bram Moolenaar5c736222010-01-06 20:54:52 +01001051 syn cluster vimFuncBodyList add=vimRubyRegion
Bram Moolenaarc236c162008-07-13 17:41:49 +00001052else
Ken Takata95e90782024-08-22 21:29:39 +02001053 syn region vimEmbedError start=+^\z(\s*\)rub\%[y]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+
1054 syn region vimEmbedError start=+rub\%[y]\s*<<\s*\z(\S.*\)+ end=+^\z1$+
1055 syn region vimEmbedError start=+^\z(\s*\)rub\%[y]\s*<<\s*trim\s\*$+ end=+^\z1\.$+
1056 syn region vimEmbedError start=+rub\%[y]\s*<<\s*$+ end=+^\.$+
Bram Moolenaar071d4272004-06-13 20:20:40 +00001057endif
Bram Moolenaar5c736222010-01-06 20:54:52 +01001058unlet s:rubypath
Bram Moolenaar071d4272004-06-13 20:20:40 +00001059
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001060" [-- python --] {{{3
Bram Moolenaaradc21822011-04-01 18:03:16 +02001061let s:pythonpath= fnameescape(expand("<sfile>:p:h")."/python.vim")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001062if !filereadable(s:pythonpath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001063 for s:pythonpath in split(globpath(&rtp,"syntax/python.vim"),"\n")
1064 if filereadable(fnameescape(s:pythonpath))
1065 let s:pythonpath= fnameescape(s:pythonpath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +01001066 break
1067 endif
1068 endfor
Bram Moolenaar5c736222010-01-06 20:54:52 +01001069endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001070if g:vimsyn_embed =~# 'P' && has("pythonx") && filereadable(s:pythonpath)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001071 unlet! b:current_syntax
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001072 syn cluster vimFuncBodyList add=vimPythonRegion
Bram Moolenaar5c736222010-01-06 20:54:52 +01001073 exe "syn include @vimPythonScript ".s:pythonpath
Ken Takata95e90782024-08-22 21:29:39 +02001074 VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+^\z(\s*\)py\%[thon][3x]\=\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ contains=@vimPythonScript
1075 VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon][3x]\=\s*<<\s*\z(\S\+\)+ end=+^\z1$+ contains=@vimPythonScript
1076 VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+^\z(\s*\)py\%[thon][3x]\=\s*<<\s*trim\s*$+ end=+^\z1\.$+ contains=@vimPythonScript
1077 VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon][3x]\=\s*<<\s*$+ end=+^\.$+ contains=@vimPythonScript
1078 VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+Py\%[thon]2or3\s*<<\s*\%(trim\s*\)\=\z(\S\+\)+ end=+^\z1$+ contains=@vimPythonScript
1079 VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+Py\%[thon]2or3\s*<<\s*\%(trim\s*\)\=$+ end=+^\.$+ contains=@vimPythonScript
Bram Moolenaar5c736222010-01-06 20:54:52 +01001080 syn cluster vimFuncBodyList add=vimPythonRegion
Bram Moolenaarc236c162008-07-13 17:41:49 +00001081else
Ken Takata95e90782024-08-22 21:29:39 +02001082 syn region vimEmbedError start=+^\z(\s*\)py\%[thon][3x]\=\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+
1083 syn region vimEmbedError start=+py\%[thon][3x]\=\s*<<\s*\z(\S\+\)+ end=+^\z1$+
1084 syn region vimEmbedError start=+^\z(\s*\)py\%[thon][3x]\=\s*<<\s*trim\s*$+ end=+^\z1\.$+
1085 syn region vimEmbedError start=+py\%[thon][3x]\=\s*<<\s*$+ end=+^\.$+
Bram Moolenaar071d4272004-06-13 20:20:40 +00001086endif
Bram Moolenaar5c736222010-01-06 20:54:52 +01001087unlet s:pythonpath
Bram Moolenaar071d4272004-06-13 20:20:40 +00001088
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001089" [-- tcl --] {{{3
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001090if has("win32") || has("win95") || has("win64") || has("win16")
1091 " apparently has("tcl") has been hanging vim on some windows systems with cygwin
1092 let s:trytcl= (&shell !~ '\<\%(bash\>\|4[nN][tT]\|\<zsh\)\>\%(\.exe\)\=$')
1093else
1094 let s:trytcl= 1
1095endif
Bram Moolenaara6878372014-03-22 21:02:50 +01001096if s:trytcl
1097 let s:tclpath= fnameescape(expand("<sfile>:p:h")."/tcl.vim")
1098 if !filereadable(s:tclpath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001099 for s:tclpath in split(globpath(&rtp,"syntax/tcl.vim"),"\n")
1100 if filereadable(fnameescape(s:tclpath))
1101 let s:tclpath= fnameescape(s:tclpath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +01001102 break
1103 endif
1104 endfor
Bram Moolenaar5c736222010-01-06 20:54:52 +01001105 endif
Bram Moolenaarf3913272016-02-25 00:00:01 +01001106 if (g:vimsyn_embed =~# 't' && has("tcl")) && filereadable(s:tclpath)
Bram Moolenaara6878372014-03-22 21:02:50 +01001107 unlet! b:current_syntax
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001108 syn cluster vimFuncBodyList add=vimTclRegion
Bram Moolenaara6878372014-03-22 21:02:50 +01001109 exe "syn include @vimTclScript ".s:tclpath
Ken Takata95e90782024-08-22 21:29:39 +02001110 VimFoldt syn region vimTclRegion matchgroup=vimScriptDelim start=+^\z(\s*\)tc\%[l]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ contains=@vimTclScript
1111 VimFoldt syn region vimTclRegion matchgroup=vimScriptDelim start=+tc\%[l]\=\s*<<\s*\z(\S*\)+ end=+^\z1$+ contains=@vimTclScript
1112 VimFoldt syn region vimTclRegion matchgroup=vimScriptDelim start=+^\z(\s*\)tc\%[l]\s*<<\s*trim\s*$+ end=+^\z1\.$+ contains=@vimTclScript
1113 VimFoldt syn region vimTclRegion matchgroup=vimScriptDelim start=+tc\%[l]\=\s*<<\s*$+ end=+^\.$+ contains=@vimTclScript
Bram Moolenaara6878372014-03-22 21:02:50 +01001114 syn cluster vimFuncBodyList add=vimTclScript
1115 else
Ken Takata95e90782024-08-22 21:29:39 +02001116 syn region vimEmbedError start=+^\z(\s*\)tc\%[l]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+
1117 syn region vimEmbedError start=+tc\%[l]\=\s*<<\s*\z(\S*\)+ end=+^\z1$+
1118 syn region vimEmbedError start=+^\z(\s*\)tc\%[l]\s*<<\s*trim\s\*$+ end=+^\z1\.$+
1119 syn region vimEmbedError start=+tc\%[l]\=\s*<<\s*$+ end=+^\.$+
Bram Moolenaara6878372014-03-22 21:02:50 +01001120 endif
1121 unlet s:tclpath
Bram Moolenaarc236c162008-07-13 17:41:49 +00001122else
Ken Takata95e90782024-08-22 21:29:39 +02001123 syn region vimEmbedError start=+^\z(\s*\)tc\%[l]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+
1124 syn region vimEmbedError start=+tc\%[l]\=\s*<<\s*\z(\S*\)+ end=+^\z1$+
1125 syn region vimEmbedError start=+^\z(\s*\)tc\%[l]\s*<<\s*trim\s\*$+ end=+^\z1\.$+
1126 syn region vimEmbedError start=+tc\%[l]\=\s*<<\s*$+ end=+^\.$+
Bram Moolenaar9964e462007-05-05 17:54:07 +00001127endif
Bram Moolenaara6878372014-03-22 21:02:50 +01001128unlet s:trytcl
Bram Moolenaar071d4272004-06-13 20:20:40 +00001129
Bram Moolenaar8299df92004-07-10 09:47:34 +00001130" [-- mzscheme --] {{{3
Bram Moolenaaradc21822011-04-01 18:03:16 +02001131let s:mzschemepath= fnameescape(expand("<sfile>:p:h")."/scheme.vim")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001132if !filereadable(s:mzschemepath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001133 for s:mzschemepath in split(globpath(&rtp,"syntax/mzscheme.vim"),"\n")
1134 if filereadable(fnameescape(s:mzschemepath))
1135 let s:mzschemepath= fnameescape(s:mzschemepath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +01001136 break
1137 endif
1138 endfor
Bram Moolenaar5c736222010-01-06 20:54:52 +01001139endif
Bram Moolenaarf3913272016-02-25 00:00:01 +01001140if (g:vimsyn_embed =~# 'm' && has("mzscheme")) && filereadable(s:mzschemepath)
Bram Moolenaar8299df92004-07-10 09:47:34 +00001141 unlet! b:current_syntax
Bram Moolenaar03413f42016-04-12 21:07:15 +02001142 let s:iskKeep= &isk
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001143 syn cluster vimFuncBodyList add=vimMzSchemeRegion
Bram Moolenaar5c736222010-01-06 20:54:52 +01001144 exe "syn include @vimMzSchemeScript ".s:mzschemepath
Bram Moolenaar03413f42016-04-12 21:07:15 +02001145 let &isk= s:iskKeep
1146 unlet s:iskKeep
Ken Takata95e90782024-08-22 21:29:39 +02001147 VimFoldm syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+^\z(\s*\)mz\%[scheme]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ contains=@vimMzSchemeScript
1148 VimFoldm syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*\z(\S*\)+ end=+^\z1$+ contains=@vimMzSchemeScript
1149 VimFoldm syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+^\z(\s*\)mz\%[scheme]\s*<<\s*trim\s*$+ end=+^\z1\.$+ contains=@vimMzSchemeScript
1150 VimFoldm syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*$+ end=+^\.$+ contains=@vimMzSchemeScript
Bram Moolenaar5c736222010-01-06 20:54:52 +01001151 syn cluster vimFuncBodyList add=vimMzSchemeRegion
Bram Moolenaarc236c162008-07-13 17:41:49 +00001152else
Ken Takata95e90782024-08-22 21:29:39 +02001153 syn region vimEmbedError start=+^\z(\s*\)mz\%[scheme]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+
1154 syn region vimEmbedError start=+mz\%[scheme]\s*<<\s*\z(\S*\)+ end=+^\z1$+
1155 syn region vimEmbedError start=+^\z(\s*\)mz\%[scheme]\s*<<\s*trim\s\*$+ end=+^\z1\.$+
1156 syn region vimEmbedError start=+mz\%[scheme]\s*<<\s*$+ end=+^\.$+
Bram Moolenaar8299df92004-07-10 09:47:34 +00001157endif
Bram Moolenaar5c736222010-01-06 20:54:52 +01001158unlet s:mzschemepath
Bram Moolenaar8299df92004-07-10 09:47:34 +00001159
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001160" Synchronize (speed) {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001161"============
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00001162if exists("g:vimsyn_minlines")
1163 exe "syn sync minlines=".g:vimsyn_minlines
Bram Moolenaar071d4272004-06-13 20:20:40 +00001164endif
Bram Moolenaar03413f42016-04-12 21:07:15 +02001165exe "syn sync maxlines=".s:vimsyn_maxlines
Bram Moolenaar071d4272004-06-13 20:20:40 +00001166syn sync linecont "^\s\+\\"
dkearns62b26042024-03-10 03:43:28 +11001167syn sync linebreaks=1
Bram Moolenaar071d4272004-06-13 20:20:40 +00001168syn sync match vimAugroupSyncA groupthere NONE "\<aug\%[roup]\>\s\+[eE][nN][dD]"
1169
Bram Moolenaar5c736222010-01-06 20:54:52 +01001170" ====================
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001171" Highlighting Settings {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001172" ====================
1173
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001174if !exists("skip_vim_syntax_inits")
1175 if !exists("g:vimsyn_noerror")
1176 hi def link vimBehaveError vimError
1177 hi def link vimCollClassErr vimError
1178 hi def link vimErrSetting vimError
1179 hi def link vimEmbedError vimError
1180 hi def link vimFTError vimError
1181 hi def link vimFunctionError vimError
1182 hi def link vimFunc vimError
1183 hi def link vimHiAttribList vimError
1184 hi def link vimHiCtermError vimError
1185 hi def link vimHiKeyError vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001186 hi def link vimMapModErr vimError
dkearnsae321b52024-06-15 23:06:17 +10001187 hi def link vimShebangError vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001188 hi def link vimSubstFlagErr vimError
1189 hi def link vimSynCaseError vimError
Brad Kingd4634a22024-01-03 10:17:24 -05001190 hi def link vimSynFoldMethodError vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001191 hi def link vimBufnrWarn vimWarn
1192 endif
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001193
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001194 hi def link vimAbb vimCommand
1195 hi def link vimAddress vimMark
dkearnsc4aef9a2024-03-04 02:42:47 +11001196 hi def link vimAugroupBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001197 hi def link vimAugroupError vimError
1198 hi def link vimAugroupKey vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001199 hi def link vimAutoCmd vimCommand
1200 hi def link vimAutoEvent Type
Bram Moolenaard58a3bf2020-09-28 21:48:16 +02001201 hi def link vimAutoCmdMod Special
dkearnsb614b282024-02-12 03:13:34 +11001202 hi def link vimBang vimOper
dkearns2c51e152024-02-27 07:10:18 +11001203 hi def link vimBehaveBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001204 hi def link vimBehaveModel vimBehave
1205 hi def link vimBehave vimCommand
1206 hi def link vimBracket Delimiter
Doug Kearns99984fc2024-07-18 20:45:19 +02001207 hi def link vimCall vimCommand
dkearnsa3bddb72024-06-14 01:48:10 +10001208 hi def link vimCatch vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001209 hi def link vimCmplxRepeat SpecialChar
1210 hi def link vimCommand Statement
1211 hi def link vimComment Comment
Doug Kearnsfc64ac02024-06-22 11:20:36 +02001212 hi def link vimCommentError vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001213 hi def link vimCommentString vimString
1214 hi def link vimCommentTitle PreProc
1215 hi def link vimCondHL vimCommand
dkearnsf6869212023-12-11 01:53:24 +11001216 hi def link vimConst vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001217 hi def link vimContinue Special
dkearns21ce1592024-01-29 04:54:08 +11001218 hi def link vimContinueComment vimComment
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001219 hi def link vimCtrlChar SpecialChar
Doug Kearnsfc64ac02024-06-22 11:20:36 +02001220 hi def link vimDefComment vim9Comment
dkearns35e6f4c2024-03-22 06:41:10 +11001221 hi def link vimDefKey vimCommand
1222 hi def link vimDefParam vimVar
Doug Kearns3c07eb02024-09-02 10:03:37 +02001223 hi def link vimDelcommand vimCommand
1224 hi def link vimDelcommandAttr vimUserCmdAttr
dkearnsb1427b42024-02-28 05:59:30 +11001225 hi def link vimEcho vimCommand
dkearns61887b32024-03-15 23:45:48 +11001226 hi def link vimEchohlNone vimGroup
1227 hi def link vimEchohl vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001228 hi def link vimElseIfErr Error
dkearns35e6f4c2024-03-22 06:41:10 +11001229 hi def link vimEndfunction vimCommand
1230 hi def link vimEnddef vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001231 hi def link vimEnvvar PreProc
1232 hi def link vimError Error
Bram Moolenaar6ba83ba2022-06-12 22:15:57 +01001233 hi def link vimEscape Special
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001234 hi def link vimFBVar vimVar
1235 hi def link vimFgBgAttrib vimHiAttrib
Bram Moolenaarcbaff5e2022-04-08 17:45:08 +01001236 hi def link vimFuncEcho vimCommand
dkearns1c97b5c2023-12-13 02:47:43 +11001237 hi def link vimFor vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001238 hi def link vimFTCmd vimCommand
1239 hi def link vimFTOption vimSynType
dkearns35e6f4c2024-03-22 06:41:10 +11001240 hi def link vimFuncBang vimBang
1241 hi def link vimFuncComment vimComment
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001242 hi def link vimFuncKey vimCommand
1243 hi def link vimFuncName Function
dkearns35e6f4c2024-03-22 06:41:10 +11001244 hi def link vimFuncMod Special
1245 hi def link vimFuncParam vimVar
1246 hi def link vimFuncParamEquals vimOper
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001247 hi def link vimFuncSID Special
1248 hi def link vimFuncVar Identifier
1249 hi def link vimGroupAdd vimSynOption
1250 hi def link vimGroupName vimGroup
1251 hi def link vimGroupRem vimSynOption
1252 hi def link vimGroupSpecial Special
1253 hi def link vimGroup Type
1254 hi def link vimHiAttrib PreProc
dkearnsb614b282024-02-12 03:13:34 +11001255 hi def link vimHiBang vimBang
dkearns9530fe42024-03-19 05:19:51 +11001256 hi def link vimHiClear Type
1257 hi def link vimHiCtermColor Constant
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001258 hi def link vimHiCtermFgBg vimHiTerm
dkearns9530fe42024-03-19 05:19:51 +11001259 hi def link vimHiCtermfont vimHiTerm
1260 hi def link vimHiCtermul vimHiTerm
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001261 hi def link vimHiCTerm vimHiTerm
1262 hi def link vimHighlight vimCommand
1263 hi def link vimHiGroup vimGroupName
1264 hi def link vimHiGuiFgBg vimHiTerm
1265 hi def link vimHiGuiFont vimHiTerm
1266 hi def link vimHiGuiRgb vimNumber
1267 hi def link vimHiGui vimHiTerm
1268 hi def link vimHiNmbr Number
1269 hi def link vimHiStartStop vimHiTerm
1270 hi def link vimHiTerm Type
1271 hi def link vimHLGroup vimGroup
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001272 hi def link vimInsert vimString
1273 hi def link vimIskSep Delimiter
dkearns04e53632024-04-11 06:18:37 +10001274 hi def link vim9KeymapLineComment vimKeymapLineComment
dkearns69866442023-11-22 05:43:40 +11001275 hi def link vimKeymapLineComment vimComment
1276 hi def link vimKeymapTailComment vimComment
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001277 hi def link vimLet vimCommand
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001278 hi def link vimLetHereDoc vimString
1279 hi def link vimLetHereDocStart Special
1280 hi def link vimLetHereDocStop Special
dkearnsf6869212023-12-11 01:53:24 +11001281 hi def link vimLetRegister Special
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001282 hi def link vimLineComment vimComment
dkearnsb614b282024-02-12 03:13:34 +11001283 hi def link vimMapBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001284 hi def link vimMapModKey vimFuncSID
1285 hi def link vimMapMod vimBracket
1286 hi def link vimMap vimCommand
1287 hi def link vimMark Number
1288 hi def link vimMarkNumber vimNumber
Doug Kearnse85fdc72024-07-07 20:45:37 +02001289 hi def link vimMatch vimCommand
1290 hi def link vimMatchGroup vimGroup
1291 hi def link vimMatchNone vimGroup
dkearnsb614b282024-02-12 03:13:34 +11001292 hi def link vimMenuBang vimBang
dkearns62b26042024-03-10 03:43:28 +11001293 hi def link vimMenuClear Special
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001294 hi def link vimMenuMod vimMapMod
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001295 hi def link vimMenuName PreProc
dkearns62b26042024-03-10 03:43:28 +11001296 hi def link vimMenu vimCommand
1297 hi def link vimMenuNotation vimNotation
1298 hi def link vimMenuPriority Number
1299 hi def link vimMenuStatus Special
1300 hi def link vimMenutranslateComment vimComment
Aliaksei Budavei80aabaa2024-03-31 19:26:32 +03001301 hi def link vimMethodName vimFuncName
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001302 hi def link vimMtchComment vimComment
1303 hi def link vimNorm vimCommand
1304 hi def link vimNotation Special
1305 hi def link vimNotFunc vimCommand
1306 hi def link vimNotPatSep vimString
1307 hi def link vimNumber Number
1308 hi def link vimOperError Error
1309 hi def link vimOper Operator
1310 hi def link vimOption PreProc
1311 hi def link vimParenSep Delimiter
Bram Moolenaard2855f52018-07-31 22:23:58 +02001312 hi def link vimPatSepErr vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001313 hi def link vimPatSepR vimPatSep
1314 hi def link vimPatSep SpecialChar
1315 hi def link vimPatSepZone vimString
1316 hi def link vimPatSepZ vimPatSep
1317 hi def link vimPattern Type
1318 hi def link vimPlainMark vimMark
1319 hi def link vimPlainRegister vimRegister
1320 hi def link vimRegister SpecialChar
1321 hi def link vimScriptDelim Comment
1322 hi def link vimSearchDelim Statement
1323 hi def link vimSearch vimString
1324 hi def link vimSep Delimiter
Doug Kearnsddbb6fe2024-07-24 20:21:22 +02001325 hi def link vimSet vimCommand
1326 hi def link vimSetAll vimOption
1327 hi def link vimSetBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001328 hi def link vimSetMod vimOption
Doug Kearnsddbb6fe2024-07-24 20:21:22 +02001329 hi def link vimSetSep vimSep
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001330 hi def link vimSetString vimString
Doug Kearnsddbb6fe2024-07-24 20:21:22 +02001331 hi def link vimSetTermcap vimOption
dkearnsae321b52024-06-15 23:06:17 +10001332 hi def link vimShebang PreProc
Doug Kearns262e25e2024-06-14 20:16:35 +02001333 hi def link vimSleep vimCommand
1334 hi def link vimSleepArg Constant
1335 hi def link vimSleepBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001336 hi def link vimSpecFile Identifier
1337 hi def link vimSpecFileMod vimSpecFile
1338 hi def link vimSpecial Type
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001339 hi def link vimStringCont vimString
1340 hi def link vimString String
Bram Moolenaard2855f52018-07-31 22:23:58 +02001341 hi def link vimStringEnd vimString
thincacf8695d2024-01-28 18:57:23 +01001342 hi def link vimStringInterpolationBrace vimEscape
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001343 hi def link vimSubst1 vimSubst
1344 hi def link vimSubstDelim Delimiter
1345 hi def link vimSubstFlags Special
1346 hi def link vimSubstSubstr SpecialChar
1347 hi def link vimSubstTwoBS vimString
1348 hi def link vimSubst vimCommand
1349 hi def link vimSynCaseError Error
1350 hi def link vimSynCase Type
1351 hi def link vimSyncC Type
1352 hi def link vimSyncError Error
1353 hi def link vimSyncGroupName vimGroupName
1354 hi def link vimSyncGroup vimGroupName
1355 hi def link vimSyncKey Type
1356 hi def link vimSyncNone Type
1357 hi def link vimSynContains vimSynOption
1358 hi def link vimSynError Error
Brad Kingd4634a22024-01-03 10:17:24 -05001359 hi def link vimSynFoldMethodError Error
1360 hi def link vimSynFoldMethod Type
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001361 hi def link vimSynKeyContainedin vimSynContains
1362 hi def link vimSynKeyOpt vimSynOption
dkearnsc79646d2024-01-05 08:58:48 +11001363 hi def link vimSynCchar vimSynOption
1364 hi def link vimSynCcharValue Character
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001365 hi def link vimSynMtchGrp vimSynOption
1366 hi def link vimSynMtchOpt vimSynOption
1367 hi def link vimSynNextgroup vimSynOption
1368 hi def link vimSynNotPatRange vimSynRegPat
1369 hi def link vimSynOption Special
1370 hi def link vimSynPatRange vimString
1371 hi def link vimSynRegOpt vimSynOption
1372 hi def link vimSynRegPat vimString
1373 hi def link vimSynReg Type
1374 hi def link vimSyntax vimCommand
1375 hi def link vimSynType vimSpecial
dkearnsa3bddb72024-06-14 01:48:10 +10001376 hi def link vimThrow vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001377 hi def link vimTodo Todo
Bram Moolenaar4d8f4762021-06-27 15:18:56 +02001378 hi def link vimType Type
dkearnsf6869212023-12-11 01:53:24 +11001379 hi def link vimUnlet vimCommand
dkearnsb614b282024-02-12 03:13:34 +11001380 hi def link vimUnletBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001381 hi def link vimUnmap vimMap
Doug Kearns3c07eb02024-09-02 10:03:37 +02001382 hi def link vimUserCmdAttrAddr vimSpecial
1383 hi def link vimUserCmdAttrCmplt vimSpecial
1384 hi def link vimUserCmdAttrNargs vimSpecial
1385 hi def link vimUserCmdAttrRange vimSpecial
1386 hi def link vimUserCmdAttrKey vimUserCmdAttr
1387 hi def link vimUserCmdAttr Special
1388 hi def link vimUserCmdAttrError Error
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001389 hi def link vimUserCmdError Error
Doug Kearns3c07eb02024-09-02 10:03:37 +02001390 hi def link vimUserCmdKey vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001391 hi def link vimUserFunc Normal
1392 hi def link vimVar Identifier
1393 hi def link vimWarn WarningMsg
Doug Kearnsd65e58f2024-07-17 19:34:14 +02001394
1395 hi def link vim9Boolean Boolean
1396 hi def link vim9Comment Comment
1397 hi def link vim9CommentError vimError
1398 hi def link vim9CommentTitle PreProc
1399 hi def link vim9Const vimCommand
1400 hi def link vim9Final vimCommand
1401 hi def link vim9For vimCommand
1402 hi def link vim9LineComment vimComment
1403 hi def link vim9Null Constant
1404 hi def link vim9Var vimCommand
1405 hi def link vim9Variable vimVar
1406 hi def link vim9Vim9Script vimCommand
1407 hi def link vim9Vim9ScriptArg Special
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001408endif
Bram Moolenaar071d4272004-06-13 20:20:40 +00001409
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001410" Current Syntax Variable: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001411let b:current_syntax = "vim"
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001412
1413" ---------------------------------------------------------------------
1414" Cleanup: {{{1
Doug Kearnsd65e58f2024-07-17 19:34:14 +02001415delc Vim9
1416delc VimL
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001417delc VimFolda
1418delc VimFoldf
Doug Kearnsce064932024-04-13 18:24:01 +02001419delc VimFoldh
1420delc VimFoldH
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001421delc VimFoldl
1422delc VimFoldm
1423delc VimFoldp
1424delc VimFoldP
1425delc VimFoldr
1426delc VimFoldt
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001427let &cpo = s:keepcpo
dkearns04e53632024-04-11 06:18:37 +10001428unlet s:keepcpo s:vim9script
dkearns5d67aef2024-03-10 04:01:22 +11001429" vim:ts=18 fdm=marker ft=vim