blob: 17283a9fcfdd03fa06059d5a2c05fa0448c06db5 [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>
5" URL: https://github.com/vim-jp/syntax-vim-ex
Doug Kearns262e25e2024-06-14 20:16:35 +02006" Last Change: 2024 Jun 15
Christian Brabandtf9ca1392024-02-19 20:37:11 +01007" Former Maintainer: Charles E. Campbell
h-east9b53c052024-02-13 21:09:22 +01008
9" DO NOT CHANGE DIRECTLY.
10" THIS FILE PARTLY GENERATED BY gen_syntax_vim.vim.
11" (Search string "GEN_SYN_VIM:" in this file)
12
Bram Moolenaar071d4272004-06-13 20:20:40 +000013" Automatically generated keyword lists: {{{1
14
15" Quit when a syntax file was already loaded {{{2
16if exists("b:current_syntax")
17 finish
18endif
Bram Moolenaar113cb512021-11-07 20:27:04 +000019let s:keepcpo= &cpo
Bram Moolenaar6be7f872012-01-20 21:08:56 +010020set cpo&vim
Bram Moolenaar071d4272004-06-13 20:20:40 +000021
dkearns04e53632024-04-11 06:18:37 +100022let s:vim9script = "\n" .. getline(1, 32)->join("\n") =~# '\n\s*vim9\%[script]\>'
23
Bram Moolenaar071d4272004-06-13 20:20:40 +000024" vimTodo: contains common special-notices for comments {{{2
25" Use the vimCommentGroup cluster to add your own.
Bram Moolenaare2719092015-01-10 15:09:25 +010026syn keyword vimTodo contained COMBAK FIXME TODO XXX
Bram Moolenaar217ad922005-03-20 22:37:15 +000027syn cluster vimCommentGroup contains=vimTodo,@Spell
Bram Moolenaar071d4272004-06-13 20:20:40 +000028
29" regular vim commands {{{2
h-east9b53c052024-02-13 21:09:22 +010030" GEN_SYN_VIM: vimCommand normal, START_STR='syn keyword vimCommand contained', END_STR=''
dkearnsa3bddb72024-06-14 01:48:10 +100031syn 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] cal[l] 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]
32syn 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] delc[ommand] 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] elsei[f] 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] fina[l] finall[y] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] foldd[oopen] folddoc[losed] foldo[pen] for g[lobal] go[to] gr[ep] grepa[dd] gu[i] gv[im] h[elp] helpc[lose] helpf[ind] helpg[rep]
33syn keyword vimCommand contained helpt[ags] ha[rdcopy] hi[ghlight] hid[e] his[tory] ho[rizontal] if 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] let 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] loadk[eymap] 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]
34syn keyword vimCommand contained ma[rk] mak[e] marks mat[ch] menut[ranslate] mes[sages] mk[exrc] mks[ession] mksp[ell] mkv[imrc] mkvie[w] mod[e] mz[scheme] mzf[ile] n[ext] nb[key] nbc[lose] nbs[tart] noa[utocmd] noh[lsearch] nos[wapfile] nu[mber] o[pen] ol[dfiles] 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] retu[rn]
Doug Kearns262e25e2024-06-14 20:16:35 +020035syn keyword vimCommand contained rew[ind] ri[ght] rightb[elow] ru[ntime] rub[y] rubyd[o] rubyf[ile] rund[o] rv[iminfo] sN[ext] sa[rgument] sal[l] san[dbox] sav[eas] sb[uffer] sbN[ext] sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbp[revious] sbr[ewind] 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]
dkearnsa3bddb72024-06-14 01:48:10 +100036syn keyword vimCommand contained tabm[ove] tabl[ast] tabn[ext] tabnew tabo[nly] tabp[revious] tabN[ext] tabr[ewind] tabs tc[d] tch[dir] tcl tcld[o] tclf[ile] te[aroff] ter[minal] tf[irst] 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] unl[et] 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] wh[ile] 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 +010037
38syn keyword vimCommand contained 2mat[ch] 3mat[ch]
39
Aliaksei Budaveidfcef892024-02-18 21:02:14 +030040" Lower priority for _new_ to distinguish constructors from the command.
41syn match vimCommand contained "\<new\>(\@!"
Bram Moolenaare2719092015-01-10 15:09:25 +010042syn match vimCommand contained "\<z[-+^.=]\=\>"
h-east9b53c052024-02-13 21:09:22 +010043syn 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 +000044
45" vimOptions are caught only when contained in a vimSet {{{2
h-east9b53c052024-02-13 21:09:22 +010046" GEN_SYN_VIM: vimOption normal, START_STR='syn keyword vimOption contained', END_STR=''
47syn 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
48syn 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
49syn 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
50syn 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
51syn 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
52syn 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
53syn 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 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 udir undodir
dkearns691aee82024-03-04 05:02:47 +110054syn keyword vimOption contained 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
Bram Moolenaar071d4272004-06-13 20:20:40 +000055
56" vimOptions: These are the turn-off setting variants {{{2
h-east9b53c052024-02-13 21:09:22 +010057" GEN_SYN_VIM: vimOption turn-off, START_STR='syn keyword vimOption contained', END_STR=''
58syn 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
59syn 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 +110060syn 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
61syn keyword vimOption contained nowb nowritebackup noxtermcodes
Bram Moolenaar071d4272004-06-13 20:20:40 +000062
63" vimOptions: These are the invertible variants {{{2
h-east9b53c052024-02-13 21:09:22 +010064" GEN_SYN_VIM: vimOption invertible, START_STR='syn keyword vimOption contained', END_STR=''
65syn 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
66syn 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
67syn 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 +110068syn 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 +000069
70" termcap codes (which can also be set) {{{2
h-east9b53c052024-02-13 21:09:22 +010071" GEN_SYN_VIM: vimOption term output code, START_STR='syn keyword vimOption contained', END_STR=''
Christian Brabandt393708c2024-05-27 15:50:07 +020072syn 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
h-east9b53c052024-02-13 21:09:22 +010073" term key codes
74syn 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 +010075syn match vimOption contained "t_%1"
Bram Moolenaar071d4272004-06-13 20:20:40 +000076syn match vimOption contained "t_#2"
77syn match vimOption contained "t_#4"
Bram Moolenaar6d5ad4c2016-10-27 17:00:16 +020078syn match vimOption contained "t_@7"
Bram Moolenaarb0d45e72017-11-05 18:19:24 +010079syn match vimOption contained "t_*7"
80syn match vimOption contained "t_&8"
81syn match vimOption contained "t_%i"
Bram Moolenaar071d4272004-06-13 20:20:40 +000082syn match vimOption contained "t_k;"
83
Bram Moolenaar03413f42016-04-12 21:07:15 +020084" unsupported settings: some were supported by vi but don't do anything in vim {{{2
h-east9b53c052024-02-13 21:09:22 +010085" GEN_SYN_VIM: Missing vimOption, START_STR='syn keyword vimErrSetting contained', END_STR=''
86syn 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
87syn 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
88syn 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 +000089
Bram Moolenaar80a94a52006-02-23 21:26:58 +000090" AutoCmd Events {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +000091syn case ignore
h-east9b53c052024-02-13 21:09:22 +010092" GEN_SYN_VIM: vimAutoEvent, START_STR='syn keyword vimAutoEvent contained', END_STR=''
Doug Kearnsa44ced52024-04-07 17:47:15 +020093syn 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 CursorMovedI DiffUpdated DirChanged DirChangedPre EncodingChanged ExitPre FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre
94syn keyword vimAutoEvent contained FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave InsertLeavePre 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 +000095
96" Highlight commonly used Groupnames {{{2
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +020097syn 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 +000098
99" Default highlighting groups {{{2
h-east9b53c052024-02-13 21:09:22 +0100100" GEN_SYN_VIM: vimHLGroup, START_STR='syn keyword vimHLGroup contained', END_STR=''
dkearnsa3bddb72024-06-14 01:48:10 +1000101syn 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 +0200102syn match vimHLGroup contained "\<Conceal\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000103syn case match
104
105" Function Names {{{2
h-east9b53c052024-02-13 21:09:22 +0100106" GEN_SYN_VIM: vimFuncName, START_STR='syn keyword vimFuncName contained', END_STR=''
107syn 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 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 chdir cindent
Shougo Matsushita60c87432024-06-03 22:59:27 +0200108syn keyword vimFuncName contained 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 getchar
109syn keyword vimFuncName contained 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 indent index indexof input inputdialog inputlist inputrestore inputsave inputsecret insert
110syn keyword vimFuncName contained 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 popup_findecho
111syn keyword vimFuncName contained popup_findinfo popup_findpreview popup_getoptions popup_getpos popup_hide popup_list popup_locate popup_menu popup_move popup_notification 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 rubyeval screenattr screenchar
112syn keyword vimFuncName contained 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 strdisplaywidth strftime
113syn keyword vimFuncName contained 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 test_getvalue test_gui_event
114syn keyword vimFuncName contained 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 winwidth wordcount writefile
115syn keyword vimFuncName contained xor
Bram Moolenaar071d4272004-06-13 20:20:40 +0000116
Bram Moolenaarac7bd632013-03-19 11:35:58 +0100117"--- syntax here and above generated by mkvimvim ---
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000118" Special Vim Highlighting (not automatic) {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000119
Bram Moolenaar71badf92023-04-22 22:40:14 +0100120" Set up folding commands for this syntax highlighting file {{{2
Doug Kearnsce064932024-04-13 18:24:01 +0200121if exists("g:vimsyn_folding") && g:vimsyn_folding =~# '[afhHlmpPrt]'
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200122 if g:vimsyn_folding =~# 'a'
123 com! -nargs=* VimFolda <args> fold
124 else
125 com! -nargs=* VimFolda <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100126 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200127 if g:vimsyn_folding =~# 'f'
128 com! -nargs=* VimFoldf <args> fold
129 else
130 com! -nargs=* VimFoldf <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100131 endif
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100132 if g:vimsyn_folding =~# 'h'
133 com! -nargs=* VimFoldh <args> fold
134 else
135 com! -nargs=* VimFoldh <args>
136 endif
Doug Kearnsce064932024-04-13 18:24:01 +0200137 if g:vimsyn_folding =~# 'H'
138 com! -nargs=* VimFoldH <args> fold
139 else
140 com! -nargs=* VimFoldH <args>
141 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200142 if g:vimsyn_folding =~# 'l'
143 com! -nargs=* VimFoldl <args> fold
144 else
145 com! -nargs=* VimFoldl <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100146 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200147 if g:vimsyn_folding =~# 'm'
148 com! -nargs=* VimFoldm <args> fold
149 else
150 com! -nargs=* VimFoldm <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100151 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200152 if g:vimsyn_folding =~# 'p'
153 com! -nargs=* VimFoldp <args> fold
154 else
155 com! -nargs=* VimFoldp <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100156 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200157 if g:vimsyn_folding =~# 'P'
158 com! -nargs=* VimFoldP <args> fold
159 else
160 com! -nargs=* VimFoldP <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100161 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200162 if g:vimsyn_folding =~# 'r'
163 com! -nargs=* VimFoldr <args> fold
164 else
165 com! -nargs=* VimFoldr <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100166 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200167 if g:vimsyn_folding =~# 't'
168 com! -nargs=* VimFoldt <args> fold
169 else
170 com! -nargs=* VimFoldt <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100171 endif
172else
173 com! -nargs=* VimFolda <args>
174 com! -nargs=* VimFoldf <args>
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100175 com! -nargs=* VimFoldh <args>
Doug Kearnsce064932024-04-13 18:24:01 +0200176 com! -nargs=* VimFoldH <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100177 com! -nargs=* VimFoldl <args>
178 com! -nargs=* VimFoldm <args>
179 com! -nargs=* VimFoldp <args>
180 com! -nargs=* VimFoldP <args>
181 com! -nargs=* VimFoldr <args>
182 com! -nargs=* VimFoldt <args>
183endif
184
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000185" Deprecated variable options {{{2
186if exists("g:vim_minlines")
187 let g:vimsyn_minlines= g:vim_minlines
188endif
189if exists("g:vim_maxlines")
190 let g:vimsyn_maxlines= g:vim_maxlines
191endif
192if exists("g:vimsyntax_noerror")
193 let g:vimsyn_noerror= g:vimsyntax_noerror
194endif
195
Bram Moolenaar03413f42016-04-12 21:07:15 +0200196" Variable options {{{2
197if exists("g:vim_maxlines")
198 let s:vimsyn_maxlines= g:vim_maxlines
199else
200 let s:vimsyn_maxlines= 60
201endif
202
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000203" Numbers {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000204" =======
dkearns5cd86c62024-03-12 07:40:58 +1100205syn case ignore
dkearns04e53632024-04-11 06:18:37 +1000206syn match vimNumber '\<\d\+\%(\.\d\+\%(e[+-]\=\d\+\)\=\)\=' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment
207syn match vimNumber '\<0b[01]\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment
208syn match vimNumber '\<0o\=\o\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment
209syn match vimNumber '\<0x\x\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment
210syn match vimNumber '\<0z\>' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment
211syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment
212syn match vimNumber '\%(^\|\A\)\zs#\x\{6}' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment
dkearns5cd86c62024-03-12 07:40:58 +1100213syn case match
Bram Moolenaar071d4272004-06-13 20:20:40 +0000214
Bram Moolenaar6c1e1572019-06-22 02:13:00 +0200215" All vimCommands are contained by vimIsCommand. {{{2
Doug Kearns262e25e2024-06-14 20:16:35 +0200216syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutoCmd,vimAugroup,vimBehave,vimCatch,vimDef,@vimEcho,vimEnddef,vimEndfunction,vimExecute,vimIsCommand,vimExtCmd,vimFor,vimFunction,vimGlobal,vimHighlight,vimLet,vimMap,vimMark,vimNotFunc,vimNorm,vimSet,vimSleep,vimSyntax,vimThrow,vimUnlet,vimUnmap,vimUserCmd,vimMenu,vimMenutranslate
dkearnsc4aef9a2024-03-04 02:42:47 +1100217syn match vimCmdSep "[:|]\+" skipwhite nextgroup=@vimCmdList,vimSubst1
dkearns9c5b90d2024-01-24 06:34:28 +1100218syn match vimIsCommand "\<\%(\h\w*\|[23]mat\%[ch]\)\>" contains=vimCommand
Bram Moolenaard2855f52018-07-31 22:23:58 +0200219syn match vimVar contained "\<\h[a-zA-Z0-9#_]*\>"
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200220syn match vimVar "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>"
dkearnsf6869212023-12-11 01:53:24 +1100221syn match vimVar "\s\zs&\%([lg]:\)\=\a\+\>"
222syn match vimVar "\s\zs&t_\S[a-zA-Z0-9]\>"
223syn match vimVar "\s\zs&t_k;"
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200224syn match vimFBVar contained "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>"
Bram Moolenaar5c736222010-01-06 20:54:52 +0100225syn keyword vimCommand contained in
Bram Moolenaar071d4272004-06-13 20:20:40 +0000226
dkearnsb1427b42024-02-28 05:59:30 +1100227syn cluster vimExprList contains=vimEnvvar,vimFunc,vimFuncVar,vimNumber,vimOper,vimOperParen,vimLetRegister,vimString,vimVar
228
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000229" Insertions And Appends: insert append {{{2
Bram Moolenaar519cc552021-11-16 19:18:26 +0000230" (buftype != nofile test avoids having append, change, insert show up in the command window)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000231" =======================
Bram Moolenaar519cc552021-11-16 19:18:26 +0000232if &buftype != 'nofile'
dkearns4ba70ca2024-04-15 04:32:56 +1000233 syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=a\%[ppend]$" matchgroup=vimCommand end="^\.$" extend
234 syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=c\%[hange]$" matchgroup=vimCommand end="^\.$" extend
235 syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=i\%[nsert]$" matchgroup=vimCommand end="^\.$" extend
Bram Moolenaar519cc552021-11-16 19:18:26 +0000236endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000237
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000238" Behave! {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000239" =======
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100240if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_nobehaveerror")
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000241 syn match vimBehaveError contained "[^ ]\+"
242endif
Doug Kearnsfe6d5b02024-02-14 21:17:43 +0100243syn match vimBehave "\<be\%[have]\>" nextgroup=vimBehaveBang,vimBehaveModel,vimBehaveError skipwhite
244syn match vimBehaveBang contained "\a\@1<=!" nextgroup=vimBehaveModel skipwhite
245syn keyword vimBehaveModel contained mswin xterm
Bram Moolenaar071d4272004-06-13 20:20:40 +0000246
dkearnsa3bddb72024-06-14 01:48:10 +1000247" Exception Handling {{{2
248syn keyword vimThrow th[row] skipwhite nextgroup=@vimExprList
249syn keyword vimCatch cat[ch] skipwhite nextgroup=vimCatchPattern
250syn region vimCatchPattern contained matchgroup=Delimiter start="\z([!#$%&'()*+,-./:;<=>?@[\]^_`{}~]\)" skip="\\\\\|\\\z1" end="\z1" contains=@vimSubstList oneline
251
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000252" Filetypes {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000253" =========
Bram Moolenaar293ee4d2004-12-09 21:34:53 +0000254syn match vimFiletype "\<filet\%[ype]\(\s\+\I\i*\)*" skipwhite contains=vimFTCmd,vimFTOption,vimFTError
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100255if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_vimFTError")
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000256 syn match vimFTError contained "\I\i*"
257endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000258syn keyword vimFTCmd contained filet[ype]
259syn keyword vimFTOption contained detect indent off on plugin
260
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000261" Augroup : vimAugroupError removed because long augroups caused sync'ing problems. {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000262" ======= : Trade-off: Increasing synclines with slower editing vs augroup END error checking.
dkearns04e53632024-04-11 06:18:37 +1000263syn 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 +1100264syn match vimAugroup "\<aug\%[roup]\>" contains=vimAugroupKey,vimAugroupBang skipwhite nextgroup=vimAugroupBang,vimAutoCmdGroup
Bram Moolenaarf3913272016-02-25 00:00:01 +0100265if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'a'
dkearnsc4aef9a2024-03-04 02:42:47 +1100266 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 +0100267else
dkearnsc4aef9a2024-03-04 02:42:47 +1100268 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 +0100269endif
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100270if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noaugrouperror")
dkearnsc4aef9a2024-03-04 02:42:47 +1100271 syn match vimAugroupError "\<aug\%[roup]\>\s\+[eE][nN][dD]\>"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000272endif
dkearnsc4aef9a2024-03-04 02:42:47 +1100273
274syn match vimAutoCmdGroup contained "\S\+"
275syn match vimAugroupEnd contained "\c\<END\>"
276syn match vimAugroupBang contained "\a\@1<=!" skipwhite nextgroup=vimAutoCmdGroup
277syn keyword vimAugroupKey contained aug[roup] skipwhite nextgroup=vimAugroupBang,vimAutoCmdGroup,vimAugroupEnd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000278
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000279" Operators: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000280" =========
dkearns35e6f4c2024-03-22 06:41:10 +1100281syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,@vimContinue,vim9Comment,vimVar
dkearns4e043b12023-12-06 08:58:40 +1100282syn match vimOper "||\|&&\|[-+*/%.!]" skipwhite nextgroup=vimString,vimSpecFile
Bram Moolenaar113cb512021-11-07 20:27:04 +0000283syn match vimOper "\%#=1\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\|!\~#\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile
284syn match vimOper "\(\<is\|\<isnot\)[?#]\{0,2}\>" skipwhite nextgroup=vimString,vimSpecFile
dkearns76d62982024-03-23 05:55:25 +1100285syn region vimOperParen matchgroup=vimParenSep start="(" end=")" contains=@vimOperGroup
Bram Moolenaar4072ba52020-12-23 13:56:35 +0100286syn region vimOperParen matchgroup=vimSep start="#\={" end="}" contains=@vimOperGroup nextgroup=vimVar,vimFuncVar
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100287if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noopererror")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100288 syn match vimOperError ")"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000289endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000290
dkearns4ba70ca2024-04-15 04:32:56 +1000291" Functions: Tag is provided for those who wish to highlight tagged functions {{{2
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000292" =========
dkearns35e6f4c2024-03-22 06:41:10 +1100293syn cluster vimFuncList contains=vimFuncBang,vimFunctionError,vimFuncKey,vimFuncSID,Tag
294syn cluster vimDefList contains=vimFuncBang,vimFunctionError,vimDefKey,vimFuncSID,Tag
dkearns4ba70ca2024-04-15 04:32:56 +1000295
296syn cluster vimFuncBodyCommon contains=@vimCmdList,vimCmplxRepeat,vimContinue,vimCtrlChar,vimDef,vimEnvvar,vimFBVar,vimFunc,vimFunction,vimLetHereDoc,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegister,vimSearch,vimSpecFile,vimString,vimSubst,vimFuncFold
297syn cluster vimFuncBodyList contains=@vimFuncBodyCommon,vimComment,vimLineComment,vimFuncVar,vimInsert
298syn cluster vimDefBodyList contains=@vimFuncBodyCommon,vim9Comment,vim9LineComment
dkearns35e6f4c2024-03-22 06:41:10 +1100299
300syn region vimFuncPattern contained matchgroup=vimOper start="/" end="$" contains=@vimSubstList
301syn match vimFunction "\<fu\%[nction]\>" skipwhite nextgroup=vimCmdSep,vimComment,vimFuncPattern contains=vimFuncKey
302syn match vimDef "\<def\>" skipwhite nextgroup=vimCmdSep,vimComment,vimFuncPattern contains=vimDefKey
303
304syn match vimFunction "\<fu\%[nction]\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+" contains=@vimFuncList skipwhite nextgroup=vimFuncParams
305syn match vimDef "\<def\s\+new\%(\i\|{.\{-1,}}\)\+" contains=@vimDefList nextgroup=vimDefParams
Aliaksei Budavei80aabaa2024-03-31 19:26:32 +0300306syn match vimDef "\<def\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+" contains=@vimDefList,vimMethodName nextgroup=vimDefParams
dkearns35e6f4c2024-03-22 06:41:10 +1100307
308syn match vimFuncComment contained +".*+ skipwhite skipnl nextgroup=vimFuncBody,vimEndfunction
309syn match vimDefComment contained "#.*" skipwhite skipnl nextgroup=vimDefBody,vimEnddef
310
311syn match vimFuncBang contained "!"
312syn match vimFuncSID contained "\c<sid>"
313syn match vimFuncSID contained "\<[sg]:"
314syn keyword vimFuncKey contained fu[nction]
315syn keyword vimDefKey contained def
Aliaksei Budavei80aabaa2024-03-31 19:26:32 +0300316syn keyword vimMethodName contained empty len string
dkearns35e6f4c2024-03-22 06:41:10 +1100317
318syn region vimFuncParams contained matchgroup=Delimiter start="(" skip=+\n\s*\\\|\n\s*"\\ + end=")" skipwhite skipnl nextgroup=vimFuncBody,vimFuncComment,vimEndfunction,vimFuncMod contains=vimFuncParam,@vimContinue
319syn region vimDefParams contained matchgroup=Delimiter start="(" end=")" skipwhite skipnl nextgroup=vimDefBody,vimDefComment,vimEnddef,vimReturnType contains=vimDefParam,vim9Comment
320syn match vimFuncParam contained "\<\h\w*\>\|\.\.\." skipwhite nextgroup=vimFuncParamEquals
321syn match vimDefParam contained "\<\h\w*\>" skipwhite nextgroup=vimParamType,vimFuncParamEquals
322
323syn match vimFuncParamEquals contained "=" skipwhite nextgroup=@vimExprList
324syn match vimFuncMod contained "\<\%(abort\|closure\|dict\|range\)\>" skipwhite skipnl nextgroup=vimFuncBody,vimFuncComment,vimEndfunction,vimFuncMod
325
326syn region vimFuncBody contained start="^" matchgroup=vimCommand end="\<endfu\%[nction]\>" contains=@vimFuncBodyList
327syn region vimDefBody contained start="^" matchgroup=vimCommand end="\<enddef\>" contains=@vimDefBodyList
328
329syn match vimEndfunction "\<endf\%[unction]\>"
330syn match vimEnddef "\<enddef\>"
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000331
Bram Moolenaarf3913272016-02-25 00:00:01 +0100332if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f'
dkearns4ba70ca2024-04-15 04:32:56 +1000333 syn region vimFuncFold start="^\s*:\=\s*fu\%[nction]\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+\s*(" end="^\s*:\=\s*endf\%[unction]\>" contains=vimFunction fold keepend extend transparent
334 syn region vimFuncFold start="^\s*:\=\s*def\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\)\+(" end="^\s*:\=\s*enddef\>" contains=vimDef fold keepend extend transparent
335 syn region vimFuncFold start="^\s*:\=\s*def\s\+new\i\+(" end="^\s*:\=\s*enddef\>" contains=vimDef fold keepend extend transparent
Bram Moolenaarb4ff5182015-11-10 21:15:48 +0100336endif
dkearns35e6f4c2024-03-22 06:41:10 +1100337
338syn match vimFuncVar contained "a:\%(\K\k*\|\d\+\)\>"
Bram Moolenaar5c736222010-01-06 20:54:52 +0100339syn match vimFuncBlank contained "\s\+"
340
dkearns35e6f4c2024-03-22 06:41:10 +1100341" Types: {{{2
342" =====
Bram Moolenaar4d8f4762021-06-27 15:18:56 +0200343" vimTypes : new for vim9
dkearns35e6f4c2024-03-22 06:41:10 +1100344syn region vimReturnType contained start=":\s" end="$" matchgroup=vim9Comment end="\ze#" skipwhite skipnl nextgroup=vimDefBody,vimDefComment,vimEnddef contains=vimTypeSep transparent
345syn match vimParamType contained ":\s\+\a" skipwhite skipnl nextgroup=vimFuncParamEquals contains=vimTypeSep,@vimType
346
347syn match vimTypeSep contained ":\s\@=" skipwhite nextgroup=@vimType
348syn keyword vimType contained any blob bool channel float job number string void
349syn match vimType contained "\<func\>"
350syn region vimCompoundType contained matchgroup=vimType start="\<func(" end=")" nextgroup=vimTypeSep contains=@vimType oneline transparent
351syn region vimCompoundType contained matchgroup=vimType start="\<\%(list\|dict\)<" end=">" contains=@vimType oneline transparent
352syn match vimUserType contained "\<\u\w*\>"
353
354syn cluster vimType contains=vimType,vimCompoundType,vimUserType
Bram Moolenaar4d8f4762021-06-27 15:18:56 +0200355
dkearns04e53632024-04-11 06:18:37 +1000356" Keymaps: {{{2
dkearns69866442023-11-22 05:43:40 +1100357" =======
358
dkearns04e53632024-04-11 06:18:37 +1000359syn match vimKeymapStart "^" contained skipwhite nextgroup=vimKeymapLhs,@vimKeymapLineComment
dkearns69866442023-11-22 05:43:40 +1100360syn match vimKeymapLhs "\S\+" contained skipwhite nextgroup=vimKeymapRhs contains=vimNotation
361syn match vimKeymapRhs "\S\+" contained skipwhite nextgroup=vimKeymapTailComment contains=vimNotation
362syn match vimKeymapTailComment "\S.*" contained
dkearns04e53632024-04-11 06:18:37 +1000363
364" TODO: remove when :" comment is matched in parts as "ex-colon comment" --djk
365if s:vim9script
366 syn match vim9KeymapLineComment "#.*" contained contains=@vimCommentGroup,vimCommentString,vim9CommentTitle
367else
368 syn match vimKeymapLineComment +".*+ contained contains=@vimCommentGroup,vimCommentString,vimCommentTitle
369endif
370syn cluster vimKeymapLineComment contains=vim9\=KeymapLineComment
dkearns69866442023-11-22 05:43:40 +1100371
372syn region vimKeymap matchgroup=vimCommand start="\<loadk\%[eymap]\>" end="\%$" contains=vimKeymapStart
373
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000374" Special Filenames, Modifiers, Extension Removal: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000375" ===============================================
dkearns2c51e152024-02-27 07:10:18 +1100376syn match vimSpecFile "<c\(word\|WORD\)>" nextgroup=vimSpecFileMod,vimSubst1
377syn match vimSpecFile "<\([acs]file\|amatch\|abuf\)>" nextgroup=vimSpecFileMod,vimSubst1
378syn match vimSpecFile "\s%[ \t:]"ms=s+1,me=e-1 nextgroup=vimSpecFileMod,vimSubst1
379syn match vimSpecFile "\s%$"ms=s+1 nextgroup=vimSpecFileMod,vimSubst1
380syn match vimSpecFile "\s%<"ms=s+1,me=e-1 nextgroup=vimSpecFileMod,vimSubst1
381syn match vimSpecFile "#\d\+\|[#%]<\>" nextgroup=vimSpecFileMod,vimSubst1
Bram Moolenaar5c736222010-01-06 20:54:52 +0100382syn match vimSpecFileMod "\(:[phtre]\)\+" contained
Bram Moolenaar071d4272004-06-13 20:20:40 +0000383
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000384" User-Specified Commands: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000385" =======================
dkearns04e53632024-04-11 06:18:37 +1000386syn cluster vimUserCmdList contains=@vimCmdList,vimCmplxRepeat,@vimComment,vimCtrlChar,vimEscapeBrace,vimFunc,vimNotation,vimNumber,vimOper,vimRegister,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange
Bram Moolenaar5c736222010-01-06 20:54:52 +0100387syn keyword vimUserCommand contained com[mand]
dkearns04e53632024-04-11 06:18:37 +1000388syn match vimUserCmdName contained "\<\u\w*\>" nextgroup=vimUserCmdBlock skipwhite
389syn match vimUserCmd "\<com\%[mand]!\=\>.*$" contains=vimUserAttrb,vimUserAttrbError,vimUserCommand,@vimUserCmdList,vimComFilter,vimCmdBlock,vimUserCmdName
Bram Moolenaarb4ff5182015-11-10 21:15:48 +0100390syn match vimUserAttrbError contained "-\a\+\ze\s"
391syn match vimUserAttrb contained "-nargs=[01*?+]" contains=vimUserAttrbKey,vimOper
392syn match vimUserAttrb contained "-complete=" contains=vimUserAttrbKey,vimOper nextgroup=vimUserAttrbCmplt,vimUserCmdError
393syn match vimUserAttrb contained "-range\(=%\|=\d\+\)\=" contains=vimNumber,vimOper,vimUserAttrbKey
394syn match vimUserAttrb contained "-count\(=\d\+\)\=" contains=vimNumber,vimOper,vimUserAttrbKey
395syn match vimUserAttrb contained "-bang\>" contains=vimOper,vimUserAttrbKey
396syn match vimUserAttrb contained "-bar\>" contains=vimOper,vimUserAttrbKey
397syn match vimUserAttrb contained "-buffer\>" contains=vimOper,vimUserAttrbKey
398syn match vimUserAttrb contained "-register\>" contains=vimOper,vimUserAttrbKey
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100399if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_nousercmderror")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100400 syn match vimUserCmdError contained "\S\+\>"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000401endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000402syn case ignore
Bram Moolenaar5c736222010-01-06 20:54:52 +0100403syn keyword vimUserAttrbKey contained bar ban[g] cou[nt] ra[nge] com[plete] n[args] re[gister]
h-east9b53c052024-02-13 21:09:22 +0100404" GEN_SYN_VIM: vimUserAttrbCmplt, START_STR='syn keyword vimUserAttrbCmplt contained', END_STR=''
405syn keyword vimUserAttrbCmplt contained arglist augroup behave buffer color command compiler cscope diff_buffer dir environment event expression file file_in_path filetype function help highlight history keymap locale mapclear mapping menu messages syntax syntime option packadd runtime shellcmd sign tag tag_listfiles user var breakpoint scriptnames
Bram Moolenaar5c736222010-01-06 20:54:52 +0100406syn keyword vimUserAttrbCmplt contained custom customlist nextgroup=vimUserAttrbCmpltFunc,vimUserCmdError
Maxim Kimceed3682024-01-09 05:42:02 +1100407syn match vimUserAttrbCmpltFunc contained ",\%([sS]:\|<[sS][iI][dD]>\)\=\%(\h\w*\%([.#]\h\w*\)\+\|\h\w*\)"hs=s+1 nextgroup=vimUserCmdError
Bram Moolenaara93fa7e2006-04-17 22:14:47 +0000408
Bram Moolenaar071d4272004-06-13 20:20:40 +0000409syn case match
Bram Moolenaar5c736222010-01-06 20:54:52 +0100410syn match vimUserAttrbCmplt contained "custom,\u\w*"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000411
dkearns04e53632024-04-11 06:18:37 +1000412syn region vimUserCmdBlock contained matchgroup=vimSep start="{" end="}" contains=@vimDefBodyList
413
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000414" Lower Priority Comments: after some vim commands... {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000415" =======================
dkearns959c3c82024-06-12 04:18:08 +1000416if get(g:, "vimsyn_comment_strings", 1)
417 syn region vimCommentString contained oneline start='\S\s\+"'ms=e end='"'
418endif
dkearns04e53632024-04-11 06:18:37 +1000419
420if s:vim9script
421 syn match vimComment excludenl +\s"[^\-:.%#=*].*$+lc=1 contains=@vimCommentGroup,vimCommentString contained
422 syn match vimComment +\<endif\s\+".*$+lc=5 contains=@vimCommentGroup,vimCommentString contained
423 syn match vimComment +\<else\s\+".*$+lc=4 contains=@vimCommentGroup,vimCommentString contained
424 " Vim9 comments - TODO: might be highlighted while they don't work
425 syn match vim9Comment excludenl +\s#[^{].*$+lc=1 contains=@vimCommentGroup,vimCommentString
426 syn match vim9Comment +\<endif\s\+#[^{].*$+lc=5 contains=@vimCommentGroup,vimCommentString
427 syn match vim9Comment +\<else\s\+#[^{].*$+lc=4 contains=@vimCommentGroup,vimCommentString
428 " Vim9 comment inside expression
429 " syn match vim9Comment +\s\zs#[^{].*$+ms=s+1 contains=@vimCommentGroup,vimCommentString
430 " syn match vim9Comment +^\s*#[^{].*$+ contains=@vimCommentGroup,vimCommentString
431 " syn match vim9Comment +^\s*#$+ contains=@vimCommentGroup,vimCommentString
432
433 syn cluster vimComment contains=vim9Comment
434else
435 syn match vimComment excludenl +\s"[^\-:.%#=*].*$+lc=1 contains=@vimCommentGroup,vimCommentString
436 syn match vimComment +\<endif\s\+".*$+lc=5 contains=@vimCommentGroup,vimCommentString
437 syn match vimComment +\<else\s\+".*$+lc=4 contains=@vimCommentGroup,vimCommentString
438 " Vim9 comments - TODO: might be highlighted while they don't work
439 syn match vim9Comment excludenl +\s#[^{].*$+lc=1 contains=@vimCommentGroup,vimCommentString contained
440 syn match vim9Comment +\<endif\s\+#[^{].*$+lc=5 contains=@vimCommentGroup,vimCommentString contained
441 syn match vim9Comment +\<else\s\+#[^{].*$+lc=4 contains=@vimCommentGroup,vimCommentString contained
442 " Vim9 comment inside expression
443 syn match vim9Comment +\s\zs#[^{].*$+ms=s+1 contains=@vimCommentGroup,vimCommentString contained
444 syn match vim9Comment +^\s*#[^{].*$+ contains=@vimCommentGroup,vimCommentString contained
445 syn match vim9Comment +^\s*#$+ contains=@vimCommentGroup,vimCommentString contained
446
447 syn cluster vimComment contains=vimComment
448endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000449
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000450" Environment Variables: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000451" =====================
Bram Moolenaar5c736222010-01-06 20:54:52 +0100452syn match vimEnvvar "\$\I\i*"
453syn match vimEnvvar "\${\I\i*}"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000454
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000455" In-String Specials: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000456" Try to catch strings, if nothing else matches (therefore it must precede the others!)
457" vimEscapeBrace handles ["] []"] (ie. "s don't terminate string inside [])
Bram Moolenaar5c736222010-01-06 20:54:52 +0100458syn region vimEscapeBrace oneline contained transparent start="[^\\]\(\\\\\)*\[\zs\^\=\]\=" skip="\\\\\|\\\]" end="]"me=e-1
459syn match vimPatSepErr contained "\\)"
460syn match vimPatSep contained "\\|"
Bram Moolenaarb730f0c2018-11-25 03:56:26 +0100461syn region vimPatSepZone oneline contained matchgroup=vimPatSepZ start="\\%\=\ze(" skip="\\\\" end="\\)\|[^\\]['"]" contains=@vimStringGroup
Bram Moolenaar5c736222010-01-06 20:54:52 +0100462syn region vimPatRegion contained transparent matchgroup=vimPatSepR start="\\[z%]\=(" end="\\)" contains=@vimSubstList oneline
463syn match vimNotPatSep contained "\\\\"
Bram Moolenaar6ba83ba2022-06-12 22:15:57 +0100464syn cluster vimStringGroup contains=vimEscape,vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone,@Spell
Bram Moolenaard2855f52018-07-31 22:23:58 +0200465syn region vimString oneline keepend start=+[^a-zA-Z>!\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ contains=@vimStringGroup
Bram Moolenaarb0d45e72017-11-05 18:19:24 +0100466syn region vimString oneline keepend start=+[^a-zA-Z>!\\@]'+lc=1 end=+'+
Bram Moolenaaracc22402020-06-07 21:07:18 +0200467"syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup " see tst45.vim
Bram Moolenaar5c736222010-01-06 20:54:52 +0100468syn match vimString contained +"[^"]*\\$+ skipnl nextgroup=vimStringCont
469syn match vimStringCont contained +\(\\\\\|.\)\{-}[^\\]"+
Bram Moolenaar6ba83ba2022-06-12 22:15:57 +0100470syn match vimEscape contained "\\."
dkearnse3e39342024-02-02 07:44:26 +1100471" syn match vimEscape contained +\\[befnrt\"]+
472syn match vimEscape contained "\\\o\{1,3}\|\\[xX]\x\{1,2}\|\\u\x\{1,4}\|\\U\x\{1,8}"
473syn match vimEscape contained "\\<" contains=vimNotation
474syn match vimEscape contained "\\<\*[^>]*>\=>"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000475
dkearnsb1427b42024-02-28 05:59:30 +1100476syn region vimString oneline start=+$'+ skip=+''+ end=+'+ contains=vimStringInterpolationBrace,vimStringInterpolationExpr
477syn region vimString oneline start=+$"+ end=+"+ contains=@vimStringGroup,vimStringInterpolationBrace,vimStringInterpolationExpr
478syn region vimStringInterpolationExpr oneline contained matchgroup=vimSep start=+{+ end=+}+ contains=@vimExprList
479syn match vimStringInterpolationBrace contained "{{"
480syn match vimStringInterpolationBrace contained "}}"
thincacf8695d2024-01-28 18:57:23 +0100481
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000482" Substitutions: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000483" =============
Bram Moolenaar5c736222010-01-06 20:54:52 +0100484syn cluster vimSubstList contains=vimPatSep,vimPatRegion,vimPatSepErr,vimSubstTwoBS,vimSubstRange,vimNotation
485syn cluster vimSubstRepList contains=vimSubstSubstr,vimSubstTwoBS,vimNotation
486syn cluster vimSubstList add=vimCollection
Doug Kearns92f4e912024-06-05 19:45:43 +0200487syn match vimSubst "^\s*\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)\>" skipwhite nextgroup=vimSubstPat
488syn match vimSubst "^\s*\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)[_#]\@=" skipwhite nextgroup=vimSubstPat
489syn match vimSubst1 contained "\%(s\%[ubstitute]\|sm\%[agic]\>\|sno\%[magic]\)\>" skipwhite nextgroup=vimSubstPat
490syn match vimSubst1 contained "\%(s\%[ubstitute]\|sm\%[agic]\>\|sno\%[magic]\)[_#]\@=" skipwhite nextgroup=vimSubstPat
dkearns2c51e152024-02-27 07:10:18 +1100491" TODO: Vim9 illegal separators for abbreviated :s form are [-.:], :su\%[...] required
492" : # is allowed but "not recommended" (see :h pattern-delimiter)
493syn 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
494syn region vimSubstRep4 contained matchgroup=vimSubstDelim start="\z(.\)" skip="\\\\\|\\\z1" end="\z1" matchgroup=vimNotation end="<[cC][rR]>" contains=@vimSubstRepList nextgroup=vimSubstFlagErr oneline
495syn region vimCollection contained transparent start="\\\@<!\[" skip="\\\[" end="\]" contains=vimCollClass
496syn match vimCollClassErr contained "\[:.\{-\}:\]"
497syn match vimCollClass contained transparent "\%#=1\[:\(alnum\|alpha\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|xdigit\|retu\%[rn]\|tab\|escape\|backspace\):\]"
498syn match vimSubstSubstr contained "\\z\=\d"
499syn match vimSubstTwoBS contained "\\\\"
500syn match vimSubstFlagErr contained "[^< \t\r|]\+" contains=vimSubstFlags
501syn match vimSubstFlags contained "[&cegiIlnpr#]\+"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000502
Doug Kearns92f4e912024-06-05 19:45:43 +0200503" Vi compatibility
504syn match vimSubstDelim contained "\\"
505syn match vimSubstPat contained "\\\ze[/?&]" contains=vimSubstDelim nextgroup=vimSubstRep4
506
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000507" 'String': {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +0100508syn match vimString "[^(,]'[^']\{-}\zs'"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000509
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000510" Marks, Registers, Addresses, Filters: {{{2
dkearns2c51e152024-02-27 07:10:18 +1100511syn match vimMark "'[a-zA-Z0-9]\ze[-+,!]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
512syn match vimMark "'[<>]\ze[-+,!]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
513syn match vimMark ",\zs'[<>]\ze" nextgroup=vimFilter,vimMarkNumber,vimSubst1
514syn match vimMark "[!,:]\zs'[a-zA-Z0-9]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
515syn match vimMark "\<norm\%[al]\s\zs'[a-zA-Z0-9]" nextgroup=vimFilter,vimMarkNumber,vimSubst1
516syn match vimMarkNumber "[-+]\d\+" contained contains=vimOper nextgroup=vimSubst1
Bram Moolenaar5c736222010-01-06 20:54:52 +0100517syn match vimPlainMark contained "'[a-zA-Z0-9]"
Bram Moolenaar6c1e1572019-06-22 02:13:00 +0200518syn match vimRange "[`'][a-zA-Z0-9],[`'][a-zA-Z0-9]" contains=vimMark skipwhite nextgroup=vimFilter
Bram Moolenaar071d4272004-06-13 20:20:40 +0000519
Bram Moolenaarb4ff5182015-11-10 21:15:48 +0100520syn match vimRegister '[^,;[{: \t]\zs"[a-zA-Z0-9.%#:_\-/]\ze[^a-zA-Z_":0-9]'
Bram Moolenaar5c736222010-01-06 20:54:52 +0100521syn match vimRegister '\<norm\s\+\zs"[a-zA-Z0-9]'
522syn match vimRegister '\<normal\s\+\zs"[a-zA-Z0-9]'
523syn match vimRegister '@"'
524syn match vimPlainRegister contained '"[a-zA-Z0-9\-:.%#*+=]'
dkearnsf6869212023-12-11 01:53:24 +1100525syn match vimLetRegister contained '@["0-9\-a-zA-Z#=*+_/]'
Bram Moolenaar071d4272004-06-13 20:20:40 +0000526
Bram Moolenaar5c736222010-01-06 20:54:52 +0100527syn match vimAddress ",\zs[.$]" skipwhite nextgroup=vimSubst1
528syn match vimAddress "%\ze\a" skipwhite nextgroup=vimString,vimSubst1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000529
Bram Moolenaar6c1e1572019-06-22 02:13:00 +0200530syn match vimFilter "^!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile
Bram Moolenaard58a3bf2020-09-28 21:48:16 +0200531syn match vimFilter contained "!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile
532syn match vimComFilter contained "|!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile
Bram Moolenaar071d4272004-06-13 20:20:40 +0000533
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100534" Complex Repeats: (:h complex-repeat) {{{2
535" ===============
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100536syn match vimCmplxRepeat '[^a-zA-Z_/\\()]q[0-9a-zA-Z"]\>'lc=1
537syn match vimCmplxRepeat '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\>\)'
Bram Moolenaar071d4272004-06-13 20:20:40 +0000538
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000539" Set command and associated set-options (vimOptions) with comment {{{2
dkearns04e53632024-04-11 06:18:37 +1000540syn region vimSet matchgroup=vimCommand start="\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skip="\%(\\\\\)*\\.\n\@!" end="$" end="|" matchgroup=vimNotation end="<[cC][rR]>" keepend contains=vimSetEqual,vimOption,vimErrSetting,@vimComment,vimSetString,vimSetMod
Bram Moolenaard2ea7cf2021-05-30 20:54:13 +0200541syn region vimSetEqual contained start="[=:]\|[-+^]=" skip="\\\\\|\\\s" end="[| \t]"me=e-1 end="$" contains=vimCtrlChar,vimSetSep,vimNotation,vimEnvvar
Bram Moolenaard2855f52018-07-31 22:23:58 +0200542syn region vimSetString contained start=+="+hs=s+1 skip=+\\\\\|\\"+ end=+"+ contains=vimCtrlChar
Bram Moolenaar4072ba52020-12-23 13:56:35 +0100543syn match vimSetSep contained "[,:]"
Bram Moolenaar5c736222010-01-06 20:54:52 +0100544syn match vimSetMod contained "&vim\=\|[!&?<]\|all&"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000545
Bram Moolenaar71badf92023-04-22 22:40:14 +0100546" Let And Var: {{{2
547" ===========
dkearnsf6869212023-12-11 01:53:24 +1100548syn keyword vimLet let skipwhite nextgroup=vimVar,vimFuncVar,vimLetHereDoc,vimLetRegister,vimVarList
549syn keyword vimConst cons[t] skipwhite nextgroup=vimVar,vimLetHereDoc,vimVarList
550syn region vimVarList contained start="\[" end="]" contains=vimVar,vimContinue
551
552syn keyword vimUnlet unl[et] skipwhite nextgroup=vimUnletBang,vimUnletVars
553syn match vimUnletBang contained "!" skipwhite nextgroup=vimUnletVars
554syn region vimUnletVars contained start="$\I\|\h" skip="\n\s*\\" end="$" end="|" contains=vimVar,vimEnvvar,vimContinue,vimString,vimNumber
555
dkearns4ba70ca2024-04-15 04:32:56 +1000556VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='=<<\s*\%(trim\s\+\%(eval\s\+\)\=\|eval\s\+\%(trim\s\+\)\=\)\=\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\s*\z1\s*$' extend
Bram Moolenaar71badf92023-04-22 22:40:14 +0100557syn keyword vimLet var skipwhite nextgroup=vimVar,vimFuncVar,vimLetHereDoc
Bram Moolenaar071d4272004-06-13 20:20:40 +0000558
dkearnsf6869212023-12-11 01:53:24 +1100559" For: {{{2
560" ===
561syn keyword vimFor for skipwhite nextgroup=vimVar,vimVarList
dkearns76d62982024-03-23 05:55:25 +1100562
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100563" Abbreviations: {{{2
Bram Moolenaare37d50a2008-08-06 17:06:04 +0000564" =============
h-east9b53c052024-02-13 21:09:22 +0100565" GEN_SYN_VIM: vimCommand abbrev, START_STR='syn keyword vimAbb', END_STR='skipwhite nextgroup=vimMapMod,vimMapLhs'
dkearns16249702024-02-23 05:45:05 +1100566syn 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 +1100567" GEN_SYN_VIM: vimCommand abclear, START_STR='syn keyword vimAbb', END_STR='skipwhite nextgroup=vimMapMod'
568syn keyword vimAbb abc[lear] cabc[lear] iabc[lear] skipwhite nextgroup=vimMapMod
Bram Moolenaare37d50a2008-08-06 17:06:04 +0000569
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100570" Autocmd: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000571" =======
Bram Moolenaar5c736222010-01-06 20:54:52 +0100572syn match vimAutoEventList contained "\(!\s\+\)\=\(\a\+,\)*\a\+" contains=vimAutoEvent nextgroup=vimAutoCmdSpace
573syn match vimAutoCmdSpace contained "\s\+" nextgroup=vimAutoCmdSfxList
dkearns04e53632024-04-11 06:18:37 +1000574syn match vimAutoCmdSfxList contained "\S*" skipwhite nextgroup=vimAutoCmdMod,vimAutoCmdBlock
Bram Moolenaar5c736222010-01-06 20:54:52 +0100575syn keyword vimAutoCmd au[tocmd] do[autocmd] doautoa[ll] skipwhite nextgroup=vimAutoEventList
dkearns04e53632024-04-11 06:18:37 +1000576syn match vimAutoCmdMod "\(++\)\=\(once\|nested\)" skipwhite nextgroup=vimAutoCmdBlock
577syn region vimAutoCmdBlock contained matchgroup=vimSep start="{" end="}" contains=@vimDefBodyList
Bram Moolenaar071d4272004-06-13 20:20:40 +0000578
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100579" Echo And Execute: -- prefer strings! {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000580" ================
dkearns61887b32024-03-15 23:45:48 +1100581" NOTE: No trailing comments
dkearnsb1427b42024-02-28 05:59:30 +1100582
dkearns61887b32024-03-15 23:45:48 +1100583syn region vimEcho
584 \ matchgroup=vimCommand
585 \ start="\<ec\%[ho]\>"
586 \ start="\<echoe\%[rr]\>"
587 \ start="\<echom\%[sg]\>"
588 \ start="\<echoc\%[onsole]\>"
589 \ start="\<echon\>"
590 \ start="\<echow\%[indow]\>"
591 \ skip=+\\|\|\n\s*\\\|\n\s*"\\ +
592 \ matchgroup=vimCmdSep end="|" excludenl end="$" contains=@vimContinue,@vimExprList transparent
593
594syn match vimEchohl "\<echohl\=\>" skipwhite nextgroup=vimGroup,vimHLGroup,vimEchohlNone
Bram Moolenaar071d4272004-06-13 20:20:40 +0000595syn case ignore
dkearns61887b32024-03-15 23:45:48 +1100596syn keyword vimEchohlNone contained none
Bram Moolenaar071d4272004-06-13 20:20:40 +0000597syn case match
598
dkearns35e6f4c2024-03-22 06:41:10 +1100599syn cluster vimEcho contains=vimEcho,vimEchohl
dkearns61887b32024-03-15 23:45:48 +1100600
601syn 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 +1100602
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100603" Maps: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000604" ====
dkearnsb614b282024-02-12 03:13:34 +1100605syn match vimMap "\<map\>\ze\s*(\@!" skipwhite nextgroup=vimMapMod,vimMapLhs
606syn match vimMap "\<map!" contains=vimMapBang skipwhite nextgroup=vimMapMod,vimMapLhs
h-east9b53c052024-02-13 21:09:22 +0100607" GEN_SYN_VIM: vimCommand map, START_STR='syn keyword vimMap', END_STR='skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs'
608syn keyword vimMap cm[ap] cno[remap] im[ap] ino[remap] lm[ap] ln[oremap] nm[ap] nn[oremap] no[remap] om[ap] ono[remap] smap snor[emap] tma[p] tno[remap] vm[ap] vn[oremap] xm[ap] xn[oremap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
dkearns16249702024-02-23 05:45:05 +1100609" GEN_SYN_VIM: vimCommand mapclear, START_STR='syn keyword vimMap', END_STR='skipwhite nextgroup=vimMapMod'
610syn keyword vimMap cmapc[lear] imapc[lear] lmapc[lear] nmapc[lear] omapc[lear] smapc[lear] tmapc[lear] vmapc[lear] xmapc[lear] skipwhite nextgroup=vimMapMod
611syn keyword vimMap mapc[lear] skipwhite nextgroup=vimMapBang,vimMapMod
h-east9b53c052024-02-13 21:09:22 +0100612" GEN_SYN_VIM: vimCommand unmap, START_STR='syn keyword vimUnmap', END_STR='skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs'
613syn keyword vimUnmap cu[nmap] iu[nmap] lu[nmap] nun[map] ou[nmap] sunm[ap] tunma[p] unm[ap] vu[nmap] xu[nmap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
dkearns5d67aef2024-03-10 04:01:22 +1100614syn match vimMapLhs contained "\%(.\|\S\)\+" contains=vimCtrlChar,vimNotation skipwhite nextgroup=vimMapRhs
615syn match vimMapLhs contained "\%(.\|\S\)\+\ze\s*$" contains=vimCtrlChar,vimNotation skipwhite skipnl nextgroup=vimMapRhsContinue
616syn match vimMapBang contained "\a\@1<=!" skipwhite nextgroup=vimMapMod,vimMapLhs
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200617syn 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 +1100618syn region vimMapRhs contained start="\S" skip=+\\|\|\@1<=|\|\n\s*\\\|\n\s*"\\ + end="|" end="$" contains=@vimContinue,vimCtrlChar,vimNotation skipnl nextgroup=vimMapRhsContinue
619" assume a continuation comment introduces the RHS
620syn region vimMapRhsContinue contained start=+^\s*\%(\\\|"\\ \)+ skip=+\\|\|\@1<=|\|\n\s*\\\|\n\s*"\\ + end="|" end="$" contains=@vimContinue,vimCtrlChar,vimNotation
Bram Moolenaar071d4272004-06-13 20:20:40 +0000621syn case ignore
Bram Moolenaarb4ff5182015-11-10 21:15:48 +0100622syn keyword vimMapModKey contained buffer expr leader localleader nowait plug script sid silent unique
Bram Moolenaar071d4272004-06-13 20:20:40 +0000623syn case match
624
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100625" Menus: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000626" =====
dkearns62b26042024-03-10 03:43:28 +1100627" NOTE: tail comments disallowed
628" GEN_SYN_VIM: vimCommand menu, START_STR='syn keyword vimMenu', END_STR='skipwhite nextgroup=vimMenuBang,vimMenuMod,vimMenuName,vimMenuPriority,vimMenuStatus'
629syn 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
630syn keyword vimMenu popu[p] skipwhite nextgroup=vimMenuBang,vimMenuName
631syn region vimMenuRhs contained contains=@vimContinue,vimNotation start="|\@!\S" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + end="$" matchgroup=vimSep end="|"
632syn region vimMenuRhsContinue contained contains=@vimContinue,vimNotation start=+^\s*\%(\\\|"\\ \)+ skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + end="$" matchgroup=vimSep end="|"
dkearnsec21baf2024-03-20 04:04:42 +1100633syn match vimMenuName "\.\@!\%(\\\s\|\S\)\+" contained contains=vimMenuNotation,vimNotation skipwhite nextgroup=vimCmdSep,vimMenuRhs
634syn match vimMenuName "\.\@!\%(\\\s\|\S\)\+\ze\s*$" contained contains=vimMenuNotation,vimNotation skipwhite skipnl nextgroup=vimCmdSep,vimMenuRhsContinue
dkearns62b26042024-03-10 03:43:28 +1100635syn match vimMenuNotation "&\a\|&&\|\\\s\|\\\." contained
636syn match vimMenuPriority "\<\d\+\%(\.\d\+\)*\>" contained skipwhite nextgroup=vimMenuName
637syn match vimMenuMod "\c<\%(script\|silent\|special\)>" contained skipwhite nextgroup=vimMenuName,vimMenuPriority,vimMenuMod contains=vimMapModKey,vimMapModErr
638syn keyword vimMenuStatus enable disable nextgroup=vimMenuName skipwhite
639syn match vimMenuBang "\a\@1<=!" contained skipwhite nextgroup=vimMenuName,vimMenuMod
640
641syn region vimMenutranslate
642 \ matchgroup=vimCommand start="\<menut\%[ranslate]\>"
643 \ skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ +
644 \ end="$" matchgroup=vimCmdSep end="|" matchgroup=vimMenuClear end="\<clear\ze\s*\%(["#|]\|$\)"
645 \ contains=@vimContinue,vimMenutranslateName keepend transparent
646" oneline is sufficient to match the current formatting in runtime/lang/*.vim
647syn match vimMenutranslateName "\%(\\\s\|\S\)\+" contained contains=vimMenuNotation,vimNotation
648syn match vimMenutranslateComment +".*+ contained containedin=vimMenutranslate
Bram Moolenaar071d4272004-06-13 20:20:40 +0000649
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100650" Angle-Bracket Notation: (tnx to Michael Geddes) {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000651" ======================
652syn case ignore
dkearnse3e39342024-02-02 07:44:26 +1100653syn 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
654
655syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}\%(net\|dec\|jsb\|pterm\|urxvt\|sgr\)mouse>" contains=vimBracket
656syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}\%(left\|middle\|right\)\%(mouse\|drag\|release\)>" contains=vimBracket
657syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}left\%(mouse\|release\)nm>" contains=vimBracket
658syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}x[12]\%(mouse\|drag\|release\)>" contains=vimBracket
659syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}sgrmouserelease>" contains=vimBracket
660syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}mouse\%(up\|down\|move\)>" contains=vimBracket
661syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}scrollwheel\%(up\|down\|right\|left\)>" contains=vimBracket
662
663syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%(sid\|nop\|nul\|lt\|drop\)>" contains=vimBracket
664syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%(snr\|plug\|cursorhold\|ignore\|cmd\|scriptcmd\|focus\%(gained\|lost\)\)>" contains=vimBracket
665syn match vimNotation '\%(\\\|<lt>\)\=<C-R>[0-9a-z"%#:.\-=]'he=e-1 contains=vimBracket
666syn match vimNotation '\%#=1\%(\\\|<lt>\)\=<\%(q-\)\=\%(line[12]\|count\|bang\|reg\|args\|mods\|f-args\|f-mods\|lt\)>' contains=vimBracket
667syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%([cas]file\|abuf\|amatch\|cexpr\|cword\|cWORD\|client\|stack\|script\|sf\=lnum\)>" contains=vimBracket
668syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%([scamd]-\)\{0,4}char-\%(\d\+\|0\o\+\|0x\x\+\)>" contains=vimBracket
669
Bram Moolenaar5c736222010-01-06 20:54:52 +0100670syn match vimBracket contained "[\\<>]"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000671syn case match
672
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100673" User Function Highlighting: {{{2
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000674" (following Gautam Iyer's suggestion)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000675" ==========================
dkearnsb4b3d7d2024-03-16 04:53:53 +1100676syn 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 +0300677syn 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 +1100678syn keyword vimFuncEcho contained ec ech echo
679
Bram Moolenaar2547aa92020-07-26 17:00:44 +0200680" User Command Highlighting: {{{2
Bram Moolenaard2ea7cf2021-05-30 20:54:13 +0200681syn match vimUsrCmd '^\s*\zs\u\%(\w*\)\@>\%([(#[]\|\s\+\%([-+*/%]\=\|\.\.\)=\)\@!'
Bram Moolenaar2547aa92020-07-26 17:00:44 +0200682
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000683" Errors And Warnings: {{{2
684" ====================
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100685if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimfunctionerror")
Aliaksei Budaveidfcef892024-02-18 21:02:14 +0300686 " TODO: The new-prefix exception should only apply to constructor definitions.
Aliaksei Budavei80aabaa2024-03-31 19:26:32 +0300687 " TODO: The |builtin-object-methods| exception should only apply to method
688 " definitions.
689 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 +0200690 syn match vimFunctionError "\s\zs\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\d\i\{-}\ze\s*(" contained contains=vimFuncKey,vimFuncBlank
Bram Moolenaar5c736222010-01-06 20:54:52 +0100691 syn match vimElseIfErr "\<else\s\+if\>"
692 syn match vimBufnrWarn /\<bufnr\s*(\s*["']\.['"]\s*)/
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000693endif
694
Bram Moolenaarf1dcd142022-12-31 15:30:45 +0000695syn match vimNotFunc "\<if\>\|\<el\%[seif]\>\|\<retu\%[rn]\>\|\<while\>" skipwhite nextgroup=vimOper,vimOperParen,vimVar,vimFunc,vimNotation
Bram Moolenaar6c1e1572019-06-22 02:13:00 +0200696
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100697" Norm: {{{2
Bram Moolenaar05159a02005-02-26 23:04:13 +0000698" ====
Bram Moolenaar5c736222010-01-06 20:54:52 +0100699syn match vimNorm "\<norm\%[al]!\=" skipwhite nextgroup=vimNormCmds
700syn match vimNormCmds contained ".*$"
Bram Moolenaar05159a02005-02-26 23:04:13 +0000701
Doug Kearns262e25e2024-06-14 20:16:35 +0200702" Sleep: {{{2
703" =====
704syn keyword vimSleep sl[eep] skipwhite nextgroup=vimSleepBang,vimSleepArg
705syn match vimSleepBang contained "\a\@1<=!" skipwhite nextgroup=vimSleepArg
706syn match vimSleepArg contained "\<\%(\d\+\)\=m\=\>"
707
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100708" Syntax: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000709"=======
dkearns21ce1592024-01-29 04:54:08 +1100710syn match vimGroupList contained "[^[:space:],]\+\%(\s*,\s*[^[:space:],]\+\)*" contains=vimGroupSpecial
711syn 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
712syn keyword vimGroupSpecial contained ALL ALLBUT CONTAINED TOP
713
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100714if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsynerror")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100715 syn match vimSynError contained "\i\+"
716 syn match vimSynError contained "\i\+=" nextgroup=vimGroupList
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000717endif
dkearns21ce1592024-01-29 04:54:08 +1100718syn match vimSynContains contained "\<contain\%(s\|edin\)=" skipwhite skipnl nextgroup=vimGroupList
719syn match vimSynKeyContainedin contained "\<containedin=" skipwhite skipnl nextgroup=vimGroupList
720syn match vimSynNextgroup contained "\<nextgroup=" skipwhite skipnl nextgroup=vimGroupList
dkearnsc79646d2024-01-05 08:58:48 +1100721if has("conceal")
dkearns21ce1592024-01-29 04:54:08 +1100722 " no whitespace allowed after '='
dkearnsc79646d2024-01-05 08:58:48 +1100723 syn match vimSynCchar contained "\<cchar=" nextgroup=vimSynCcharValue
724 syn match vimSynCcharValue contained "\S"
725endif
726
dkearns04e53632024-04-11 06:18:37 +1000727syn match vimSyntax "\<sy\%[ntax]\>" contains=vimCommand skipwhite nextgroup=vimSynType,@vimComment
Bram Moolenaard960d762011-09-21 19:22:10 +0200728syn cluster vimFuncBodyList add=vimSyntax
Bram Moolenaar071d4272004-06-13 20:20:40 +0000729
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000730" Syntax: case {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +0100731syn keyword vimSynType contained case skipwhite nextgroup=vimSynCase,vimSynCaseError
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100732if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsyncaseerror")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100733 syn match vimSynCaseError contained "\i\+"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000734endif
Bram Moolenaar5c736222010-01-06 20:54:52 +0100735syn keyword vimSynCase contained ignore match
Bram Moolenaar071d4272004-06-13 20:20:40 +0000736
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000737" Syntax: clear {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +0100738syn keyword vimSynType contained clear skipwhite nextgroup=vimGroupList
Bram Moolenaar071d4272004-06-13 20:20:40 +0000739
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000740" Syntax: cluster {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +0100741syn keyword vimSynType contained cluster skipwhite nextgroup=vimClusterName
dkearns21ce1592024-01-29 04:54:08 +1100742syn region vimClusterName contained keepend matchgroup=vimGroupName start="\h\w*\>" skip=+\\\\\|\\\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="$\||" contains=@vimContinue,vimGroupAdd,vimGroupRem,vimSynContains,vimSynError
743syn match vimGroupAdd contained keepend "\<add=" skipwhite skipnl nextgroup=vimGroupList
744syn match vimGroupRem contained keepend "\<remove=" skipwhite skipnl nextgroup=vimGroupList
Bram Moolenaar071d4272004-06-13 20:20:40 +0000745
Brad Kingd4634a22024-01-03 10:17:24 -0500746" Syntax: foldlevel {{{2
747syn keyword vimSynType contained foldlevel skipwhite nextgroup=vimSynFoldMethod,vimSynFoldMethodError
748if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsynfoldmethoderror")
749 syn match vimSynFoldMethodError contained "\i\+"
750endif
751syn keyword vimSynFoldMethod contained start minimum
752
Bram Moolenaar13d5aee2016-01-21 23:36:05 +0100753" Syntax: iskeyword {{{2
754syn keyword vimSynType contained iskeyword skipwhite nextgroup=vimIskList
755syn match vimIskList contained '\S\+' contains=vimIskSep
756syn match vimIskSep contained ','
757
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000758" Syntax: include {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +0100759syn keyword vimSynType contained include skipwhite nextgroup=vimGroupList
Bram Moolenaar071d4272004-06-13 20:20:40 +0000760
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000761" Syntax: keyword {{{2
dkearns21ce1592024-01-29 04:54:08 +1100762syn cluster vimSynKeyGroup contains=@vimContinue,vimSynCchar,vimSynNextgroup,vimSynKeyOpt,vimSynKeyContainedin
Bram Moolenaar5c736222010-01-06 20:54:52 +0100763syn keyword vimSynType contained keyword skipwhite nextgroup=vimSynKeyRegion
dkearns21ce1592024-01-29 04:54:08 +1100764syn 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 +0200765syn match vimSynKeyOpt contained "\%#=1\<\(conceal\|contained\|transparent\|skipempty\|skipwhite\|skipnl\)\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000766
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000767" Syntax: match {{{2
dkearns21ce1592024-01-29 04:54:08 +1100768syn cluster vimSynMtchGroup contains=@vimContinue,vimSynCchar,vimSynContains,vimSynError,vimSynMtchOpt,vimSynNextgroup,vimSynRegPat,vimNotation,vimMtchComment
Bram Moolenaar5c736222010-01-06 20:54:52 +0100769syn keyword vimSynType contained match skipwhite nextgroup=vimSynMatchRegion
dkearns21ce1592024-01-29 04:54:08 +1100770syn 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 +0200771syn match vimSynMtchOpt contained "\%#=1\<\(conceal\|transparent\|contained\|excludenl\|keepend\|skipempty\|skipwhite\|display\|extend\|skipnl\|fold\)\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000772
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000773" Syntax: off and on {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +0100774syn keyword vimSynType contained enable list manual off on reset
Bram Moolenaar071d4272004-06-13 20:20:40 +0000775
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000776" Syntax: region {{{2
dkearns21ce1592024-01-29 04:54:08 +1100777syn cluster vimSynRegPatGroup contains=@vimContinue,vimPatSep,vimNotPatSep,vimSynPatRange,vimSynNotPatRange,vimSubstSubstr,vimPatRegion,vimPatSepErr,vimNotation
778syn cluster vimSynRegGroup contains=@vimContinue,vimSynCchar,vimSynContains,vimSynNextgroup,vimSynRegOpt,vimSynReg,vimSynMtchGrp
Bram Moolenaar5c736222010-01-06 20:54:52 +0100779syn keyword vimSynType contained region skipwhite nextgroup=vimSynRegion
dkearns21ce1592024-01-29 04:54:08 +1100780syn region vimSynRegion contained keepend matchgroup=vimGroupName start="\h\w*" skip=+\\\\\|\\\|\n\s*\\\|\n\s*"\\ + end="|\|$" contains=@vimSynRegGroup
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200781syn match vimSynRegOpt contained "\%#=1\<\(conceal\(ends\)\=\|transparent\|contained\|excludenl\|skipempty\|skipwhite\|display\|keepend\|oneline\|extend\|skipnl\|fold\)\>"
dkearns21ce1592024-01-29 04:54:08 +1100782syn match vimSynReg contained "\<\%(start\|skip\|end\)=" nextgroup=vimSynRegPat
Bram Moolenaar5c736222010-01-06 20:54:52 +0100783syn match vimSynMtchGrp contained "matchgroup=" nextgroup=vimGroup,vimHLGroup
dkearns21ce1592024-01-29 04:54:08 +1100784syn 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 +0200785syn match vimSynPatMod contained "\%#=1\(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\([-+]\d\+\)\="
786syn match vimSynPatMod contained "\%#=1\(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\([-+]\d\+\)\=," nextgroup=vimSynPatMod
Bram Moolenaar5c736222010-01-06 20:54:52 +0100787syn match vimSynPatMod contained "lc=\d\+"
788syn match vimSynPatMod contained "lc=\d\+," nextgroup=vimSynPatMod
789syn region vimSynPatRange contained start="\[" skip="\\\\\|\\]" end="]"
790syn match vimSynNotPatRange contained "\\\\\|\\\["
791syn match vimMtchComment contained '"[^"]\+$'
Bram Moolenaar071d4272004-06-13 20:20:40 +0000792
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000793" Syntax: sync {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000794" ============
Bram Moolenaardf177f62005-02-22 08:39:57 +0000795syn keyword vimSynType contained sync skipwhite nextgroup=vimSyncC,vimSyncLines,vimSyncMatch,vimSyncError,vimSyncLinebreak,vimSyncLinecont,vimSyncRegion
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100796if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsyncerror")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100797 syn match vimSyncError contained "\i\+"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000798endif
Bram Moolenaar5c736222010-01-06 20:54:52 +0100799syn keyword vimSyncC contained ccomment clear fromstart
800syn keyword vimSyncMatch contained match skipwhite nextgroup=vimSyncGroupName
801syn keyword vimSyncRegion contained region skipwhite nextgroup=vimSynReg
802syn match vimSyncLinebreak contained "\<linebreaks=" skipwhite nextgroup=vimNumber
803syn keyword vimSyncLinecont contained linecont skipwhite nextgroup=vimSynRegPat
804syn match vimSyncLines contained "\(min\|max\)\=lines=" nextgroup=vimNumber
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100805syn match vimSyncGroupName contained "\h\w*" skipwhite nextgroup=vimSyncKey
Bram Moolenaar5c736222010-01-06 20:54:52 +0100806syn match vimSyncKey contained "\<groupthere\|grouphere\>" skipwhite nextgroup=vimSyncGroup
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100807syn match vimSyncGroup contained "\h\w*" skipwhite nextgroup=vimSynRegPat,vimSyncNone
Bram Moolenaar5c736222010-01-06 20:54:52 +0100808syn keyword vimSyncNone contained NONE
Bram Moolenaar071d4272004-06-13 20:20:40 +0000809
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100810" Additional IsCommand: here by reasons of precedence {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000811" ====================
Bram Moolenaar5c736222010-01-06 20:54:52 +0100812syn match vimIsCommand "<Bar>\s*\a\+" transparent contains=vimCommand,vimNotation
Bram Moolenaar071d4272004-06-13 20:20:40 +0000813
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100814" Highlighting: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000815" ============
dkearns04e53632024-04-11 06:18:37 +1000816syn cluster vimHighlightCluster contains=vimHiLink,vimHiClear,vimHiKeyList,@vimComment
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100817if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimhictermerror")
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200818 syn match vimHiCtermError contained "\D\i*"
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100819endif
Bram Moolenaar5c736222010-01-06 20:54:52 +0100820syn match vimHighlight "\<hi\%[ghlight]\>" skipwhite nextgroup=vimHiBang,@vimHighlightCluster
dkearns9530fe42024-03-19 05:19:51 +1100821syn match vimHiBang contained "\a\@1<=!" skipwhite nextgroup=@vimHighlightCluster
Bram Moolenaard960d762011-09-21 19:22:10 +0200822
Bram Moolenaar5c736222010-01-06 20:54:52 +0100823syn match vimHiGroup contained "\i\+"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000824syn case ignore
dkearnsb614b282024-02-12 03:13:34 +1100825syn keyword vimHiAttrib contained none bold inverse italic nocombine reverse standout strikethrough underline undercurl underdashed underdotted underdouble
Bram Moolenaar5c736222010-01-06 20:54:52 +0100826syn keyword vimFgBgAttrib contained none bg background fg foreground
Bram Moolenaar071d4272004-06-13 20:20:40 +0000827syn case match
Bram Moolenaar5c736222010-01-06 20:54:52 +0100828syn match vimHiAttribList contained "\i\+" contains=vimHiAttrib
829syn match vimHiAttribList contained "\i\+,"he=e-1 contains=vimHiAttrib nextgroup=vimHiAttribList
Bram Moolenaar071d4272004-06-13 20:20:40 +0000830syn case ignore
Bram Moolenaard2ea7cf2021-05-30 20:54:13 +0200831syn 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 +0100832syn match vimHiCtermColor contained "\<color\d\{1,3}\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000833
834syn case match
Bram Moolenaar5c736222010-01-06 20:54:52 +0100835syn match vimHiFontname contained "[a-zA-Z\-*]\+"
836syn match vimHiGuiFontname contained "'[a-zA-Z\-* ]\+'"
837syn match vimHiGuiRgb contained "#\x\{6}"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000838
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000839" Highlighting: hi group key=arg ... {{{2
dkearnsb614b282024-02-12 03:13:34 +1100840syn cluster vimHiCluster contains=vimGroup,vimHiGroup,vimHiTerm,vimHiCTerm,vimHiStartStop,vimHiCtermFgBg,vimHiCtermul,vimHiCtermfont,vimHiGui,vimHiGuiFont,vimHiGuiFgBg,vimHiKeyError,vimNotation,vimComment,vim9comment
dkearns9530fe42024-03-19 05:19:51 +1100841syn 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 +0100842if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_vimhikeyerror")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100843 syn match vimHiKeyError contained "\i\+="he=e-1
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000844endif
Bram Moolenaar5c736222010-01-06 20:54:52 +0100845syn match vimHiTerm contained "\cterm="he=e-1 nextgroup=vimHiAttribList
dkearns9530fe42024-03-19 05:19:51 +1100846syn match vimHiStartStop contained "\c\%(start\|stop\)="he=e-1 nextgroup=vimHiTermcap,vimOption
Bram Moolenaar5c736222010-01-06 20:54:52 +0100847syn match vimHiCTerm contained "\ccterm="he=e-1 nextgroup=vimHiAttribList
Bram Moolenaar83d1b192015-04-13 14:22:40 +0200848syn match vimHiCtermFgBg contained "\ccterm[fb]g="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
Bram Moolenaar2547aa92020-07-26 17:00:44 +0200849syn match vimHiCtermul contained "\cctermul="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
PMuncha606f3a2023-11-15 15:35:49 +0100850syn match vimHiCtermfont contained "\cctermfont="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
Bram Moolenaar5c736222010-01-06 20:54:52 +0100851syn match vimHiGui contained "\cgui="he=e-1 nextgroup=vimHiAttribList
852syn match vimHiGuiFont contained "\cfont="he=e-1 nextgroup=vimHiFontname
853syn match vimHiGuiFgBg contained "\cgui\%([fb]g\|sp\)="he=e-1 nextgroup=vimHiGroup,vimHiGuiFontname,vimHiGuiRgb,vimFgBgAttrib
854syn match vimHiTermcap contained "\S\+" contains=vimNotation
Bram Moolenaar83d1b192015-04-13 14:22:40 +0200855syn match vimHiNmbr contained '\d\+'
Bram Moolenaar071d4272004-06-13 20:20:40 +0000856
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000857" Highlight: clear {{{2
dkearns9530fe42024-03-19 05:19:51 +1100858syn keyword vimHiClear contained clear skipwhite nextgroup=vimGroup,vimHiGroup
Bram Moolenaar071d4272004-06-13 20:20:40 +0000859
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000860" Highlight: link {{{2
Bram Moolenaard2855f52018-07-31 22:23:58 +0200861" see tst24 (hi def vs hi) (Jul 06, 2018)
862"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 +1100863" TODO: simplify and allow line continuations --djk
864syn 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 +0000865
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100866" Control Characters: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000867" ==================
Bram Moolenaar5c736222010-01-06 20:54:52 +0100868syn match vimCtrlChar "[- -]"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000869
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000870" Beginners - Patterns that involve ^ {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000871" =========
dkearns04e53632024-04-11 06:18:37 +1000872if s:vim9script
dkearns059cbe82024-06-12 03:27:53 +1000873 syn region vim9LineComment start=+^[ \t:]*\zs#.*$+ skip=+\n\s*\\\|\n\s*#\\ + end="$" contains=@vimCommentGroup,vimCommentString,vim9CommentTitle
874 syn region vimLineComment start=+^[ \t:]*\zs".*$+ skip=+\n\s*\\\|\n\s*"\\ + end="$" contains=@vimCommentGroup,vimCommentString,vimCommentTitle contained
dkearns04e53632024-04-11 06:18:37 +1000875else
dkearns059cbe82024-06-12 03:27:53 +1000876 syn region vimLineComment start=+^[ \t:]*\zs".*$+ skip=+\n\s*\\\|\n\s*"\\ + end="$" contains=@vimCommentGroup,vimCommentString,vimCommentTitle
877 syn region vim9LineComment start=+^[ \t:]*\zs#.*$+ skip=+\n\s*\\\|\n\s*#\\ + end="$" contains=@vimCommentGroup,vimCommentString,vim9CommentTitle contained
dkearns04e53632024-04-11 06:18:37 +1000878endif
Bram Moolenaar5c736222010-01-06 20:54:52 +0100879syn 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 +1000880syn 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 +1000881
dkearns21ce1592024-01-29 04:54:08 +1100882syn match vimContinue "^\s*\zs\\"
dkearns059cbe82024-06-12 03:27:53 +1000883syn match vimContinueComment '^\s*\zs["#]\\ .*'
dkearns21ce1592024-01-29 04:54:08 +1100884syn cluster vimContinue contains=vimContinue,vimContinueComment
Bram Moolenaar5c736222010-01-06 20:54:52 +0100885syn region vimString start="^\s*\\\z(['"]\)" skip='\\\\\|\\\z1' end="\z1" oneline keepend contains=@vimStringGroup,vimContinue
886syn match vimCommentTitleLeader '"\s\+'ms=s+1 contained
dkearns04e53632024-04-11 06:18:37 +1000887syn match vim9CommentTitleLeader '#\s\+'ms=s+1 contained
Bram Moolenaar071d4272004-06-13 20:20:40 +0000888
Bram Moolenaar18144c82006-04-12 21:52:12 +0000889" Searches And Globals: {{{2
890" ====================
Bram Moolenaar5c736222010-01-06 20:54:52 +0100891syn match vimSearch '^\s*[/?].*' contains=vimSearchDelim
892syn match vimSearchDelim '^\s*\zs[/?]\|[/?]$' contained
dkearns2c51e152024-02-27 07:10:18 +1100893syn region vimGlobal matchgroup=Statement start='\<g\%[lobal]!\=/' skip='\\.' end='/' skipwhite nextgroup=vimSubst1
894syn region vimGlobal matchgroup=Statement start='\<v\%[global]!\=/' skip='\\.' end='/' skipwhite nextgroup=vimSubst1
Bram Moolenaare2f98b92006-03-29 21:18:24 +0000895
dkearns04e53632024-04-11 06:18:37 +1000896" Vim9 Script Regions: {{{2
897" ==================
898
899if s:vim9script
Doug Kearnsce064932024-04-13 18:24:01 +0200900 syn cluster vimLegacyTop contains=TOP,vim9LegacyHeader,vim9Comment,vim9LineComment
901 VimFoldH syn region vim9LegacyHeader start="\%^" end="^\ze\s*vim9s\%[cript]\>" contains=@vimLegacyTop,vimComment,vimLineComment
dkearns04e53632024-04-11 06:18:37 +1000902
Doug Kearnsce064932024-04-13 18:24:01 +0200903 syn keyword vim9Vim9ScriptArg noclear contained
904 syn keyword vim9Vim9Script vim9s[cript] nextgroup=vim9Vim9ScriptArg skipwhite
dkearns04e53632024-04-11 06:18:37 +1000905endif
906
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100907" Embedded Scripts: {{{2
908" ================
909" perl,ruby : Benoit Cerrina
910" python,tcl : Johannes Zellner
911" mzscheme, lua : Charles Campbell
Bram Moolenaar071d4272004-06-13 20:20:40 +0000912
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000913" Allows users to specify the type of embedded script highlighting
914" they want: (perl/python/ruby/tcl support)
915" g:vimsyn_embed == 0 : don't embed any scripts
Bram Moolenaarf3913272016-02-25 00:00:01 +0100916" g:vimsyn_embed =~# 'l' : embed lua (but only if vim supports it)
917" g:vimsyn_embed =~# 'm' : embed mzscheme (but only if vim supports it)
918" g:vimsyn_embed =~# 'p' : embed perl (but only if vim supports it)
919" g:vimsyn_embed =~# 'P' : embed python (but only if vim supports it)
920" g:vimsyn_embed =~# 'r' : embed ruby (but only if vim supports it)
921" g:vimsyn_embed =~# 't' : embed tcl (but only if vim supports it)
Bram Moolenaar7cba6c02013-09-05 22:13:31 +0200922if !exists("g:vimsyn_embed")
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100923 let g:vimsyn_embed= "lmpPr"
Bram Moolenaar7cba6c02013-09-05 22:13:31 +0200924endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000925
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +0200926" [-- lua --] {{{3
Bram Moolenaaradc21822011-04-01 18:03:16 +0200927let s:luapath= fnameescape(expand("<sfile>:p:h")."/lua.vim")
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +0200928if !filereadable(s:luapath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100929 for s:luapath in split(globpath(&rtp,"syntax/lua.vim"),"\n")
930 if filereadable(fnameescape(s:luapath))
931 let s:luapath= fnameescape(s:luapath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +0100932 break
933 endif
934 endfor
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +0200935endif
Bram Moolenaarf3913272016-02-25 00:00:01 +0100936if (g:vimsyn_embed =~# 'l' && has("lua")) && filereadable(s:luapath)
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +0200937 unlet! b:current_syntax
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200938 syn cluster vimFuncBodyList add=vimLuaRegion
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +0200939 exe "syn include @vimLuaScript ".s:luapath
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100940 VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+lua\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimLuaScript
Bram Moolenaar6c1e1572019-06-22 02:13:00 +0200941 VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+lua\s*<<\s*$+ end=+\.$+ contains=@vimLuaScript
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +0200942 syn cluster vimFuncBodyList add=vimLuaRegion
943else
944 syn region vimEmbedError start=+lua\s*<<\s*\z(.*\)$+ end=+^\z1$+
945 syn region vimEmbedError start=+lua\s*<<\s*$+ end=+\.$+
946endif
947unlet s:luapath
948
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000949" [-- perl --] {{{3
Bram Moolenaaradc21822011-04-01 18:03:16 +0200950let s:perlpath= fnameescape(expand("<sfile>:p:h")."/perl.vim")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100951if !filereadable(s:perlpath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100952 for s:perlpath in split(globpath(&rtp,"syntax/perl.vim"),"\n")
953 if filereadable(fnameescape(s:perlpath))
954 let s:perlpath= fnameescape(s:perlpath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +0100955 break
956 endif
957 endfor
Bram Moolenaar5c736222010-01-06 20:54:52 +0100958endif
Bram Moolenaarf3913272016-02-25 00:00:01 +0100959if (g:vimsyn_embed =~# 'p' && has("perl")) && filereadable(s:perlpath)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000960 unlet! b:current_syntax
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200961 syn cluster vimFuncBodyList add=vimPerlRegion
Bram Moolenaar5c736222010-01-06 20:54:52 +0100962 exe "syn include @vimPerlScript ".s:perlpath
Bram Moolenaar15142e22018-04-30 22:19:58 +0200963 VimFoldp syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*\z(\S*\)\ze\(\s*["#].*\)\=$+ end=+^\z1\ze\(\s*[#"].*\)\=$+ contains=@vimPerlScript
964 VimFoldp syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*$+ end=+\.$+ contains=@vimPerlScript
Bram Moolenaar5c736222010-01-06 20:54:52 +0100965 syn cluster vimFuncBodyList add=vimPerlRegion
Bram Moolenaarc236c162008-07-13 17:41:49 +0000966else
967 syn region vimEmbedError start=+pe\%[rl]\s*<<\s*\z(.*\)$+ end=+^\z1$+
968 syn region vimEmbedError start=+pe\%[rl]\s*<<\s*$+ end=+\.$+
Bram Moolenaar071d4272004-06-13 20:20:40 +0000969endif
Bram Moolenaar5c736222010-01-06 20:54:52 +0100970unlet s:perlpath
Bram Moolenaar071d4272004-06-13 20:20:40 +0000971
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000972" [-- ruby --] {{{3
Bram Moolenaaradc21822011-04-01 18:03:16 +0200973let s:rubypath= fnameescape(expand("<sfile>:p:h")."/ruby.vim")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100974if !filereadable(s:rubypath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100975 for s:rubypath in split(globpath(&rtp,"syntax/ruby.vim"),"\n")
976 if filereadable(fnameescape(s:rubypath))
977 let s:rubypath= fnameescape(s:rubypath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +0100978 break
979 endif
980 endfor
Bram Moolenaar5c736222010-01-06 20:54:52 +0100981endif
Bram Moolenaarf3913272016-02-25 00:00:01 +0100982if (g:vimsyn_embed =~# 'r' && has("ruby")) && filereadable(s:rubypath)
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200983 syn cluster vimFuncBodyList add=vimRubyRegion
Bram Moolenaar071d4272004-06-13 20:20:40 +0000984 unlet! b:current_syntax
Bram Moolenaar5c736222010-01-06 20:54:52 +0100985 exe "syn include @vimRubyScript ".s:rubypath
Bram Moolenaar15142e22018-04-30 22:19:58 +0200986 VimFoldr syn region vimRubyRegion matchgroup=vimScriptDelim start=+rub[y]\s*<<\s*\z(\S*\)\ze\(\s*#.*\)\=$+ end=+^\z1\ze\(\s*".*\)\=$+ contains=@vimRubyScript
987 syn region vimRubyRegion matchgroup=vimScriptDelim start=+rub[y]\s*<<\s*$+ end=+\.$+ contains=@vimRubyScript
Bram Moolenaar5c736222010-01-06 20:54:52 +0100988 syn cluster vimFuncBodyList add=vimRubyRegion
Bram Moolenaarc236c162008-07-13 17:41:49 +0000989else
990 syn region vimEmbedError start=+rub[y]\s*<<\s*\z(.*\)$+ end=+^\z1$+
991 syn region vimEmbedError start=+rub[y]\s*<<\s*$+ end=+\.$+
Bram Moolenaar071d4272004-06-13 20:20:40 +0000992endif
Bram Moolenaar5c736222010-01-06 20:54:52 +0100993unlet s:rubypath
Bram Moolenaar071d4272004-06-13 20:20:40 +0000994
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000995" [-- python --] {{{3
Bram Moolenaaradc21822011-04-01 18:03:16 +0200996let s:pythonpath= fnameescape(expand("<sfile>:p:h")."/python.vim")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100997if !filereadable(s:pythonpath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100998 for s:pythonpath in split(globpath(&rtp,"syntax/python.vim"),"\n")
999 if filereadable(fnameescape(s:pythonpath))
1000 let s:pythonpath= fnameescape(s:pythonpath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +01001001 break
1002 endif
1003 endfor
Bram Moolenaar5c736222010-01-06 20:54:52 +01001004endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001005if g:vimsyn_embed =~# 'P' && has("pythonx") && filereadable(s:pythonpath)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001006 unlet! b:current_syntax
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001007 syn cluster vimFuncBodyList add=vimPythonRegion
Bram Moolenaar5c736222010-01-06 20:54:52 +01001008 exe "syn include @vimPythonScript ".s:pythonpath
Bram Moolenaar6304be62021-11-27 10:57:26 +00001009 VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon][3x]\=\s*<<\s*\%(trim\s*\)\=\z(\S*\)\ze\(\s*#.*\)\=$+ end=+^\z1\ze\(\s*".*\)\=$+ contains=@vimPythonScript
1010 VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon][3x]\=\s*<<\s*\%(trim\s*\)\=$+ end=+\.$+ contains=@vimPythonScript
1011 VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+Py\%[thon]2or3\s*<<\s*\%(trim\s*\)\=\z(\S*\)\ze\(\s*#.*\)\=$+ end=+^\z1\ze\(\s*".*\)\=$+ contains=@vimPythonScript
1012 VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+Py\%[thon]2or3\=\s*<<\s*\%(trim\s*\)\=$+ end=+\.$+ contains=@vimPythonScript
Bram Moolenaar5c736222010-01-06 20:54:52 +01001013 syn cluster vimFuncBodyList add=vimPythonRegion
Bram Moolenaarc236c162008-07-13 17:41:49 +00001014else
Bram Moolenaarfa01c392010-07-20 12:36:02 +02001015 syn region vimEmbedError start=+py\%[thon]3\=\s*<<\s*\z(.*\)$+ end=+^\z1$+
1016 syn region vimEmbedError start=+py\%[thon]3\=\s*<<\s*$+ end=+\.$+
Bram Moolenaar071d4272004-06-13 20:20:40 +00001017endif
Bram Moolenaar5c736222010-01-06 20:54:52 +01001018unlet s:pythonpath
Bram Moolenaar071d4272004-06-13 20:20:40 +00001019
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001020" [-- tcl --] {{{3
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001021if has("win32") || has("win95") || has("win64") || has("win16")
1022 " apparently has("tcl") has been hanging vim on some windows systems with cygwin
1023 let s:trytcl= (&shell !~ '\<\%(bash\>\|4[nN][tT]\|\<zsh\)\>\%(\.exe\)\=$')
1024else
1025 let s:trytcl= 1
1026endif
Bram Moolenaara6878372014-03-22 21:02:50 +01001027if s:trytcl
1028 let s:tclpath= fnameescape(expand("<sfile>:p:h")."/tcl.vim")
1029 if !filereadable(s:tclpath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001030 for s:tclpath in split(globpath(&rtp,"syntax/tcl.vim"),"\n")
1031 if filereadable(fnameescape(s:tclpath))
1032 let s:tclpath= fnameescape(s:tclpath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +01001033 break
1034 endif
1035 endfor
Bram Moolenaar5c736222010-01-06 20:54:52 +01001036 endif
Bram Moolenaarf3913272016-02-25 00:00:01 +01001037 if (g:vimsyn_embed =~# 't' && has("tcl")) && filereadable(s:tclpath)
Bram Moolenaara6878372014-03-22 21:02:50 +01001038 unlet! b:current_syntax
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001039 syn cluster vimFuncBodyList add=vimTclRegion
Bram Moolenaara6878372014-03-22 21:02:50 +01001040 exe "syn include @vimTclScript ".s:tclpath
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001041 VimFoldt syn region vimTclRegion matchgroup=vimScriptDelim start=+tc[l]\=\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimTclScript
1042 VimFoldt syn region vimTclRegion matchgroup=vimScriptDelim start=+tc[l]\=\s*<<\s*$+ end=+\.$+ contains=@vimTclScript
Bram Moolenaara6878372014-03-22 21:02:50 +01001043 syn cluster vimFuncBodyList add=vimTclScript
1044 else
1045 syn region vimEmbedError start=+tc[l]\=\s*<<\s*\z(.*\)$+ end=+^\z1$+
1046 syn region vimEmbedError start=+tc[l]\=\s*<<\s*$+ end=+\.$+
1047 endif
1048 unlet s:tclpath
Bram Moolenaarc236c162008-07-13 17:41:49 +00001049else
1050 syn region vimEmbedError start=+tc[l]\=\s*<<\s*\z(.*\)$+ end=+^\z1$+
1051 syn region vimEmbedError start=+tc[l]\=\s*<<\s*$+ end=+\.$+
Bram Moolenaar9964e462007-05-05 17:54:07 +00001052endif
Bram Moolenaara6878372014-03-22 21:02:50 +01001053unlet s:trytcl
Bram Moolenaar071d4272004-06-13 20:20:40 +00001054
Bram Moolenaar8299df92004-07-10 09:47:34 +00001055" [-- mzscheme --] {{{3
Bram Moolenaaradc21822011-04-01 18:03:16 +02001056let s:mzschemepath= fnameescape(expand("<sfile>:p:h")."/scheme.vim")
Bram Moolenaar5c736222010-01-06 20:54:52 +01001057if !filereadable(s:mzschemepath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001058 for s:mzschemepath in split(globpath(&rtp,"syntax/mzscheme.vim"),"\n")
1059 if filereadable(fnameescape(s:mzschemepath))
1060 let s:mzschemepath= fnameescape(s:mzschemepath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +01001061 break
1062 endif
1063 endfor
Bram Moolenaar5c736222010-01-06 20:54:52 +01001064endif
Bram Moolenaarf3913272016-02-25 00:00:01 +01001065if (g:vimsyn_embed =~# 'm' && has("mzscheme")) && filereadable(s:mzschemepath)
Bram Moolenaar8299df92004-07-10 09:47:34 +00001066 unlet! b:current_syntax
Bram Moolenaar03413f42016-04-12 21:07:15 +02001067 let s:iskKeep= &isk
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +02001068 syn cluster vimFuncBodyList add=vimMzSchemeRegion
Bram Moolenaar5c736222010-01-06 20:54:52 +01001069 exe "syn include @vimMzSchemeScript ".s:mzschemepath
Bram Moolenaar03413f42016-04-12 21:07:15 +02001070 let &isk= s:iskKeep
1071 unlet s:iskKeep
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001072 VimFoldm syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimMzSchemeScript
1073 VimFoldm syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*$+ end=+\.$+ contains=@vimMzSchemeScript
Bram Moolenaar5c736222010-01-06 20:54:52 +01001074 syn cluster vimFuncBodyList add=vimMzSchemeRegion
Bram Moolenaarc236c162008-07-13 17:41:49 +00001075else
1076 syn region vimEmbedError start=+mz\%[scheme]\s*<<\s*\z(.*\)$+ end=+^\z1$+
1077 syn region vimEmbedError start=+mz\%[scheme]\s*<<\s*$+ end=+\.$+
Bram Moolenaar8299df92004-07-10 09:47:34 +00001078endif
Bram Moolenaar5c736222010-01-06 20:54:52 +01001079unlet s:mzschemepath
Bram Moolenaar8299df92004-07-10 09:47:34 +00001080
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001081" Synchronize (speed) {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001082"============
Bram Moolenaar3577c6f2008-06-24 21:16:56 +00001083if exists("g:vimsyn_minlines")
1084 exe "syn sync minlines=".g:vimsyn_minlines
Bram Moolenaar071d4272004-06-13 20:20:40 +00001085endif
Bram Moolenaar03413f42016-04-12 21:07:15 +02001086exe "syn sync maxlines=".s:vimsyn_maxlines
Bram Moolenaar071d4272004-06-13 20:20:40 +00001087syn sync linecont "^\s\+\\"
dkearns62b26042024-03-10 03:43:28 +11001088syn sync linebreaks=1
Bram Moolenaar071d4272004-06-13 20:20:40 +00001089syn sync match vimAugroupSyncA groupthere NONE "\<aug\%[roup]\>\s\+[eE][nN][dD]"
1090
Bram Moolenaar5c736222010-01-06 20:54:52 +01001091" ====================
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001092" Highlighting Settings {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001093" ====================
1094
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001095if !exists("skip_vim_syntax_inits")
1096 if !exists("g:vimsyn_noerror")
1097 hi def link vimBehaveError vimError
1098 hi def link vimCollClassErr vimError
1099 hi def link vimErrSetting vimError
1100 hi def link vimEmbedError vimError
1101 hi def link vimFTError vimError
1102 hi def link vimFunctionError vimError
1103 hi def link vimFunc vimError
1104 hi def link vimHiAttribList vimError
1105 hi def link vimHiCtermError vimError
1106 hi def link vimHiKeyError vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001107 hi def link vimMapModErr vimError
1108 hi def link vimSubstFlagErr vimError
1109 hi def link vimSynCaseError vimError
Brad Kingd4634a22024-01-03 10:17:24 -05001110 hi def link vimSynFoldMethodError vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001111 hi def link vimBufnrWarn vimWarn
1112 endif
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001113
Doug Kearnsce064932024-04-13 18:24:01 +02001114 hi def link vim9Vim9ScriptArg Special
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001115 hi def link vimAbb vimCommand
1116 hi def link vimAddress vimMark
dkearnsc4aef9a2024-03-04 02:42:47 +11001117 hi def link vimAugroupBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001118 hi def link vimAugroupError vimError
1119 hi def link vimAugroupKey vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001120 hi def link vimAutoCmd vimCommand
1121 hi def link vimAutoEvent Type
Bram Moolenaard58a3bf2020-09-28 21:48:16 +02001122 hi def link vimAutoCmdMod Special
dkearnsb614b282024-02-12 03:13:34 +11001123 hi def link vimBang vimOper
dkearns2c51e152024-02-27 07:10:18 +11001124 hi def link vimBehaveBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001125 hi def link vimBehaveModel vimBehave
1126 hi def link vimBehave vimCommand
1127 hi def link vimBracket Delimiter
dkearnsa3bddb72024-06-14 01:48:10 +10001128 hi def link vimCatch vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001129 hi def link vimCmplxRepeat SpecialChar
1130 hi def link vimCommand Statement
1131 hi def link vimComment Comment
Bram Moolenaar2c7f8c52020-04-20 19:52:53 +02001132 hi def link vim9Comment Comment
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001133 hi def link vimCommentString vimString
1134 hi def link vimCommentTitle PreProc
dkearns04e53632024-04-11 06:18:37 +10001135 hi def link vim9CommentTitle PreProc
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001136 hi def link vimCondHL vimCommand
dkearnsf6869212023-12-11 01:53:24 +11001137 hi def link vimConst vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001138 hi def link vimContinue Special
dkearns21ce1592024-01-29 04:54:08 +11001139 hi def link vimContinueComment vimComment
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001140 hi def link vimCtrlChar SpecialChar
dkearns35e6f4c2024-03-22 06:41:10 +11001141 hi def link vimDefComment vimComment
1142 hi def link vimDefKey vimCommand
1143 hi def link vimDefParam vimVar
dkearnsb1427b42024-02-28 05:59:30 +11001144 hi def link vimEcho vimCommand
dkearns61887b32024-03-15 23:45:48 +11001145 hi def link vimEchohlNone vimGroup
1146 hi def link vimEchohl vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001147 hi def link vimElseIfErr Error
dkearns35e6f4c2024-03-22 06:41:10 +11001148 hi def link vimEndfunction vimCommand
1149 hi def link vimEnddef vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001150 hi def link vimEnvvar PreProc
1151 hi def link vimError Error
Bram Moolenaar6ba83ba2022-06-12 22:15:57 +01001152 hi def link vimEscape Special
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001153 hi def link vimFBVar vimVar
1154 hi def link vimFgBgAttrib vimHiAttrib
Bram Moolenaarcbaff5e2022-04-08 17:45:08 +01001155 hi def link vimFuncEcho vimCommand
dkearns1c97b5c2023-12-13 02:47:43 +11001156 hi def link vimFor vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001157 hi def link vimFTCmd vimCommand
1158 hi def link vimFTOption vimSynType
dkearns35e6f4c2024-03-22 06:41:10 +11001159 hi def link vimFuncBang vimBang
1160 hi def link vimFuncComment vimComment
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001161 hi def link vimFuncKey vimCommand
1162 hi def link vimFuncName Function
dkearns35e6f4c2024-03-22 06:41:10 +11001163 hi def link vimFuncMod Special
1164 hi def link vimFuncParam vimVar
1165 hi def link vimFuncParamEquals vimOper
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001166 hi def link vimFuncSID Special
1167 hi def link vimFuncVar Identifier
1168 hi def link vimGroupAdd vimSynOption
1169 hi def link vimGroupName vimGroup
1170 hi def link vimGroupRem vimSynOption
1171 hi def link vimGroupSpecial Special
1172 hi def link vimGroup Type
1173 hi def link vimHiAttrib PreProc
dkearnsb614b282024-02-12 03:13:34 +11001174 hi def link vimHiBang vimBang
dkearns9530fe42024-03-19 05:19:51 +11001175 hi def link vimHiClear Type
1176 hi def link vimHiCtermColor Constant
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001177 hi def link vimHiCtermFgBg vimHiTerm
dkearns9530fe42024-03-19 05:19:51 +11001178 hi def link vimHiCtermfont vimHiTerm
1179 hi def link vimHiCtermul vimHiTerm
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001180 hi def link vimHiCTerm vimHiTerm
1181 hi def link vimHighlight vimCommand
1182 hi def link vimHiGroup vimGroupName
1183 hi def link vimHiGuiFgBg vimHiTerm
1184 hi def link vimHiGuiFont vimHiTerm
1185 hi def link vimHiGuiRgb vimNumber
1186 hi def link vimHiGui vimHiTerm
1187 hi def link vimHiNmbr Number
1188 hi def link vimHiStartStop vimHiTerm
1189 hi def link vimHiTerm Type
1190 hi def link vimHLGroup vimGroup
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001191 hi def link vimInsert vimString
1192 hi def link vimIskSep Delimiter
dkearns04e53632024-04-11 06:18:37 +10001193 hi def link vim9KeymapLineComment vimKeymapLineComment
dkearns69866442023-11-22 05:43:40 +11001194 hi def link vimKeymapLineComment vimComment
1195 hi def link vimKeymapTailComment vimComment
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001196 hi def link vimLet vimCommand
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001197 hi def link vimLetHereDoc vimString
1198 hi def link vimLetHereDocStart Special
1199 hi def link vimLetHereDocStop Special
dkearnsf6869212023-12-11 01:53:24 +11001200 hi def link vimLetRegister Special
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001201 hi def link vimLineComment vimComment
Bram Moolenaar2c7f8c52020-04-20 19:52:53 +02001202 hi def link vim9LineComment vimComment
dkearnsb614b282024-02-12 03:13:34 +11001203 hi def link vimMapBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001204 hi def link vimMapModKey vimFuncSID
1205 hi def link vimMapMod vimBracket
1206 hi def link vimMap vimCommand
1207 hi def link vimMark Number
1208 hi def link vimMarkNumber vimNumber
dkearnsb614b282024-02-12 03:13:34 +11001209 hi def link vimMenuBang vimBang
dkearns62b26042024-03-10 03:43:28 +11001210 hi def link vimMenuClear Special
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001211 hi def link vimMenuMod vimMapMod
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001212 hi def link vimMenuName PreProc
dkearns62b26042024-03-10 03:43:28 +11001213 hi def link vimMenu vimCommand
1214 hi def link vimMenuNotation vimNotation
1215 hi def link vimMenuPriority Number
1216 hi def link vimMenuStatus Special
1217 hi def link vimMenutranslateComment vimComment
Aliaksei Budavei80aabaa2024-03-31 19:26:32 +03001218 hi def link vimMethodName vimFuncName
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001219 hi def link vimMtchComment vimComment
1220 hi def link vimNorm vimCommand
1221 hi def link vimNotation Special
1222 hi def link vimNotFunc vimCommand
1223 hi def link vimNotPatSep vimString
1224 hi def link vimNumber Number
1225 hi def link vimOperError Error
1226 hi def link vimOper Operator
1227 hi def link vimOption PreProc
1228 hi def link vimParenSep Delimiter
Bram Moolenaard2855f52018-07-31 22:23:58 +02001229 hi def link vimPatSepErr vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001230 hi def link vimPatSepR vimPatSep
1231 hi def link vimPatSep SpecialChar
1232 hi def link vimPatSepZone vimString
1233 hi def link vimPatSepZ vimPatSep
1234 hi def link vimPattern Type
1235 hi def link vimPlainMark vimMark
1236 hi def link vimPlainRegister vimRegister
1237 hi def link vimRegister SpecialChar
1238 hi def link vimScriptDelim Comment
1239 hi def link vimSearchDelim Statement
1240 hi def link vimSearch vimString
1241 hi def link vimSep Delimiter
1242 hi def link vimSetMod vimOption
1243 hi def link vimSetSep Statement
1244 hi def link vimSetString vimString
Doug Kearnsce064932024-04-13 18:24:01 +02001245 hi def link vim9Vim9Script vimCommand
Doug Kearns262e25e2024-06-14 20:16:35 +02001246 hi def link vimSleep vimCommand
1247 hi def link vimSleepArg Constant
1248 hi def link vimSleepBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001249 hi def link vimSpecFile Identifier
1250 hi def link vimSpecFileMod vimSpecFile
1251 hi def link vimSpecial Type
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001252 hi def link vimStringCont vimString
1253 hi def link vimString String
Bram Moolenaard2855f52018-07-31 22:23:58 +02001254 hi def link vimStringEnd vimString
thincacf8695d2024-01-28 18:57:23 +01001255 hi def link vimStringInterpolationBrace vimEscape
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001256 hi def link vimSubst1 vimSubst
1257 hi def link vimSubstDelim Delimiter
1258 hi def link vimSubstFlags Special
1259 hi def link vimSubstSubstr SpecialChar
1260 hi def link vimSubstTwoBS vimString
1261 hi def link vimSubst vimCommand
1262 hi def link vimSynCaseError Error
1263 hi def link vimSynCase Type
1264 hi def link vimSyncC Type
1265 hi def link vimSyncError Error
1266 hi def link vimSyncGroupName vimGroupName
1267 hi def link vimSyncGroup vimGroupName
1268 hi def link vimSyncKey Type
1269 hi def link vimSyncNone Type
1270 hi def link vimSynContains vimSynOption
1271 hi def link vimSynError Error
Brad Kingd4634a22024-01-03 10:17:24 -05001272 hi def link vimSynFoldMethodError Error
1273 hi def link vimSynFoldMethod Type
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001274 hi def link vimSynKeyContainedin vimSynContains
1275 hi def link vimSynKeyOpt vimSynOption
dkearnsc79646d2024-01-05 08:58:48 +11001276 hi def link vimSynCchar vimSynOption
1277 hi def link vimSynCcharValue Character
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001278 hi def link vimSynMtchGrp vimSynOption
1279 hi def link vimSynMtchOpt vimSynOption
1280 hi def link vimSynNextgroup vimSynOption
1281 hi def link vimSynNotPatRange vimSynRegPat
1282 hi def link vimSynOption Special
1283 hi def link vimSynPatRange vimString
1284 hi def link vimSynRegOpt vimSynOption
1285 hi def link vimSynRegPat vimString
1286 hi def link vimSynReg Type
1287 hi def link vimSyntax vimCommand
1288 hi def link vimSynType vimSpecial
dkearnsa3bddb72024-06-14 01:48:10 +10001289 hi def link vimThrow vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001290 hi def link vimTodo Todo
Bram Moolenaar4d8f4762021-06-27 15:18:56 +02001291 hi def link vimType Type
dkearnsf6869212023-12-11 01:53:24 +11001292 hi def link vimUnlet vimCommand
dkearnsb614b282024-02-12 03:13:34 +11001293 hi def link vimUnletBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001294 hi def link vimUnmap vimMap
1295 hi def link vimUserAttrbCmpltFunc Special
1296 hi def link vimUserAttrbCmplt vimSpecial
1297 hi def link vimUserAttrbKey vimOption
1298 hi def link vimUserAttrb vimSpecial
1299 hi def link vimUserAttrbError Error
1300 hi def link vimUserCmdError Error
1301 hi def link vimUserCommand vimCommand
1302 hi def link vimUserFunc Normal
1303 hi def link vimVar Identifier
1304 hi def link vimWarn WarningMsg
1305endif
Bram Moolenaar071d4272004-06-13 20:20:40 +00001306
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001307" Current Syntax Variable: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001308let b:current_syntax = "vim"
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001309
1310" ---------------------------------------------------------------------
1311" Cleanup: {{{1
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001312delc VimFolda
1313delc VimFoldf
Doug Kearnsce064932024-04-13 18:24:01 +02001314delc VimFoldh
1315delc VimFoldH
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001316delc VimFoldl
1317delc VimFoldm
1318delc VimFoldp
1319delc VimFoldP
1320delc VimFoldr
1321delc VimFoldt
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001322let &cpo = s:keepcpo
dkearns04e53632024-04-11 06:18:37 +10001323unlet s:keepcpo s:vim9script
dkearns5d67aef2024-03-10 04:01:22 +11001324" vim:ts=18 fdm=marker ft=vim