blob: ece39918b25c610e3caad05527fde09f8c9f9ad4 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
h-east9b53c052024-02-13 21:09:22 +01002" Language: Vim script
3" Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com>
h-east5c3855b2024-02-14 21:00:01 +01004" Doug Kearns <dougkearns@gmail.com>
h-east9b53c052024-02-13 21:09:22 +01005" URL: https://github.com/vim-jp/syntax-vim-ex
Aliaksei Budaveidfcef892024-02-18 21:02:14 +03006" Last Change: Feb 18, 2024
h-east9b53c052024-02-13 21:09:22 +01007" Former Maintainer: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
8" Base File URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM
9" Base File Version: 9.0-25
h-east9b53c052024-02-13 21:09:22 +010010
11" DO NOT CHANGE DIRECTLY.
12" THIS FILE PARTLY GENERATED BY gen_syntax_vim.vim.
13" (Search string "GEN_SYN_VIM:" in this file)
14
Bram Moolenaar071d4272004-06-13 20:20:40 +000015" Automatically generated keyword lists: {{{1
16
17" Quit when a syntax file was already loaded {{{2
18if exists("b:current_syntax")
19 finish
20endif
Bram Moolenaar113cb512021-11-07 20:27:04 +000021let s:keepcpo= &cpo
Bram Moolenaar6be7f872012-01-20 21:08:56 +010022set cpo&vim
Bram Moolenaar071d4272004-06-13 20:20:40 +000023
24" 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=''
31syn keyword vimCommand contained abc[lear] 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] cabc[lear] cabo[ve] cad[dbuffer] cadde[xpr] caddf[ile] caf[ter] cal[l] cat[ch] 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]
32syn keyword vimCommand contained com[mand] comc[lear] comp[iler] con[tinue] conf[irm] cons[t] cope[n] cp[revious] cpf[ile] cq[uit] cr[ewind] cs[cope] cst[ag] cuna[bbrev] cw[indow] d[elete] delm[arks] deb[ug] debugg[reedy] def 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] echoe[rr] echom[sg] echoc[onsole] echon echow[indow] el[se] elsei[f] em[enu] en[dif] endin[terface] endc[lass] endd[ef] ende[num] endf[unction] 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]
33syn keyword vimCommand contained foldd[oopen] folddoc[losed] foldo[pen] for fu[nction] g[lobal] go[to] gr[ep] grepa[dd] gu[i] gv[im] h[elp] helpc[lose] helpf[ind] helpg[rep] helpt[ags] ha[rdcopy] hi[ghlight] hid[e] his[tory] ho[rizontal] iabc[lear] if ij[ump] il[ist] imp[ort] int[ro] inte[rface] is[earch] isp[lit] iuna[bbrev] 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]
Aliaksei Budaveidfcef892024-02-18 21:02:14 +030034syn keyword vimCommand contained 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] 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] popu[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]
h-east9b53c052024-02-13 21:09:22 +010035syn keyword vimCommand contained 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] 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] sl[eep] 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]
36syn keyword vimCommand contained stat[ic] stopi[nsert] stj[ump] sts[elect] sun[hide] sus[pend] sv[iew] sw[apname] synti[me] sync[bind] smi[le] t tN[ext] ta[g] tags tab tabc[lose] tabd[o] tabe[dit] tabf[ind] tabfir[st] tabm[ove] tabl[ast] tabn[ext] tabnew tabo[nly] tabp[revious] tabN[ext] tabr[ewind] tabs tc[d] tch[dir] tcl tcld[o] tclf[ile] te[aroff] ter[minal] tf[irst] th[row] thi[s] tj[ump] tl[ast] tm[enu] tn[ext] to[pleft] tp[revious] tr[ewind] try ts[elect] tu[nmenu] ty[pe] u[ndo] undoj[oin] undol[ist] una[bbreviate] 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] vim9s[cript] viu[sage] vne[w] vs[plit] w[rite] wN[ext] wa[ll] wh[ile] wi[nsize] winc[md] wind[o] winp[os]
h-east5c3855b2024-02-14 21:00:01 +010037syn keyword vimCommand contained 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 +010038syn keyword vimCommand contained 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] unme[nu] vme[nu] vnoreme[nu] vunme[nu] xme[nu] xnoreme[nu] xunme[nu]
39syn keyword vimCommand contained 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]
40syn keyword vimCommand contained cmapc[lear] imapc[lear] lmapc[lear] mapc[lear] nmapc[lear] omapc[lear] smapc[lear] tmapc[lear] vmapc[lear] xmapc[lear]
41syn keyword vimCommand contained cu[nmap] iu[nmap] lu[nmap] nun[map] ou[nmap] sunm[ap] tunma[p] unm[ap] vu[nmap] xu[nmap]
42
43syn keyword vimCommand contained 2mat[ch] 3mat[ch]
44
Aliaksei Budaveidfcef892024-02-18 21:02:14 +030045" Lower priority for _new_ to distinguish constructors from the command.
46syn match vimCommand contained "\<new\>(\@!"
Bram Moolenaare2719092015-01-10 15:09:25 +010047syn match vimCommand contained "\<z[-+^.=]\=\>"
h-east9b53c052024-02-13 21:09:22 +010048syn 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 +000049
50" vimOptions are caught only when contained in a vimSet {{{2
h-east9b53c052024-02-13 21:09:22 +010051" GEN_SYN_VIM: vimOption normal, START_STR='syn keyword vimOption contained', END_STR=''
52syn 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
53syn 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
54syn 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
55syn 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
56syn 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
57syn 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
58syn 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
59syn 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 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 +000060
61" vimOptions: These are the turn-off setting variants {{{2
h-east9b53c052024-02-13 21:09:22 +010062" GEN_SYN_VIM: vimOption turn-off, START_STR='syn keyword vimOption contained', END_STR=''
63syn 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
64syn 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
65syn 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 nowfh nowinfixheight nowfw nowinfixwidth nowrap nows nowrapscan nowrite nowa nowriteany nowb nowritebackup
66syn keyword vimOption contained noxtermcodes
Bram Moolenaar071d4272004-06-13 20:20:40 +000067
68" vimOptions: These are the invertible variants {{{2
h-east9b53c052024-02-13 21:09:22 +010069" GEN_SYN_VIM: vimOption invertible, START_STR='syn keyword vimOption contained', END_STR=''
70syn 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
71syn 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
72syn 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
73syn keyword vimOption contained invtf invttyfast invudf invundofile invvb invvisualbell invwarn invwiv invweirdinvert invwic invwildignorecase invwmnu invwildmenu invwfh invwinfixheight invwfw invwinfixwidth invwrap invws invwrapscan invwrite invwa invwriteany invwb invwritebackup invxtermcodes
Bram Moolenaar071d4272004-06-13 20:20:40 +000074
75" termcap codes (which can also be set) {{{2
h-east9b53c052024-02-13 21:09:22 +010076" GEN_SYN_VIM: vimOption term output code, START_STR='syn keyword vimOption contained', END_STR=''
77syn 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
78" term key codes
79syn 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 +010080syn match vimOption contained "t_%1"
Bram Moolenaar071d4272004-06-13 20:20:40 +000081syn match vimOption contained "t_#2"
82syn match vimOption contained "t_#4"
Bram Moolenaar6d5ad4c2016-10-27 17:00:16 +020083syn match vimOption contained "t_@7"
Bram Moolenaarb0d45e72017-11-05 18:19:24 +010084syn match vimOption contained "t_*7"
85syn match vimOption contained "t_&8"
86syn match vimOption contained "t_%i"
Bram Moolenaar071d4272004-06-13 20:20:40 +000087syn match vimOption contained "t_k;"
88
Bram Moolenaar03413f42016-04-12 21:07:15 +020089" unsupported settings: some were supported by vi but don't do anything in vim {{{2
h-east9b53c052024-02-13 21:09:22 +010090" GEN_SYN_VIM: Missing vimOption, START_STR='syn keyword vimErrSetting contained', END_STR=''
91syn 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
92syn 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
93syn 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 +000094
Bram Moolenaar80a94a52006-02-23 21:26:58 +000095" AutoCmd Events {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +000096syn case ignore
h-east9b53c052024-02-13 21:09:22 +010097" GEN_SYN_VIM: vimAutoEvent, START_STR='syn keyword vimAutoEvent contained', END_STR=''
98syn keyword vimAutoEvent contained BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWritePost BufWritePre BufWriteCmd CmdlineChanged CmdlineEnter CmdlineLeave CmdwinEnter CmdwinLeave CmdUndefined ColorScheme ColorSchemePre CompleteChanged CompleteDone CompleteDonePre CursorHold CursorHoldI CursorMoved CursorMovedI DiffUpdated DirChanged DirChangedPre EncodingChanged ExitPre FileEncoding FileAppendPost FileAppendPre FileAppendCmd FileChangedShell FileChangedShellPost FileChangedRO FileReadPost FileReadPre FileReadCmd FileType FileWritePost FileWritePre FileWriteCmd FilterReadPost FilterReadPre FilterWritePost FilterWritePre
99syn keyword vimAutoEvent contained FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertEnter InsertLeave InsertLeavePre InsertCharPre MenuPopup ModeChanged OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SafeState SafeStateAgain SessionLoadPost ShellCmdPost ShellFilterPost SigUSR1 SourceCmd SourcePre SourcePost SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabNew TabClosed TabEnter TabLeave TermChanged TerminalOpen TerminalWinOpen TermResponse TermResponseAll TextChanged TextChangedI TextChangedP TextChangedT User VimEnter VimLeave VimLeavePre WinNewPre WinNew WinClosed WinEnter WinLeave WinResized WinScrolled VimResized TextYankPost VimSuspend VimResume
Bram Moolenaar071d4272004-06-13 20:20:40 +0000100
101" Highlight commonly used Groupnames {{{2
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200102syn 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 +0000103
104" Default highlighting groups {{{2
h-east9b53c052024-02-13 21:09:22 +0100105" GEN_SYN_VIM: vimHLGroup, START_STR='syn keyword vimHLGroup contained', END_STR=''
h-east5c3855b2024-02-14 21:00:01 +0100106syn keyword vimHLGroup contained ErrorMsg IncSearch ModeMsg NonText StatusLine StatusLineNC EndOfBuffer VertSplit VisualNOS DiffText PmenuSbar TabLineSel TabLineFill Cursor lCursor QuickFixLine CursorLineSign CursorLineFold CurSearch PmenuKind PmenuKindSel 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 Conceal MatchParen StatusLineTerm StatusLineTermNC ToolbarLine ToolbarButton Menu Tooltip Scrollbar CursorIM LineNrAbove LineNrBelow
Bram Moolenaar071d4272004-06-13 20:20:40 +0000107syn case match
108
109" Function Names {{{2
h-east9b53c052024-02-13 21:09:22 +0100110" GEN_SYN_VIM: vimFuncName, START_STR='syn keyword vimFuncName contained', END_STR=''
111syn 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
112syn 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 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 getcharmod
113syn keyword vimFuncName contained 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 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 instanceof interrupt invert isabsolutepath
114syn keyword vimFuncName contained 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 popup_findinfo popup_findpreview popup_getoptions
115syn keyword vimFuncName contained 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 screenchars screencol screenpos screenrow screenstring
116syn keyword vimFuncName contained 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 strgetchar stridx string strlen strpart strptime strridx
117syn keyword vimFuncName contained 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 test_ignore_error test_mswin_event test_null_blob
118syn keyword vimFuncName contained 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 xor
Bram Moolenaar071d4272004-06-13 20:20:40 +0000119
Bram Moolenaarac7bd632013-03-19 11:35:58 +0100120"--- syntax here and above generated by mkvimvim ---
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000121" Special Vim Highlighting (not automatic) {{{1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000122
Bram Moolenaar71badf92023-04-22 22:40:14 +0100123" Set up folding commands for this syntax highlighting file {{{2
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100124if exists("g:vimsyn_folding") && g:vimsyn_folding =~# '[afhlmpPrt]'
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200125 if g:vimsyn_folding =~# 'a'
126 com! -nargs=* VimFolda <args> fold
127 else
128 com! -nargs=* VimFolda <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100129 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200130 if g:vimsyn_folding =~# 'f'
131 com! -nargs=* VimFoldf <args> fold
132 else
133 com! -nargs=* VimFoldf <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100134 endif
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100135 if g:vimsyn_folding =~# 'h'
136 com! -nargs=* VimFoldh <args> fold
137 else
138 com! -nargs=* VimFoldh <args>
139 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200140 if g:vimsyn_folding =~# 'l'
141 com! -nargs=* VimFoldl <args> fold
142 else
143 com! -nargs=* VimFoldl <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100144 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200145 if g:vimsyn_folding =~# 'm'
146 com! -nargs=* VimFoldm <args> fold
147 else
148 com! -nargs=* VimFoldm <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100149 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200150 if g:vimsyn_folding =~# 'p'
151 com! -nargs=* VimFoldp <args> fold
152 else
153 com! -nargs=* VimFoldp <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100154 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200155 if g:vimsyn_folding =~# 'P'
156 com! -nargs=* VimFoldP <args> fold
157 else
158 com! -nargs=* VimFoldP <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100159 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200160 if g:vimsyn_folding =~# 'r'
161 com! -nargs=* VimFoldr <args> fold
162 else
163 com! -nargs=* VimFoldr <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100164 endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200165 if g:vimsyn_folding =~# 't'
166 com! -nargs=* VimFoldt <args> fold
167 else
168 com! -nargs=* VimFoldt <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100169 endif
170else
171 com! -nargs=* VimFolda <args>
172 com! -nargs=* VimFoldf <args>
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100173 com! -nargs=* VimFoldh <args>
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100174 com! -nargs=* VimFoldl <args>
175 com! -nargs=* VimFoldm <args>
176 com! -nargs=* VimFoldp <args>
177 com! -nargs=* VimFoldP <args>
178 com! -nargs=* VimFoldr <args>
179 com! -nargs=* VimFoldt <args>
180endif
181
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000182" Deprecated variable options {{{2
183if exists("g:vim_minlines")
184 let g:vimsyn_minlines= g:vim_minlines
185endif
186if exists("g:vim_maxlines")
187 let g:vimsyn_maxlines= g:vim_maxlines
188endif
189if exists("g:vimsyntax_noerror")
190 let g:vimsyn_noerror= g:vimsyntax_noerror
191endif
192
Bram Moolenaar03413f42016-04-12 21:07:15 +0200193" Variable options {{{2
194if exists("g:vim_maxlines")
195 let s:vimsyn_maxlines= g:vim_maxlines
196else
197 let s:vimsyn_maxlines= 60
198endif
199
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000200" Numbers {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000201" =======
Bram Moolenaar4072ba52020-12-23 13:56:35 +0100202syn match vimNumber '\<\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=' skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment,vim9Comment
203syn match vimNumber '-\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=' skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment,vim9Comment
204syn match vimNumber '\<0[xX]\x\+' skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment,vim9Comment
205syn match vimNumber '\%(^\|\A\)\zs#\x\{6}' skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment,vim9Comment
206syn match vimNumber '\<0[zZ][a-zA-Z0-9.]\+' skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment,vim9Comment
Hugo van de Vliertb5352932024-01-03 18:03:29 +0100207syn match vimNumber '0[0-7]\+' skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment,vim9Comment
208syn match vimNumber '0[bB][01]\+' skipwhite nextgroup=vimGlobal,vimSubst,vimCommand,vimComment,vim9Comment
Bram Moolenaar071d4272004-06-13 20:20:40 +0000209
Bram Moolenaar6c1e1572019-06-22 02:13:00 +0200210" All vimCommands are contained by vimIsCommand. {{{2
dkearns21064eb2023-12-22 02:56:06 +1100211syn match vimCmdSep "[:|]\+" skipwhite nextgroup=vimAbb,vimAddress,vimAutoCmd,vimAugroup,vimBehave,vimEcho,vimEchoHL,vimExecute,vimIsCommand,vimExtCmd,vimFilter,vimGlobal,vimHighlight,vimLet,vimMap,vimMark,vimNorm,vimSet,vimSyntax,vimUnlet,vimUnmap,vimUserCmd
dkearns9c5b90d2024-01-24 06:34:28 +1100212syn match vimIsCommand "\<\%(\h\w*\|[23]mat\%[ch]\)\>" contains=vimCommand
Bram Moolenaard2855f52018-07-31 22:23:58 +0200213syn match vimVar contained "\<\h[a-zA-Z0-9#_]*\>"
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200214syn match vimVar "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>"
dkearnsf6869212023-12-11 01:53:24 +1100215syn match vimVar "\s\zs&\%([lg]:\)\=\a\+\>"
216syn match vimVar "\s\zs&t_\S[a-zA-Z0-9]\>"
217syn match vimVar "\s\zs&t_k;"
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200218syn match vimFBVar contained "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>"
Bram Moolenaar5c736222010-01-06 20:54:52 +0100219syn keyword vimCommand contained in
Bram Moolenaar071d4272004-06-13 20:20:40 +0000220
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000221" Insertions And Appends: insert append {{{2
Bram Moolenaar519cc552021-11-16 19:18:26 +0000222" (buftype != nofile test avoids having append, change, insert show up in the command window)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000223" =======================
Bram Moolenaar519cc552021-11-16 19:18:26 +0000224if &buftype != 'nofile'
225 syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=a\%[ppend]$" matchgroup=vimCommand end="^\.$""
226 syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=c\%[hange]$" matchgroup=vimCommand end="^\.$""
227 syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=i\%[nsert]$" matchgroup=vimCommand end="^\.$""
228endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000229
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000230" Behave! {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000231" =======
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100232if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_nobehaveerror")
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000233 syn match vimBehaveError contained "[^ ]\+"
234endif
Doug Kearnsfe6d5b02024-02-14 21:17:43 +0100235syn match vimBehave "\<be\%[have]\>" nextgroup=vimBehaveBang,vimBehaveModel,vimBehaveError skipwhite
236syn match vimBehaveBang contained "\a\@1<=!" nextgroup=vimBehaveModel skipwhite
237syn keyword vimBehaveModel contained mswin xterm
Bram Moolenaar071d4272004-06-13 20:20:40 +0000238
Doug Kearnsfe6d5b02024-02-14 21:17:43 +0100239hi def link vimBehaveBang vimBang
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000240" Filetypes {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000241" =========
Bram Moolenaar293ee4d2004-12-09 21:34:53 +0000242syn match vimFiletype "\<filet\%[ype]\(\s\+\I\i*\)*" skipwhite contains=vimFTCmd,vimFTOption,vimFTError
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100243if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_vimFTError")
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000244 syn match vimFTError contained "\I\i*"
245endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000246syn keyword vimFTCmd contained filet[ype]
247syn keyword vimFTOption contained detect indent off on plugin
248
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000249" Augroup : vimAugroupError removed because long augroups caused sync'ing problems. {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000250" ======= : Trade-off: Increasing synclines with slower editing vs augroup END error checking.
dkearns21064eb2023-12-22 02:56:06 +1100251syn cluster vimAugroupList contains=vimAugroup,vimIsCommand,vimUserCmd,vimExecute,vimNotFunc,vimFuncName,vimFunction,vimFunctionError,vimLineComment,vimNotFunc,vimMap,vimSpecFile,vimOper,vimNumber,vimOperParen,vimComment,vim9Comment,vimString,vimSubst,vimMark,vimRegister,vimAddress,vimFilter,vimCmplxRepeat,vimComment,vim9Comment,vimLet,vimSet,vimAutoCmd,vimRegion,vimSynLine,vimNotation,vimCtrlChar,vimFuncVar,vimContinue,vimOption
Bram Moolenaarf3913272016-02-25 00:00:01 +0100252if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'a'
Bram Moolenaarb4ff5182015-11-10 21:15:48 +0100253 syn region vimAugroup fold matchgroup=vimAugroupKey start="\<aug\%[roup]\>\ze\s\+\K\k*" end="\<aug\%[roup]\>\ze\s\+[eE][nN][dD]\>" contains=vimAutoCmd,@vimAugroupList
254else
Bram Moolenaar91c49372016-05-08 09:50:29 +0200255 syn region vimAugroup matchgroup=vimAugroupKey start="\<aug\%[roup]\>\ze\s\+\K\k*" end="\<aug\%[roup]\>\ze\s\+[eE][nN][dD]\>" contains=vimAutoCmd,@vimAugroupList
Bram Moolenaarb4ff5182015-11-10 21:15:48 +0100256endif
257syn match vimAugroup "aug\%[roup]!" contains=vimAugroupKey
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100258if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noaugrouperror")
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000259 syn match vimAugroupError "\<aug\%[roup]\>\s\+[eE][nN][dD]\>"
260endif
Bram Moolenaar83d1b192015-04-13 14:22:40 +0200261syn keyword vimAugroupKey contained aug[roup]
Bram Moolenaar071d4272004-06-13 20:20:40 +0000262
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000263" Operators: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000264" =========
dkearns21ce1592024-01-29 04:54:08 +1100265syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimType,vimRegister,@vimContinue,vim9Comment,vimVar
dkearns4e043b12023-12-06 08:58:40 +1100266syn match vimOper "||\|&&\|[-+*/%.!]" skipwhite nextgroup=vimString,vimSpecFile
Bram Moolenaar113cb512021-11-07 20:27:04 +0000267syn match vimOper "\%#=1\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\|!\~#\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile
268syn match vimOper "\(\<is\|\<isnot\)[?#]\{0,2}\>" skipwhite nextgroup=vimString,vimSpecFile
Bram Moolenaar388a5d42020-05-26 21:20:45 +0200269syn region vimOperParen matchgroup=vimParenSep start="(" end=")" contains=vimoperStar,@vimOperGroup
Bram Moolenaar4072ba52020-12-23 13:56:35 +0100270syn region vimOperParen matchgroup=vimSep start="#\={" end="}" contains=@vimOperGroup nextgroup=vimVar,vimFuncVar
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100271if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noopererror")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100272 syn match vimOperError ")"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000273endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000274
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000275" Functions : Tag is provided for those who wish to highlight tagged functions {{{2
276" =========
Bram Moolenaar5c736222010-01-06 20:54:52 +0100277syn cluster vimFuncList contains=vimCommand,vimFunctionError,vimFuncKey,Tag,vimFuncSID
Bram Moolenaard58a3bf2020-09-28 21:48:16 +0200278syn cluster vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vim9Comment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimEnvvar,vimExecute,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimGlobal,vimHighlight,vimIsCommand,vimLet,vimLetHereDoc,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSearch,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUnmap,vimUserCommand
Bram Moolenaar4d8f4762021-06-27 15:18:56 +0200279syn match vimFunction "\<\(fu\%[nction]\)!\=\s\+\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)*\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody
Aliaksei Budaveidfcef892024-02-18 21:02:14 +0300280syn match vimFunction "\<def\s\+new\i\{-}(" contains=@vimFuncList nextgroup=vimFuncBody
Bram Moolenaar1b5f03e2023-01-09 20:12:45 +0000281syn match vimFunction "\<def!\=\s\+\%(\i\|[#.]\|{.\{-1,}}\)*\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody
282"syn match vimFunction "\<def!\=\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000283
Bram Moolenaarf3913272016-02-25 00:00:01 +0100284if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f'
Bram Moolenaarb17893a2020-03-14 08:19:51 +0100285 syn region vimFuncBody contained fold start="\ze\s*(" matchgroup=vimCommand end="\<\(endf\>\|endfu\%[nction]\>\|enddef\>\)" contains=@vimFuncBodyList
Bram Moolenaarb4ff5182015-11-10 21:15:48 +0100286else
Bram Moolenaar4d8f4762021-06-27 15:18:56 +0200287 syn region vimFuncBody contained start="\ze\s*(" matchgroup=vimCommand end="\<\(endf\>\|endfu\%[nction]\>\|enddef\>\)" contains=@vimFuncBodyList
Bram Moolenaarb4ff5182015-11-10 21:15:48 +0100288endif
289syn match vimFuncVar contained "a:\(\K\k*\|\d\+\)"
Bram Moolenaar5c736222010-01-06 20:54:52 +0100290syn match vimFuncSID contained "\c<sid>\|\<s:"
291syn keyword vimFuncKey contained fu[nction]
Bram Moolenaar8a7d6542020-01-26 15:56:19 +0100292syn keyword vimFuncKey contained def
Bram Moolenaar5c736222010-01-06 20:54:52 +0100293syn match vimFuncBlank contained "\s\+"
294
295syn keyword vimPattern contained start skip end
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000296
Bram Moolenaar4d8f4762021-06-27 15:18:56 +0200297" vimTypes : new for vim9
298syn match vimType ":\s*\zs\<\(bool\|number\|float\|string\|blob\|list<\|dict<\|job\|channel\|func\)\>"
299
dkearns69866442023-11-22 05:43:40 +1100300" Keymaps: (Vim Project Addition) {{{2
301" =======
302
303" TODO: autogenerated vimCommand keyword list does not handle all abbreviations
304" : handle Vim9 script comments when something like #13104 is merged
305syn match vimKeymapStart "^" contained skipwhite nextgroup=vimKeymapLhs,vimKeymapLineComment
306syn match vimKeymapLhs "\S\+" contained skipwhite nextgroup=vimKeymapRhs contains=vimNotation
307syn match vimKeymapRhs "\S\+" contained skipwhite nextgroup=vimKeymapTailComment contains=vimNotation
308syn match vimKeymapTailComment "\S.*" contained
309syn match vimKeymapLineComment +".*+ contained contains=@vimCommentGroup,vimCommentString,vimCommentTitle
310
311syn region vimKeymap matchgroup=vimCommand start="\<loadk\%[eymap]\>" end="\%$" contains=vimKeymapStart
312
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000313" Special Filenames, Modifiers, Extension Removal: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000314" ===============================================
Bram Moolenaar5c736222010-01-06 20:54:52 +0100315syn match vimSpecFile "<c\(word\|WORD\)>" nextgroup=vimSpecFileMod,vimSubst
316syn match vimSpecFile "<\([acs]file\|amatch\|abuf\)>" nextgroup=vimSpecFileMod,vimSubst
317syn match vimSpecFile "\s%[ \t:]"ms=s+1,me=e-1 nextgroup=vimSpecFileMod,vimSubst
318syn match vimSpecFile "\s%$"ms=s+1 nextgroup=vimSpecFileMod,vimSubst
319syn match vimSpecFile "\s%<"ms=s+1,me=e-1 nextgroup=vimSpecFileMod,vimSubst
320syn match vimSpecFile "#\d\+\|[#%]<\>" nextgroup=vimSpecFileMod,vimSubst
321syn match vimSpecFileMod "\(:[phtre]\)\+" contained
Bram Moolenaar071d4272004-06-13 20:20:40 +0000322
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000323" User-Specified Commands: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000324" =======================
Bram Moolenaar2c7f8c52020-04-20 19:52:53 +0200325syn cluster vimUserCmdList contains=vimAddress,vimSyntax,vimHighlight,vimAutoCmd,vimCmplxRepeat,vimComment,vim9Comment,vimCtrlChar,vimEscapeBrace,vimFunc,vimFuncName,vimFunction,vimFunctionError,vimIsCommand,vimMark,vimNotation,vimNumber,vimOper,vimRegion,vimRegister,vimLet,vimSet,vimSetEqual,vimSetString,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange,vimSynLine
Bram Moolenaar5c736222010-01-06 20:54:52 +0100326syn keyword vimUserCommand contained com[mand]
Bram Moolenaard58a3bf2020-09-28 21:48:16 +0200327syn match vimUserCmd "\<com\%[mand]!\=\>.*$" contains=vimUserAttrb,vimUserAttrbError,vimUserCommand,@vimUserCmdList,vimComFilter
Bram Moolenaarb4ff5182015-11-10 21:15:48 +0100328syn match vimUserAttrbError contained "-\a\+\ze\s"
329syn match vimUserAttrb contained "-nargs=[01*?+]" contains=vimUserAttrbKey,vimOper
330syn match vimUserAttrb contained "-complete=" contains=vimUserAttrbKey,vimOper nextgroup=vimUserAttrbCmplt,vimUserCmdError
331syn match vimUserAttrb contained "-range\(=%\|=\d\+\)\=" contains=vimNumber,vimOper,vimUserAttrbKey
332syn match vimUserAttrb contained "-count\(=\d\+\)\=" contains=vimNumber,vimOper,vimUserAttrbKey
333syn match vimUserAttrb contained "-bang\>" contains=vimOper,vimUserAttrbKey
334syn match vimUserAttrb contained "-bar\>" contains=vimOper,vimUserAttrbKey
335syn match vimUserAttrb contained "-buffer\>" contains=vimOper,vimUserAttrbKey
336syn match vimUserAttrb contained "-register\>" contains=vimOper,vimUserAttrbKey
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100337if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_nousercmderror")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100338 syn match vimUserCmdError contained "\S\+\>"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000339endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000340syn case ignore
Bram Moolenaar5c736222010-01-06 20:54:52 +0100341syn keyword vimUserAttrbKey contained bar ban[g] cou[nt] ra[nge] com[plete] n[args] re[gister]
h-east9b53c052024-02-13 21:09:22 +0100342" GEN_SYN_VIM: vimUserAttrbCmplt, START_STR='syn keyword vimUserAttrbCmplt contained', END_STR=''
343syn 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 +0100344syn keyword vimUserAttrbCmplt contained custom customlist nextgroup=vimUserAttrbCmpltFunc,vimUserCmdError
Maxim Kimceed3682024-01-09 05:42:02 +1100345syn 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 +0000346
Bram Moolenaar071d4272004-06-13 20:20:40 +0000347syn case match
Bram Moolenaar5c736222010-01-06 20:54:52 +0100348syn match vimUserAttrbCmplt contained "custom,\u\w*"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000349
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000350" Lower Priority Comments: after some vim commands... {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000351" =======================
Bram Moolenaar5c736222010-01-06 20:54:52 +0100352syn match vimComment excludenl +\s"[^\-:.%#=*].*$+lc=1 contains=@vimCommentGroup,vimCommentString
353syn match vimComment +\<endif\s\+".*$+lc=5 contains=@vimCommentGroup,vimCommentString
354syn match vimComment +\<else\s\+".*$+lc=4 contains=@vimCommentGroup,vimCommentString
355syn region vimCommentString contained oneline start='\S\s\+"'ms=e end='"'
Bram Moolenaar2c7f8c52020-04-20 19:52:53 +0200356" Vim9 comments - TODO: might be highlighted while they don't work
Bram Moolenaaracc22402020-06-07 21:07:18 +0200357syn match vim9Comment excludenl +\s#[^{].*$+lc=1 contains=@vimCommentGroup,vimCommentString
358syn match vim9Comment +\<endif\s\+#[^{].*$+lc=5 contains=@vimCommentGroup,vimCommentString
359syn match vim9Comment +\<else\s\+#[^{].*$+lc=4 contains=@vimCommentGroup,vimCommentString
Bram Moolenaar2c7f8c52020-04-20 19:52:53 +0200360" Vim9 comment inside expression
Bram Moolenaar388a5d42020-05-26 21:20:45 +0200361syn match vim9Comment +\s\zs#[^{].*$+ms=s+1 contains=@vimCommentGroup,vimCommentString
Bram Moolenaard58a3bf2020-09-28 21:48:16 +0200362syn match vim9Comment +^\s*#[^{].*$+ contains=@vimCommentGroup,vimCommentString
363syn match vim9Comment +^\s*#$+ contains=@vimCommentGroup,vimCommentString
Bram Moolenaar071d4272004-06-13 20:20:40 +0000364
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000365" Environment Variables: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000366" =====================
Bram Moolenaar5c736222010-01-06 20:54:52 +0100367syn match vimEnvvar "\$\I\i*"
368syn match vimEnvvar "\${\I\i*}"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000369
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000370" In-String Specials: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000371" Try to catch strings, if nothing else matches (therefore it must precede the others!)
372" vimEscapeBrace handles ["] []"] (ie. "s don't terminate string inside [])
Bram Moolenaar5c736222010-01-06 20:54:52 +0100373syn region vimEscapeBrace oneline contained transparent start="[^\\]\(\\\\\)*\[\zs\^\=\]\=" skip="\\\\\|\\\]" end="]"me=e-1
374syn match vimPatSepErr contained "\\)"
375syn match vimPatSep contained "\\|"
Bram Moolenaarb730f0c2018-11-25 03:56:26 +0100376syn region vimPatSepZone oneline contained matchgroup=vimPatSepZ start="\\%\=\ze(" skip="\\\\" end="\\)\|[^\\]['"]" contains=@vimStringGroup
Bram Moolenaar5c736222010-01-06 20:54:52 +0100377syn region vimPatRegion contained transparent matchgroup=vimPatSepR start="\\[z%]\=(" end="\\)" contains=@vimSubstList oneline
378syn match vimNotPatSep contained "\\\\"
Bram Moolenaar6ba83ba2022-06-12 22:15:57 +0100379syn cluster vimStringGroup contains=vimEscape,vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone,@Spell
Bram Moolenaard2855f52018-07-31 22:23:58 +0200380syn region vimString oneline keepend start=+[^a-zA-Z>!\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ contains=@vimStringGroup
Bram Moolenaarb0d45e72017-11-05 18:19:24 +0100381syn region vimString oneline keepend start=+[^a-zA-Z>!\\@]'+lc=1 end=+'+
Bram Moolenaaracc22402020-06-07 21:07:18 +0200382"syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup " see tst45.vim
Bram Moolenaar5c736222010-01-06 20:54:52 +0100383syn match vimString contained +"[^"]*\\$+ skipnl nextgroup=vimStringCont
384syn match vimStringCont contained +\(\\\\\|.\)\{-}[^\\]"+
Bram Moolenaar6ba83ba2022-06-12 22:15:57 +0100385syn match vimEscape contained "\\."
dkearnse3e39342024-02-02 07:44:26 +1100386" syn match vimEscape contained +\\[befnrt\"]+
387syn match vimEscape contained "\\\o\{1,3}\|\\[xX]\x\{1,2}\|\\u\x\{1,4}\|\\U\x\{1,8}"
388syn match vimEscape contained "\\<" contains=vimNotation
389syn match vimEscape contained "\\<\*[^>]*>\=>"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000390
thincacf8695d2024-01-28 18:57:23 +0100391syn region vimString start=+$'+ end=+'+ skip=+''+ oneline contains=vimStringInterpolationBrace,vimStringInterpolationExpr
392syn region vimString start=+$"+ end=+"+ oneline contains=@vimStringGroup,vimStringInterpolationBrace,vimStringInterpolationExpr
dkearns7c5aeaf2024-02-04 04:18:31 +1100393syn region vimStringInterpolationExpr matchgroup=vimSep start=+{+ end=+}+ oneline contains=vimFunc,vimFuncVar,vimOper,vimOperParen,vimNotation,vimNumber,vimString,vimVar
thincacf8695d2024-01-28 18:57:23 +0100394syn match vimStringInterpolationBrace "{{"
395syn match vimStringInterpolationBrace "}}"
396
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000397" Substitutions: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000398" =============
Bram Moolenaar5c736222010-01-06 20:54:52 +0100399syn cluster vimSubstList contains=vimPatSep,vimPatRegion,vimPatSepErr,vimSubstTwoBS,vimSubstRange,vimNotation
400syn cluster vimSubstRepList contains=vimSubstSubstr,vimSubstTwoBS,vimNotation
401syn cluster vimSubstList add=vimCollection
Bram Moolenaar91c49372016-05-08 09:50:29 +0200402syn match vimSubst "\(:\+\s*\|^\s*\||\s*\)\<\%(\<s\%[ubstitute]\>\|\<sm\%[agic]\>\|\<sno\%[magic]\>\)[:#[:alpha:]]\@!" nextgroup=vimSubstPat
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100403"syn match vimSubst "\%(^\|[^\\]\)\<s\%[ubstitute]\>[:#[:alpha:]]\@!" nextgroup=vimSubstPat contained
404syn match vimSubst "\%(^\|[^\\\"']\)\<s\%[ubstitute]\>[:#[:alpha:]\"']\@!" nextgroup=vimSubstPat contained
Bram Moolenaar91c49372016-05-08 09:50:29 +0200405syn match vimSubst "/\zs\<s\%[ubstitute]\>\ze/" nextgroup=vimSubstPat
406syn match vimSubst "\(:\+\s*\|^\s*\)s\ze#.\{-}#.\{-}#" nextgroup=vimSubstPat
407syn match vimSubst1 contained "\<s\%[ubstitute]\>" nextgroup=vimSubstPat
Bram Moolenaard2855f52018-07-31 22:23:58 +0200408syn match vimSubst2 contained "s\%[ubstitute]\>" nextgroup=vimSubstPat
Bram Moolenaar5c736222010-01-06 20:54:52 +0100409syn region vimSubstPat contained matchgroup=vimSubstDelim start="\z([^a-zA-Z( \t[\]&]\)"rs=s+1 skip="\\\\\|\\\z1" end="\z1"re=e-1,me=e-1 contains=@vimSubstList nextgroup=vimSubstRep4 oneline
410syn region vimSubstRep4 contained matchgroup=vimSubstDelim start="\z(.\)" skip="\\\\\|\\\z1" end="\z1" matchgroup=vimNotation end="<[cC][rR]>" contains=@vimSubstRepList nextgroup=vimSubstFlagErr oneline
411syn region vimCollection contained transparent start="\\\@<!\[" skip="\\\[" end="\]" contains=vimCollClass
412syn match vimCollClassErr contained "\[:.\{-\}:\]"
Bram Moolenaarf1dcd142022-12-31 15:30:45 +0000413syn match vimCollClass contained transparent "\%#=1\[:\(alnum\|alpha\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|xdigit\|retu\%[rn]\|tab\|escape\|backspace\):\]"
Bram Moolenaar5c736222010-01-06 20:54:52 +0100414syn match vimSubstSubstr contained "\\z\=\d"
415syn match vimSubstTwoBS contained "\\\\"
416syn match vimSubstFlagErr contained "[^< \t\r|]\+" contains=vimSubstFlags
Bram Moolenaaracc22402020-06-07 21:07:18 +0200417syn match vimSubstFlags contained "[&cegiIlnpr#]\+"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000418
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000419" 'String': {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +0100420syn match vimString "[^(,]'[^']\{-}\zs'"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000421
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000422" Marks, Registers, Addresses, Filters: {{{2
Bram Moolenaar6c1e1572019-06-22 02:13:00 +0200423syn match vimMark "'[a-zA-Z0-9]\ze[-+,!]" nextgroup=vimFilter,vimMarkNumber,vimSubst
424syn match vimMark "'[<>]\ze[-+,!]" nextgroup=vimFilter,vimMarkNumber,vimSubst
425syn match vimMark ",\zs'[<>]\ze" nextgroup=vimFilter,vimMarkNumber,vimSubst
426syn match vimMark "[!,:]\zs'[a-zA-Z0-9]" nextgroup=vimFilter,vimMarkNumber,vimSubst
427syn match vimMark "\<norm\%[al]\s\zs'[a-zA-Z0-9]" nextgroup=vimFilter,vimMarkNumber,vimSubst
Bram Moolenaard2855f52018-07-31 22:23:58 +0200428syn match vimMarkNumber "[-+]\d\+" contained contains=vimOper nextgroup=vimSubst2
Bram Moolenaar5c736222010-01-06 20:54:52 +0100429syn match vimPlainMark contained "'[a-zA-Z0-9]"
Bram Moolenaar6c1e1572019-06-22 02:13:00 +0200430syn match vimRange "[`'][a-zA-Z0-9],[`'][a-zA-Z0-9]" contains=vimMark skipwhite nextgroup=vimFilter
Bram Moolenaar071d4272004-06-13 20:20:40 +0000431
Bram Moolenaarb4ff5182015-11-10 21:15:48 +0100432syn match vimRegister '[^,;[{: \t]\zs"[a-zA-Z0-9.%#:_\-/]\ze[^a-zA-Z_":0-9]'
Bram Moolenaar5c736222010-01-06 20:54:52 +0100433syn match vimRegister '\<norm\s\+\zs"[a-zA-Z0-9]'
434syn match vimRegister '\<normal\s\+\zs"[a-zA-Z0-9]'
435syn match vimRegister '@"'
436syn match vimPlainRegister contained '"[a-zA-Z0-9\-:.%#*+=]'
dkearnsf6869212023-12-11 01:53:24 +1100437syn match vimLetRegister contained '@["0-9\-a-zA-Z#=*+_/]'
Bram Moolenaar071d4272004-06-13 20:20:40 +0000438
Bram Moolenaar5c736222010-01-06 20:54:52 +0100439syn match vimAddress ",\zs[.$]" skipwhite nextgroup=vimSubst1
440syn match vimAddress "%\ze\a" skipwhite nextgroup=vimString,vimSubst1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000441
Bram Moolenaar6c1e1572019-06-22 02:13:00 +0200442syn match vimFilter "^!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile
Bram Moolenaard58a3bf2020-09-28 21:48:16 +0200443syn match vimFilter contained "!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile
444syn match vimComFilter contained "|!!\=[^"]\{-}\(|\|\ze\"\|$\)" contains=vimOper,vimSpecFile
Bram Moolenaar071d4272004-06-13 20:20:40 +0000445
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100446" Complex Repeats: (:h complex-repeat) {{{2
447" ===============
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100448syn match vimCmplxRepeat '[^a-zA-Z_/\\()]q[0-9a-zA-Z"]\>'lc=1
449syn match vimCmplxRepeat '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\>\)'
Bram Moolenaar071d4272004-06-13 20:20:40 +0000450
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000451" Set command and associated set-options (vimOptions) with comment {{{2
Bram Moolenaar4d8f4762021-06-27 15:18:56 +0200452syn 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,vim9Comment,vimSetString,vimSetMod
Bram Moolenaard2ea7cf2021-05-30 20:54:13 +0200453syn region vimSetEqual contained start="[=:]\|[-+^]=" skip="\\\\\|\\\s" end="[| \t]"me=e-1 end="$" contains=vimCtrlChar,vimSetSep,vimNotation,vimEnvvar
Bram Moolenaard2855f52018-07-31 22:23:58 +0200454syn region vimSetString contained start=+="+hs=s+1 skip=+\\\\\|\\"+ end=+"+ contains=vimCtrlChar
Bram Moolenaar4072ba52020-12-23 13:56:35 +0100455syn match vimSetSep contained "[,:]"
Bram Moolenaar5c736222010-01-06 20:54:52 +0100456syn match vimSetMod contained "&vim\=\|[!&?<]\|all&"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000457
Bram Moolenaar71badf92023-04-22 22:40:14 +0100458" Let And Var: {{{2
459" ===========
dkearnsf6869212023-12-11 01:53:24 +1100460syn keyword vimLet let skipwhite nextgroup=vimVar,vimFuncVar,vimLetHereDoc,vimLetRegister,vimVarList
461syn keyword vimConst cons[t] skipwhite nextgroup=vimVar,vimLetHereDoc,vimVarList
462syn region vimVarList contained start="\[" end="]" contains=vimVar,vimContinue
463
464syn keyword vimUnlet unl[et] skipwhite nextgroup=vimUnletBang,vimUnletVars
465syn match vimUnletBang contained "!" skipwhite nextgroup=vimUnletVars
466syn region vimUnletVars contained start="$\I\|\h" skip="\n\s*\\" end="$" end="|" contains=vimVar,vimEnvvar,vimContinue,vimString,vimNumber
467
dkearns9358b8d2023-11-12 05:06:01 +1100468VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='=<<\s*\%(trim\s\+\%(eval\s\+\)\=\|eval\s\+\%(trim\s\+\)\=\)\=\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\s*\z1\s*$'
Bram Moolenaar71badf92023-04-22 22:40:14 +0100469syn keyword vimLet var skipwhite nextgroup=vimVar,vimFuncVar,vimLetHereDoc
Bram Moolenaar071d4272004-06-13 20:20:40 +0000470
dkearnsf6869212023-12-11 01:53:24 +1100471" For: {{{2
472" ===
473syn keyword vimFor for skipwhite nextgroup=vimVar,vimVarList
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100474" Abbreviations: {{{2
Bram Moolenaare37d50a2008-08-06 17:06:04 +0000475" =============
h-east9b53c052024-02-13 21:09:22 +0100476" GEN_SYN_VIM: vimCommand abbrev, START_STR='syn keyword vimAbb', END_STR='skipwhite nextgroup=vimMapMod,vimMapLhs'
477syn keyword vimAbb ab[breviate] ca[bbrev] cnorea[bbrev] ia[bbrev] inorea[bbrev] norea[bbrev] skipwhite nextgroup=vimMapMod,vimMapLhs
Bram Moolenaare37d50a2008-08-06 17:06:04 +0000478
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100479" Autocmd: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000480" =======
Bram Moolenaar5c736222010-01-06 20:54:52 +0100481syn match vimAutoEventList contained "\(!\s\+\)\=\(\a\+,\)*\a\+" contains=vimAutoEvent nextgroup=vimAutoCmdSpace
482syn match vimAutoCmdSpace contained "\s\+" nextgroup=vimAutoCmdSfxList
Bram Moolenaard58a3bf2020-09-28 21:48:16 +0200483syn match vimAutoCmdSfxList contained "\S*" skipwhite nextgroup=vimAutoCmdMod
Bram Moolenaar5c736222010-01-06 20:54:52 +0100484syn keyword vimAutoCmd au[tocmd] do[autocmd] doautoa[ll] skipwhite nextgroup=vimAutoEventList
Bram Moolenaard58a3bf2020-09-28 21:48:16 +0200485syn match vimAutoCmdMod "\(++\)\=\(once\|nested\)"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000486
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100487" Echo And Execute: -- prefer strings! {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000488" ================
Bram Moolenaar5c736222010-01-06 20:54:52 +0100489syn region vimEcho oneline excludenl matchgroup=vimCommand start="\<ec\%[ho]\>" skip="\(\\\\\)*\\|" end="$\||" contains=vimFunc,vimFuncVar,vimString,vimVar
490syn region vimExecute oneline excludenl matchgroup=vimCommand start="\<exe\%[cute]\>" skip="\(\\\\\)*\\|" end="$\||\|<[cC][rR]>" contains=vimFuncVar,vimIsCommand,vimOper,vimNotation,vimOperParen,vimString,vimVar
491syn match vimEchoHL "echohl\=" skipwhite nextgroup=vimGroup,vimHLGroup,vimEchoHLNone
Bram Moolenaar071d4272004-06-13 20:20:40 +0000492syn case ignore
Bram Moolenaar5c736222010-01-06 20:54:52 +0100493syn keyword vimEchoHLNone none
Bram Moolenaar071d4272004-06-13 20:20:40 +0000494syn case match
495
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100496" Maps: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000497" ====
dkearnsb614b282024-02-12 03:13:34 +1100498syn match vimMap "\<map\>\ze\s*(\@!" skipwhite nextgroup=vimMapMod,vimMapLhs
499syn match vimMap "\<map!" contains=vimMapBang skipwhite nextgroup=vimMapMod,vimMapLhs
h-east9b53c052024-02-13 21:09:22 +0100500" GEN_SYN_VIM: vimCommand map, START_STR='syn keyword vimMap', END_STR='skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs'
501syn 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
502" GEN_SYN_VIM: vimCommand mapclear, START_STR='syn keyword vimMap', END_STR=''
503syn keyword vimMap cmapc[lear] imapc[lear] lmapc[lear] mapc[lear] nmapc[lear] omapc[lear] smapc[lear] tmapc[lear] vmapc[lear] xmapc[lear]
504" GEN_SYN_VIM: vimCommand unmap, START_STR='syn keyword vimUnmap', END_STR='skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs'
505syn 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
Bram Moolenaar5c736222010-01-06 20:54:52 +0100506syn match vimMapLhs contained "\S\+" contains=vimNotation,vimCtrlChar skipwhite nextgroup=vimMapRhs
507syn match vimMapBang contained "!" skipwhite nextgroup=vimMapMod,vimMapLhs
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200508syn match vimMapMod contained "\%#=1\c<\(buffer\|expr\|\(local\)\=leader\|nowait\|plug\|script\|sid\|unique\|silent\)\+>" contains=vimMapModKey,vimMapModErr skipwhite nextgroup=vimMapMod,vimMapLhs
Bram Moolenaar5c736222010-01-06 20:54:52 +0100509syn match vimMapRhs contained ".*" contains=vimNotation,vimCtrlChar skipnl nextgroup=vimMapRhsExtend
Bram Moolenaarb4ff5182015-11-10 21:15:48 +0100510syn match vimMapRhsExtend contained "^\s*\\.*$" contains=vimContinue
Bram Moolenaar071d4272004-06-13 20:20:40 +0000511syn case ignore
Bram Moolenaarb4ff5182015-11-10 21:15:48 +0100512syn keyword vimMapModKey contained buffer expr leader localleader nowait plug script sid silent unique
Bram Moolenaar071d4272004-06-13 20:20:40 +0000513syn case match
514
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100515" Menus: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000516" =====
Bram Moolenaar5c736222010-01-06 20:54:52 +0100517syn cluster vimMenuList contains=vimMenuBang,vimMenuPriority,vimMenuName,vimMenuMod
h-east9b53c052024-02-13 21:09:22 +0100518" GEN_SYN_VIM: vimCommand menu, START_STR='syn keyword vimCommand', END_STR='skipwhite nextgroup=@vimMenuList'
519syn keyword vimCommand 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] unme[nu] vme[nu] vnoreme[nu] vunme[nu] xme[nu] xnoreme[nu] xunme[nu] skipwhite nextgroup=@vimMenuList
Bram Moolenaar5c736222010-01-06 20:54:52 +0100520syn match vimMenuName "[^ \t\\<]\+" contained nextgroup=vimMenuNameMore,vimMenuMap
521syn match vimMenuPriority "\d\+\(\.\d\+\)*" contained skipwhite nextgroup=vimMenuName
522syn match vimMenuNameMore "\c\\\s\|<tab>\|\\\." contained nextgroup=vimMenuName,vimMenuNameMore contains=vimNotation
523syn match vimMenuMod contained "\c<\(script\|silent\)\+>" skipwhite contains=vimMapModKey,vimMapModErr nextgroup=@vimMenuList
524syn match vimMenuMap "\s" contained skipwhite nextgroup=vimMenuRhs
Bram Moolenaar2c7f8c52020-04-20 19:52:53 +0200525syn match vimMenuRhs ".*$" contained contains=vimString,vimComment,vim9Comment,vimIsCommand
Bram Moolenaar5c736222010-01-06 20:54:52 +0100526syn match vimMenuBang "!" contained skipwhite nextgroup=@vimMenuList
Bram Moolenaar071d4272004-06-13 20:20:40 +0000527
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100528" Angle-Bracket Notation: (tnx to Michael Geddes) {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000529" ======================
530syn case ignore
dkearnse3e39342024-02-02 07:44:26 +1100531syn 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
532
533syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}\%(net\|dec\|jsb\|pterm\|urxvt\|sgr\)mouse>" contains=vimBracket
534syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}\%(left\|middle\|right\)\%(mouse\|drag\|release\)>" contains=vimBracket
535syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}left\%(mouse\|release\)nm>" contains=vimBracket
536syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}x[12]\%(mouse\|drag\|release\)>" contains=vimBracket
537syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}sgrmouserelease>" contains=vimBracket
538syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}mouse\%(up\|down\|move\)>" contains=vimBracket
539syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%([scamd2-4]-\)\{0,4}scrollwheel\%(up\|down\|right\|left\)>" contains=vimBracket
540
541syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%(sid\|nop\|nul\|lt\|drop\)>" contains=vimBracket
542syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%(snr\|plug\|cursorhold\|ignore\|cmd\|scriptcmd\|focus\%(gained\|lost\)\)>" contains=vimBracket
543syn match vimNotation '\%(\\\|<lt>\)\=<C-R>[0-9a-z"%#:.\-=]'he=e-1 contains=vimBracket
544syn match vimNotation '\%#=1\%(\\\|<lt>\)\=<\%(q-\)\=\%(line[12]\|count\|bang\|reg\|args\|mods\|f-args\|f-mods\|lt\)>' contains=vimBracket
545syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%([cas]file\|abuf\|amatch\|cexpr\|cword\|cWORD\|client\|stack\|script\|sf\=lnum\)>" contains=vimBracket
546syn match vimNotation "\%#=1\%(\\\|<lt>\)\=<\%([scamd]-\)\{0,4}char-\%(\d\+\|0\o\+\|0x\x\+\)>" contains=vimBracket
547
Bram Moolenaar5c736222010-01-06 20:54:52 +0100548syn match vimBracket contained "[\\<>]"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000549syn case match
550
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100551" User Function Highlighting: {{{2
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000552" (following Gautam Iyer's suggestion)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000553" ==========================
Bram Moolenaard592deb2022-06-17 15:42:40 +0100554syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" contains=vimFuncEcho,vimFuncName,vimUserFunc,vimExecute
555syn match vimUserFunc contained "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\<if\>" contains=vimNotation
Bram Moolenaarcbaff5e2022-04-08 17:45:08 +0100556syn keyword vimFuncEcho contained ec ech echo
Bram Moolenaar071d4272004-06-13 20:20:40 +0000557
Bram Moolenaar2547aa92020-07-26 17:00:44 +0200558" User Command Highlighting: {{{2
Bram Moolenaard2ea7cf2021-05-30 20:54:13 +0200559syn match vimUsrCmd '^\s*\zs\u\%(\w*\)\@>\%([(#[]\|\s\+\%([-+*/%]\=\|\.\.\)=\)\@!'
Bram Moolenaar2547aa92020-07-26 17:00:44 +0200560
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000561" Errors And Warnings: {{{2
562" ====================
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100563if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimfunctionerror")
Aliaksei Budaveidfcef892024-02-18 21:02:14 +0300564 " TODO: The new-prefix exception should only apply to constructor definitions.
565 syn match vimFunctionError "\s\zs\%(new\)\@![a-z0-9]\i\{-}\ze\s*(" contained contains=vimFuncKey,vimFuncBlank
Bram Moolenaar6c1e1572019-06-22 02:13:00 +0200566 syn match vimFunctionError "\s\zs\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\d\i\{-}\ze\s*(" contained contains=vimFuncKey,vimFuncBlank
Bram Moolenaar5c736222010-01-06 20:54:52 +0100567 syn match vimElseIfErr "\<else\s\+if\>"
568 syn match vimBufnrWarn /\<bufnr\s*(\s*["']\.['"]\s*)/
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000569endif
570
Bram Moolenaarf1dcd142022-12-31 15:30:45 +0000571syn match vimNotFunc "\<if\>\|\<el\%[seif]\>\|\<retu\%[rn]\>\|\<while\>" skipwhite nextgroup=vimOper,vimOperParen,vimVar,vimFunc,vimNotation
Bram Moolenaar6c1e1572019-06-22 02:13:00 +0200572
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100573" Norm: {{{2
Bram Moolenaar05159a02005-02-26 23:04:13 +0000574" ====
Bram Moolenaar5c736222010-01-06 20:54:52 +0100575syn match vimNorm "\<norm\%[al]!\=" skipwhite nextgroup=vimNormCmds
576syn match vimNormCmds contained ".*$"
Bram Moolenaar05159a02005-02-26 23:04:13 +0000577
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100578" Syntax: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000579"=======
dkearns21ce1592024-01-29 04:54:08 +1100580syn match vimGroupList contained "[^[:space:],]\+\%(\s*,\s*[^[:space:],]\+\)*" contains=vimGroupSpecial
581syn 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
582syn keyword vimGroupSpecial contained ALL ALLBUT CONTAINED TOP
583
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100584if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsynerror")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100585 syn match vimSynError contained "\i\+"
586 syn match vimSynError contained "\i\+=" nextgroup=vimGroupList
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000587endif
dkearns21ce1592024-01-29 04:54:08 +1100588syn match vimSynContains contained "\<contain\%(s\|edin\)=" skipwhite skipnl nextgroup=vimGroupList
589syn match vimSynKeyContainedin contained "\<containedin=" skipwhite skipnl nextgroup=vimGroupList
590syn match vimSynNextgroup contained "\<nextgroup=" skipwhite skipnl nextgroup=vimGroupList
dkearnsc79646d2024-01-05 08:58:48 +1100591if has("conceal")
dkearns21ce1592024-01-29 04:54:08 +1100592 " no whitespace allowed after '='
dkearnsc79646d2024-01-05 08:58:48 +1100593 syn match vimSynCchar contained "\<cchar=" nextgroup=vimSynCcharValue
594 syn match vimSynCcharValue contained "\S"
595endif
596
Bram Moolenaar2c7f8c52020-04-20 19:52:53 +0200597syn match vimSyntax "\<sy\%[ntax]\>" contains=vimCommand skipwhite nextgroup=vimSynType,vimComment,vim9Comment
598syn match vimAuSyntax contained "\s+sy\%[ntax]" contains=vimCommand skipwhite nextgroup=vimSynType,vimComment,vim9Comment
Bram Moolenaard960d762011-09-21 19:22:10 +0200599syn cluster vimFuncBodyList add=vimSyntax
Bram Moolenaar071d4272004-06-13 20:20:40 +0000600
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000601" Syntax: case {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +0100602syn keyword vimSynType contained case skipwhite nextgroup=vimSynCase,vimSynCaseError
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100603if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsyncaseerror")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100604 syn match vimSynCaseError contained "\i\+"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000605endif
Bram Moolenaar5c736222010-01-06 20:54:52 +0100606syn keyword vimSynCase contained ignore match
Bram Moolenaar071d4272004-06-13 20:20:40 +0000607
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000608" Syntax: clear {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +0100609syn keyword vimSynType contained clear skipwhite nextgroup=vimGroupList
Bram Moolenaar071d4272004-06-13 20:20:40 +0000610
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000611" Syntax: cluster {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +0100612syn keyword vimSynType contained cluster skipwhite nextgroup=vimClusterName
dkearns21ce1592024-01-29 04:54:08 +1100613syn region vimClusterName contained keepend matchgroup=vimGroupName start="\h\w*\>" skip=+\\\\\|\\\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="$\||" contains=@vimContinue,vimGroupAdd,vimGroupRem,vimSynContains,vimSynError
614syn match vimGroupAdd contained keepend "\<add=" skipwhite skipnl nextgroup=vimGroupList
615syn match vimGroupRem contained keepend "\<remove=" skipwhite skipnl nextgroup=vimGroupList
Bram Moolenaard960d762011-09-21 19:22:10 +0200616syn cluster vimFuncBodyList add=vimSynType,vimGroupAdd,vimGroupRem
Bram Moolenaar071d4272004-06-13 20:20:40 +0000617
Brad Kingd4634a22024-01-03 10:17:24 -0500618" Syntax: foldlevel {{{2
619syn keyword vimSynType contained foldlevel skipwhite nextgroup=vimSynFoldMethod,vimSynFoldMethodError
620if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsynfoldmethoderror")
621 syn match vimSynFoldMethodError contained "\i\+"
622endif
623syn keyword vimSynFoldMethod contained start minimum
624
Bram Moolenaar13d5aee2016-01-21 23:36:05 +0100625" Syntax: iskeyword {{{2
626syn keyword vimSynType contained iskeyword skipwhite nextgroup=vimIskList
627syn match vimIskList contained '\S\+' contains=vimIskSep
628syn match vimIskSep contained ','
629
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000630" Syntax: include {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +0100631syn keyword vimSynType contained include skipwhite nextgroup=vimGroupList
Bram Moolenaard960d762011-09-21 19:22:10 +0200632syn cluster vimFuncBodyList add=vimSynType
Bram Moolenaar071d4272004-06-13 20:20:40 +0000633
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000634" Syntax: keyword {{{2
dkearns21ce1592024-01-29 04:54:08 +1100635syn cluster vimSynKeyGroup contains=@vimContinue,vimSynCchar,vimSynNextgroup,vimSynKeyOpt,vimSynKeyContainedin
Bram Moolenaar5c736222010-01-06 20:54:52 +0100636syn keyword vimSynType contained keyword skipwhite nextgroup=vimSynKeyRegion
dkearns21ce1592024-01-29 04:54:08 +1100637syn 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 +0200638syn match vimSynKeyOpt contained "\%#=1\<\(conceal\|contained\|transparent\|skipempty\|skipwhite\|skipnl\)\>"
Bram Moolenaard960d762011-09-21 19:22:10 +0200639syn cluster vimFuncBodyList add=vimSynType
Bram Moolenaar071d4272004-06-13 20:20:40 +0000640
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000641" Syntax: match {{{2
dkearns21ce1592024-01-29 04:54:08 +1100642syn cluster vimSynMtchGroup contains=@vimContinue,vimSynCchar,vimSynContains,vimSynError,vimSynMtchOpt,vimSynNextgroup,vimSynRegPat,vimNotation,vimMtchComment
Bram Moolenaar5c736222010-01-06 20:54:52 +0100643syn keyword vimSynType contained match skipwhite nextgroup=vimSynMatchRegion
dkearns21ce1592024-01-29 04:54:08 +1100644syn 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 +0200645syn match vimSynMtchOpt contained "\%#=1\<\(conceal\|transparent\|contained\|excludenl\|keepend\|skipempty\|skipwhite\|display\|extend\|skipnl\|fold\)\>"
Bram Moolenaard960d762011-09-21 19:22:10 +0200646syn cluster vimFuncBodyList add=vimSynMtchGroup
Bram Moolenaar071d4272004-06-13 20:20:40 +0000647
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000648" Syntax: off and on {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +0100649syn keyword vimSynType contained enable list manual off on reset
Bram Moolenaar071d4272004-06-13 20:20:40 +0000650
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000651" Syntax: region {{{2
dkearns21ce1592024-01-29 04:54:08 +1100652syn cluster vimSynRegPatGroup contains=@vimContinue,vimPatSep,vimNotPatSep,vimSynPatRange,vimSynNotPatRange,vimSubstSubstr,vimPatRegion,vimPatSepErr,vimNotation
653syn cluster vimSynRegGroup contains=@vimContinue,vimSynCchar,vimSynContains,vimSynNextgroup,vimSynRegOpt,vimSynReg,vimSynMtchGrp
Bram Moolenaar5c736222010-01-06 20:54:52 +0100654syn keyword vimSynType contained region skipwhite nextgroup=vimSynRegion
dkearns21ce1592024-01-29 04:54:08 +1100655syn region vimSynRegion contained keepend matchgroup=vimGroupName start="\h\w*" skip=+\\\\\|\\\|\n\s*\\\|\n\s*"\\ + end="|\|$" contains=@vimSynRegGroup
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200656syn match vimSynRegOpt contained "\%#=1\<\(conceal\(ends\)\=\|transparent\|contained\|excludenl\|skipempty\|skipwhite\|display\|keepend\|oneline\|extend\|skipnl\|fold\)\>"
dkearns21ce1592024-01-29 04:54:08 +1100657syn match vimSynReg contained "\<\%(start\|skip\|end\)=" nextgroup=vimSynRegPat
Bram Moolenaar5c736222010-01-06 20:54:52 +0100658syn match vimSynMtchGrp contained "matchgroup=" nextgroup=vimGroup,vimHLGroup
dkearns21ce1592024-01-29 04:54:08 +1100659syn 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 +0200660syn match vimSynPatMod contained "\%#=1\(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\([-+]\d\+\)\="
661syn match vimSynPatMod contained "\%#=1\(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\([-+]\d\+\)\=," nextgroup=vimSynPatMod
Bram Moolenaar5c736222010-01-06 20:54:52 +0100662syn match vimSynPatMod contained "lc=\d\+"
663syn match vimSynPatMod contained "lc=\d\+," nextgroup=vimSynPatMod
664syn region vimSynPatRange contained start="\[" skip="\\\\\|\\]" end="]"
665syn match vimSynNotPatRange contained "\\\\\|\\\["
666syn match vimMtchComment contained '"[^"]\+$'
Bram Moolenaard960d762011-09-21 19:22:10 +0200667syn cluster vimFuncBodyList add=vimSynType
Bram Moolenaar071d4272004-06-13 20:20:40 +0000668
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000669" Syntax: sync {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000670" ============
Bram Moolenaardf177f62005-02-22 08:39:57 +0000671syn keyword vimSynType contained sync skipwhite nextgroup=vimSyncC,vimSyncLines,vimSyncMatch,vimSyncError,vimSyncLinebreak,vimSyncLinecont,vimSyncRegion
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100672if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimsyncerror")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100673 syn match vimSyncError contained "\i\+"
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000674endif
Bram Moolenaar5c736222010-01-06 20:54:52 +0100675syn keyword vimSyncC contained ccomment clear fromstart
676syn keyword vimSyncMatch contained match skipwhite nextgroup=vimSyncGroupName
677syn keyword vimSyncRegion contained region skipwhite nextgroup=vimSynReg
678syn match vimSyncLinebreak contained "\<linebreaks=" skipwhite nextgroup=vimNumber
679syn keyword vimSyncLinecont contained linecont skipwhite nextgroup=vimSynRegPat
680syn match vimSyncLines contained "\(min\|max\)\=lines=" nextgroup=vimNumber
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100681syn match vimSyncGroupName contained "\h\w*" skipwhite nextgroup=vimSyncKey
Bram Moolenaar5c736222010-01-06 20:54:52 +0100682syn match vimSyncKey contained "\<groupthere\|grouphere\>" skipwhite nextgroup=vimSyncGroup
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100683syn match vimSyncGroup contained "\h\w*" skipwhite nextgroup=vimSynRegPat,vimSyncNone
Bram Moolenaar5c736222010-01-06 20:54:52 +0100684syn keyword vimSyncNone contained NONE
Bram Moolenaar071d4272004-06-13 20:20:40 +0000685
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100686" Additional IsCommand: here by reasons of precedence {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000687" ====================
Bram Moolenaar5c736222010-01-06 20:54:52 +0100688syn match vimIsCommand "<Bar>\s*\a\+" transparent contains=vimCommand,vimNotation
Bram Moolenaar071d4272004-06-13 20:20:40 +0000689
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100690" Highlighting: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000691" ============
Bram Moolenaar2c7f8c52020-04-20 19:52:53 +0200692syn cluster vimHighlightCluster contains=vimHiLink,vimHiClear,vimHiKeyList,vimComment,vim9Comment
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100693if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimhictermerror")
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200694 syn match vimHiCtermError contained "\D\i*"
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100695endif
Bram Moolenaar5c736222010-01-06 20:54:52 +0100696syn match vimHighlight "\<hi\%[ghlight]\>" skipwhite nextgroup=vimHiBang,@vimHighlightCluster
697syn match vimHiBang contained "!" skipwhite nextgroup=@vimHighlightCluster
Bram Moolenaard960d762011-09-21 19:22:10 +0200698
Bram Moolenaar5c736222010-01-06 20:54:52 +0100699syn match vimHiGroup contained "\i\+"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000700syn case ignore
dkearnsb614b282024-02-12 03:13:34 +1100701syn keyword vimHiAttrib contained none bold inverse italic nocombine reverse standout strikethrough underline undercurl underdashed underdotted underdouble
Bram Moolenaar5c736222010-01-06 20:54:52 +0100702syn keyword vimFgBgAttrib contained none bg background fg foreground
Bram Moolenaar071d4272004-06-13 20:20:40 +0000703syn case match
Bram Moolenaar5c736222010-01-06 20:54:52 +0100704syn match vimHiAttribList contained "\i\+" contains=vimHiAttrib
705syn match vimHiAttribList contained "\i\+,"he=e-1 contains=vimHiAttrib nextgroup=vimHiAttribList
Bram Moolenaar071d4272004-06-13 20:20:40 +0000706syn case ignore
Bram Moolenaard2ea7cf2021-05-30 20:54:13 +0200707syn 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 +0100708syn match vimHiCtermColor contained "\<color\d\{1,3}\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000709
710syn case match
Bram Moolenaar5c736222010-01-06 20:54:52 +0100711syn match vimHiFontname contained "[a-zA-Z\-*]\+"
712syn match vimHiGuiFontname contained "'[a-zA-Z\-* ]\+'"
713syn match vimHiGuiRgb contained "#\x\{6}"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000714
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000715" Highlighting: hi group key=arg ... {{{2
dkearnsb614b282024-02-12 03:13:34 +1100716syn cluster vimHiCluster contains=vimGroup,vimHiGroup,vimHiTerm,vimHiCTerm,vimHiStartStop,vimHiCtermFgBg,vimHiCtermul,vimHiCtermfont,vimHiGui,vimHiGuiFont,vimHiGuiFgBg,vimHiKeyError,vimNotation,vimComment,vim9comment
Bram Moolenaar5c736222010-01-06 20:54:52 +0100717syn region vimHiKeyList contained oneline start="\i\+" skip="\\\\\|\\|" end="$\||" contains=@vimHiCluster
Bram Moolenaar6be7f872012-01-20 21:08:56 +0100718if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_vimhikeyerror")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100719 syn match vimHiKeyError contained "\i\+="he=e-1
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000720endif
Bram Moolenaar5c736222010-01-06 20:54:52 +0100721syn match vimHiTerm contained "\cterm="he=e-1 nextgroup=vimHiAttribList
722syn match vimHiStartStop contained "\c\(start\|stop\)="he=e-1 nextgroup=vimHiTermcap,vimOption
723syn match vimHiCTerm contained "\ccterm="he=e-1 nextgroup=vimHiAttribList
Bram Moolenaar83d1b192015-04-13 14:22:40 +0200724syn match vimHiCtermFgBg contained "\ccterm[fb]g="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
Bram Moolenaar2547aa92020-07-26 17:00:44 +0200725syn match vimHiCtermul contained "\cctermul="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
PMuncha606f3a2023-11-15 15:35:49 +0100726syn match vimHiCtermfont contained "\cctermfont="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
Bram Moolenaar5c736222010-01-06 20:54:52 +0100727syn match vimHiGui contained "\cgui="he=e-1 nextgroup=vimHiAttribList
728syn match vimHiGuiFont contained "\cfont="he=e-1 nextgroup=vimHiFontname
729syn match vimHiGuiFgBg contained "\cgui\%([fb]g\|sp\)="he=e-1 nextgroup=vimHiGroup,vimHiGuiFontname,vimHiGuiRgb,vimFgBgAttrib
730syn match vimHiTermcap contained "\S\+" contains=vimNotation
Bram Moolenaar83d1b192015-04-13 14:22:40 +0200731syn match vimHiNmbr contained '\d\+'
Bram Moolenaar071d4272004-06-13 20:20:40 +0000732
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000733" Highlight: clear {{{2
Bram Moolenaar5c736222010-01-06 20:54:52 +0100734syn keyword vimHiClear contained clear nextgroup=vimHiGroup
Bram Moolenaar071d4272004-06-13 20:20:40 +0000735
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000736" Highlight: link {{{2
Bram Moolenaard2855f52018-07-31 22:23:58 +0200737" see tst24 (hi def vs hi) (Jul 06, 2018)
738"syn region vimHiLink contained oneline matchgroup=vimCommand start="\(\<hi\%[ghlight]\s\+\)\@<=\(\(def\%[ault]\s\+\)\=link\>\|\<def\>\)" end="$" contains=vimHiGroup,vimGroup,vimHLGroup,vimNotation
739syn region vimHiLink contained oneline matchgroup=vimCommand start="\(\<hi\%[ghlight]\s\+\)\@<=\(\(def\%[ault]\s\+\)\=link\>\|\<def\>\)" end="$" contains=@vimHiCluster
Bram Moolenaard960d762011-09-21 19:22:10 +0200740syn cluster vimFuncBodyList add=vimHiLink
Bram Moolenaar071d4272004-06-13 20:20:40 +0000741
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100742" Control Characters: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000743" ==================
Bram Moolenaar5c736222010-01-06 20:54:52 +0100744syn match vimCtrlChar "[- -]"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000745
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000746" Beginners - Patterns that involve ^ {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000747" =========
Bram Moolenaar86b48162022-12-06 18:20:10 +0000748syn match vimLineComment +^[ \t:]*".*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle,vimComment
Bram Moolenaarf269eab2022-10-03 18:04:35 +0100749syn match vimLineComment +^[ \t:]*"\("[^"]*"\|[^"]\)*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle
Bram Moolenaar4072ba52020-12-23 13:56:35 +0100750syn match vim9LineComment +^[ \t:]\+#.*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle
Bram Moolenaar5c736222010-01-06 20:54:52 +0100751syn match vimCommentTitle '"\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vimCommentTitleLeader,vimTodo,@vimCommentGroup
dkearnsc79646d2024-01-05 08:58:48 +1100752" Note: Look-behind to work around nextgroup skipnl consuming leading whitespace and preventing a match
dkearns21ce1592024-01-29 04:54:08 +1100753syn match vimContinue "^\s*\zs\\"
754syn match vimContinueComment '^\s*\zs["#]\\ .*' contained
755syn cluster vimContinue contains=vimContinue,vimContinueComment
Bram Moolenaar5c736222010-01-06 20:54:52 +0100756syn region vimString start="^\s*\\\z(['"]\)" skip='\\\\\|\\\z1' end="\z1" oneline keepend contains=@vimStringGroup,vimContinue
757syn match vimCommentTitleLeader '"\s\+'ms=s+1 contained
Bram Moolenaar071d4272004-06-13 20:20:40 +0000758
Bram Moolenaar18144c82006-04-12 21:52:12 +0000759" Searches And Globals: {{{2
760" ====================
Bram Moolenaar5c736222010-01-06 20:54:52 +0100761syn match vimSearch '^\s*[/?].*' contains=vimSearchDelim
762syn match vimSearchDelim '^\s*\zs[/?]\|[/?]$' contained
Bram Moolenaar9da7ff72015-01-14 12:52:36 +0100763syn region vimGlobal matchgroup=Statement start='\<g\%[lobal]!\=/' skip='\\.' end='/' skipwhite nextgroup=vimSubst
764syn region vimGlobal matchgroup=Statement start='\<v\%[global]!\=/' skip='\\.' end='/' skipwhite nextgroup=vimSubst
Bram Moolenaare2f98b92006-03-29 21:18:24 +0000765
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +0100766" Embedded Scripts: {{{2
767" ================
768" perl,ruby : Benoit Cerrina
769" python,tcl : Johannes Zellner
770" mzscheme, lua : Charles Campbell
Bram Moolenaar071d4272004-06-13 20:20:40 +0000771
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000772" Allows users to specify the type of embedded script highlighting
773" they want: (perl/python/ruby/tcl support)
774" g:vimsyn_embed == 0 : don't embed any scripts
Bram Moolenaarf3913272016-02-25 00:00:01 +0100775" g:vimsyn_embed =~# 'l' : embed lua (but only if vim supports it)
776" g:vimsyn_embed =~# 'm' : embed mzscheme (but only if vim supports it)
777" g:vimsyn_embed =~# 'p' : embed perl (but only if vim supports it)
778" g:vimsyn_embed =~# 'P' : embed python (but only if vim supports it)
779" g:vimsyn_embed =~# 'r' : embed ruby (but only if vim supports it)
780" g:vimsyn_embed =~# 't' : embed tcl (but only if vim supports it)
Bram Moolenaar7cba6c02013-09-05 22:13:31 +0200781if !exists("g:vimsyn_embed")
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100782 let g:vimsyn_embed= "lmpPr"
Bram Moolenaar7cba6c02013-09-05 22:13:31 +0200783endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000784
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +0200785" [-- lua --] {{{3
Bram Moolenaaradc21822011-04-01 18:03:16 +0200786let s:luapath= fnameescape(expand("<sfile>:p:h")."/lua.vim")
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +0200787if !filereadable(s:luapath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100788 for s:luapath in split(globpath(&rtp,"syntax/lua.vim"),"\n")
789 if filereadable(fnameescape(s:luapath))
790 let s:luapath= fnameescape(s:luapath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +0100791 break
792 endif
793 endfor
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +0200794endif
Bram Moolenaarf3913272016-02-25 00:00:01 +0100795if (g:vimsyn_embed =~# 'l' && has("lua")) && filereadable(s:luapath)
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +0200796 unlet! b:current_syntax
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200797 syn cluster vimFuncBodyList add=vimLuaRegion
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +0200798 exe "syn include @vimLuaScript ".s:luapath
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100799 VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+lua\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimLuaScript
Bram Moolenaar6c1e1572019-06-22 02:13:00 +0200800 VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+lua\s*<<\s*$+ end=+\.$+ contains=@vimLuaScript
Bram Moolenaar4b22cdb2010-08-02 22:12:46 +0200801 syn cluster vimFuncBodyList add=vimLuaRegion
802else
803 syn region vimEmbedError start=+lua\s*<<\s*\z(.*\)$+ end=+^\z1$+
804 syn region vimEmbedError start=+lua\s*<<\s*$+ end=+\.$+
805endif
806unlet s:luapath
807
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000808" [-- perl --] {{{3
Bram Moolenaaradc21822011-04-01 18:03:16 +0200809let s:perlpath= fnameescape(expand("<sfile>:p:h")."/perl.vim")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100810if !filereadable(s:perlpath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100811 for s:perlpath in split(globpath(&rtp,"syntax/perl.vim"),"\n")
812 if filereadable(fnameescape(s:perlpath))
813 let s:perlpath= fnameescape(s:perlpath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +0100814 break
815 endif
816 endfor
Bram Moolenaar5c736222010-01-06 20:54:52 +0100817endif
Bram Moolenaarf3913272016-02-25 00:00:01 +0100818if (g:vimsyn_embed =~# 'p' && has("perl")) && filereadable(s:perlpath)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000819 unlet! b:current_syntax
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200820 syn cluster vimFuncBodyList add=vimPerlRegion
Bram Moolenaar5c736222010-01-06 20:54:52 +0100821 exe "syn include @vimPerlScript ".s:perlpath
Bram Moolenaar15142e22018-04-30 22:19:58 +0200822 VimFoldp syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*\z(\S*\)\ze\(\s*["#].*\)\=$+ end=+^\z1\ze\(\s*[#"].*\)\=$+ contains=@vimPerlScript
823 VimFoldp syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*$+ end=+\.$+ contains=@vimPerlScript
Bram Moolenaar5c736222010-01-06 20:54:52 +0100824 syn cluster vimFuncBodyList add=vimPerlRegion
Bram Moolenaarc236c162008-07-13 17:41:49 +0000825else
826 syn region vimEmbedError start=+pe\%[rl]\s*<<\s*\z(.*\)$+ end=+^\z1$+
827 syn region vimEmbedError start=+pe\%[rl]\s*<<\s*$+ end=+\.$+
Bram Moolenaar071d4272004-06-13 20:20:40 +0000828endif
Bram Moolenaar5c736222010-01-06 20:54:52 +0100829unlet s:perlpath
Bram Moolenaar071d4272004-06-13 20:20:40 +0000830
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000831" [-- ruby --] {{{3
Bram Moolenaaradc21822011-04-01 18:03:16 +0200832let s:rubypath= fnameescape(expand("<sfile>:p:h")."/ruby.vim")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100833if !filereadable(s:rubypath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100834 for s:rubypath in split(globpath(&rtp,"syntax/ruby.vim"),"\n")
835 if filereadable(fnameescape(s:rubypath))
836 let s:rubypath= fnameescape(s:rubypath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +0100837 break
838 endif
839 endfor
Bram Moolenaar5c736222010-01-06 20:54:52 +0100840endif
Bram Moolenaarf3913272016-02-25 00:00:01 +0100841if (g:vimsyn_embed =~# 'r' && has("ruby")) && filereadable(s:rubypath)
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200842 syn cluster vimFuncBodyList add=vimRubyRegion
Bram Moolenaar071d4272004-06-13 20:20:40 +0000843 unlet! b:current_syntax
Bram Moolenaar5c736222010-01-06 20:54:52 +0100844 exe "syn include @vimRubyScript ".s:rubypath
Bram Moolenaar15142e22018-04-30 22:19:58 +0200845 VimFoldr syn region vimRubyRegion matchgroup=vimScriptDelim start=+rub[y]\s*<<\s*\z(\S*\)\ze\(\s*#.*\)\=$+ end=+^\z1\ze\(\s*".*\)\=$+ contains=@vimRubyScript
846 syn region vimRubyRegion matchgroup=vimScriptDelim start=+rub[y]\s*<<\s*$+ end=+\.$+ contains=@vimRubyScript
Bram Moolenaar5c736222010-01-06 20:54:52 +0100847 syn cluster vimFuncBodyList add=vimRubyRegion
Bram Moolenaarc236c162008-07-13 17:41:49 +0000848else
849 syn region vimEmbedError start=+rub[y]\s*<<\s*\z(.*\)$+ end=+^\z1$+
850 syn region vimEmbedError start=+rub[y]\s*<<\s*$+ end=+\.$+
Bram Moolenaar071d4272004-06-13 20:20:40 +0000851endif
Bram Moolenaar5c736222010-01-06 20:54:52 +0100852unlet s:rubypath
Bram Moolenaar071d4272004-06-13 20:20:40 +0000853
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000854" [-- python --] {{{3
Bram Moolenaaradc21822011-04-01 18:03:16 +0200855let s:pythonpath= fnameescape(expand("<sfile>:p:h")."/python.vim")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100856if !filereadable(s:pythonpath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100857 for s:pythonpath in split(globpath(&rtp,"syntax/python.vim"),"\n")
858 if filereadable(fnameescape(s:pythonpath))
859 let s:pythonpath= fnameescape(s:pythonpath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +0100860 break
861 endif
862 endfor
Bram Moolenaar5c736222010-01-06 20:54:52 +0100863endif
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200864if g:vimsyn_embed =~# 'P' && has("pythonx") && filereadable(s:pythonpath)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000865 unlet! b:current_syntax
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200866 syn cluster vimFuncBodyList add=vimPythonRegion
Bram Moolenaar5c736222010-01-06 20:54:52 +0100867 exe "syn include @vimPythonScript ".s:pythonpath
Bram Moolenaar6304be62021-11-27 10:57:26 +0000868 VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon][3x]\=\s*<<\s*\%(trim\s*\)\=\z(\S*\)\ze\(\s*#.*\)\=$+ end=+^\z1\ze\(\s*".*\)\=$+ contains=@vimPythonScript
869 VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon][3x]\=\s*<<\s*\%(trim\s*\)\=$+ end=+\.$+ contains=@vimPythonScript
870 VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+Py\%[thon]2or3\s*<<\s*\%(trim\s*\)\=\z(\S*\)\ze\(\s*#.*\)\=$+ end=+^\z1\ze\(\s*".*\)\=$+ contains=@vimPythonScript
871 VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+Py\%[thon]2or3\=\s*<<\s*\%(trim\s*\)\=$+ end=+\.$+ contains=@vimPythonScript
Bram Moolenaar5c736222010-01-06 20:54:52 +0100872 syn cluster vimFuncBodyList add=vimPythonRegion
Bram Moolenaarc236c162008-07-13 17:41:49 +0000873else
Bram Moolenaarfa01c392010-07-20 12:36:02 +0200874 syn region vimEmbedError start=+py\%[thon]3\=\s*<<\s*\z(.*\)$+ end=+^\z1$+
875 syn region vimEmbedError start=+py\%[thon]3\=\s*<<\s*$+ end=+\.$+
Bram Moolenaar071d4272004-06-13 20:20:40 +0000876endif
Bram Moolenaar5c736222010-01-06 20:54:52 +0100877unlet s:pythonpath
Bram Moolenaar071d4272004-06-13 20:20:40 +0000878
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000879" [-- tcl --] {{{3
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100880if has("win32") || has("win95") || has("win64") || has("win16")
881 " apparently has("tcl") has been hanging vim on some windows systems with cygwin
882 let s:trytcl= (&shell !~ '\<\%(bash\>\|4[nN][tT]\|\<zsh\)\>\%(\.exe\)\=$')
883else
884 let s:trytcl= 1
885endif
Bram Moolenaara6878372014-03-22 21:02:50 +0100886if s:trytcl
887 let s:tclpath= fnameescape(expand("<sfile>:p:h")."/tcl.vim")
888 if !filereadable(s:tclpath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100889 for s:tclpath in split(globpath(&rtp,"syntax/tcl.vim"),"\n")
890 if filereadable(fnameescape(s:tclpath))
891 let s:tclpath= fnameescape(s:tclpath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +0100892 break
893 endif
894 endfor
Bram Moolenaar5c736222010-01-06 20:54:52 +0100895 endif
Bram Moolenaarf3913272016-02-25 00:00:01 +0100896 if (g:vimsyn_embed =~# 't' && has("tcl")) && filereadable(s:tclpath)
Bram Moolenaara6878372014-03-22 21:02:50 +0100897 unlet! b:current_syntax
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200898 syn cluster vimFuncBodyList add=vimTclRegion
Bram Moolenaara6878372014-03-22 21:02:50 +0100899 exe "syn include @vimTclScript ".s:tclpath
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100900 VimFoldt syn region vimTclRegion matchgroup=vimScriptDelim start=+tc[l]\=\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimTclScript
901 VimFoldt syn region vimTclRegion matchgroup=vimScriptDelim start=+tc[l]\=\s*<<\s*$+ end=+\.$+ contains=@vimTclScript
Bram Moolenaara6878372014-03-22 21:02:50 +0100902 syn cluster vimFuncBodyList add=vimTclScript
903 else
904 syn region vimEmbedError start=+tc[l]\=\s*<<\s*\z(.*\)$+ end=+^\z1$+
905 syn region vimEmbedError start=+tc[l]\=\s*<<\s*$+ end=+\.$+
906 endif
907 unlet s:tclpath
Bram Moolenaarc236c162008-07-13 17:41:49 +0000908else
909 syn region vimEmbedError start=+tc[l]\=\s*<<\s*\z(.*\)$+ end=+^\z1$+
910 syn region vimEmbedError start=+tc[l]\=\s*<<\s*$+ end=+\.$+
Bram Moolenaar9964e462007-05-05 17:54:07 +0000911endif
Bram Moolenaara6878372014-03-22 21:02:50 +0100912unlet s:trytcl
Bram Moolenaar071d4272004-06-13 20:20:40 +0000913
Bram Moolenaar8299df92004-07-10 09:47:34 +0000914" [-- mzscheme --] {{{3
Bram Moolenaaradc21822011-04-01 18:03:16 +0200915let s:mzschemepath= fnameescape(expand("<sfile>:p:h")."/scheme.vim")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100916if !filereadable(s:mzschemepath)
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100917 for s:mzschemepath in split(globpath(&rtp,"syntax/mzscheme.vim"),"\n")
918 if filereadable(fnameescape(s:mzschemepath))
919 let s:mzschemepath= fnameescape(s:mzschemepath)
Bram Moolenaar9da7ff72015-01-14 12:52:36 +0100920 break
921 endif
922 endfor
Bram Moolenaar5c736222010-01-06 20:54:52 +0100923endif
Bram Moolenaarf3913272016-02-25 00:00:01 +0100924if (g:vimsyn_embed =~# 'm' && has("mzscheme")) && filereadable(s:mzschemepath)
Bram Moolenaar8299df92004-07-10 09:47:34 +0000925 unlet! b:current_syntax
Bram Moolenaar03413f42016-04-12 21:07:15 +0200926 let s:iskKeep= &isk
Bram Moolenaar51ad4ea2018-04-06 11:14:11 +0200927 syn cluster vimFuncBodyList add=vimMzSchemeRegion
Bram Moolenaar5c736222010-01-06 20:54:52 +0100928 exe "syn include @vimMzSchemeScript ".s:mzschemepath
Bram Moolenaar03413f42016-04-12 21:07:15 +0200929 let &isk= s:iskKeep
930 unlet s:iskKeep
Bram Moolenaara0f849e2015-10-30 14:37:44 +0100931 VimFoldm syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimMzSchemeScript
932 VimFoldm syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*$+ end=+\.$+ contains=@vimMzSchemeScript
Bram Moolenaar5c736222010-01-06 20:54:52 +0100933 syn cluster vimFuncBodyList add=vimMzSchemeRegion
Bram Moolenaarc236c162008-07-13 17:41:49 +0000934else
935 syn region vimEmbedError start=+mz\%[scheme]\s*<<\s*\z(.*\)$+ end=+^\z1$+
936 syn region vimEmbedError start=+mz\%[scheme]\s*<<\s*$+ end=+\.$+
Bram Moolenaar8299df92004-07-10 09:47:34 +0000937endif
Bram Moolenaar5c736222010-01-06 20:54:52 +0100938unlet s:mzschemepath
Bram Moolenaar8299df92004-07-10 09:47:34 +0000939
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000940" Synchronize (speed) {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000941"============
Bram Moolenaar3577c6f2008-06-24 21:16:56 +0000942if exists("g:vimsyn_minlines")
943 exe "syn sync minlines=".g:vimsyn_minlines
Bram Moolenaar071d4272004-06-13 20:20:40 +0000944endif
Bram Moolenaar03413f42016-04-12 21:07:15 +0200945exe "syn sync maxlines=".s:vimsyn_maxlines
Bram Moolenaar071d4272004-06-13 20:20:40 +0000946syn sync linecont "^\s\+\\"
947syn sync match vimAugroupSyncA groupthere NONE "\<aug\%[roup]\>\s\+[eE][nN][dD]"
948
Bram Moolenaar5c736222010-01-06 20:54:52 +0100949" ====================
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000950" Highlighting Settings {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000951" ====================
952
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200953if !exists("skip_vim_syntax_inits")
954 if !exists("g:vimsyn_noerror")
955 hi def link vimBehaveError vimError
956 hi def link vimCollClassErr vimError
957 hi def link vimErrSetting vimError
958 hi def link vimEmbedError vimError
959 hi def link vimFTError vimError
960 hi def link vimFunctionError vimError
961 hi def link vimFunc vimError
962 hi def link vimHiAttribList vimError
963 hi def link vimHiCtermError vimError
964 hi def link vimHiKeyError vimError
965 hi def link vimKeyCodeError vimError
966 hi def link vimMapModErr vimError
967 hi def link vimSubstFlagErr vimError
968 hi def link vimSynCaseError vimError
Brad Kingd4634a22024-01-03 10:17:24 -0500969 hi def link vimSynFoldMethodError vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200970 hi def link vimBufnrWarn vimWarn
971 endif
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000972
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200973 hi def link vimAbb vimCommand
974 hi def link vimAddress vimMark
975 hi def link vimAugroupError vimError
976 hi def link vimAugroupKey vimCommand
977 hi def link vimAuHighlight vimHighlight
978 hi def link vimAutoCmdOpt vimOption
979 hi def link vimAutoCmd vimCommand
980 hi def link vimAutoEvent Type
Bram Moolenaard58a3bf2020-09-28 21:48:16 +0200981 hi def link vimAutoCmdMod Special
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200982 hi def link vimAutoSet vimCommand
dkearnsb614b282024-02-12 03:13:34 +1100983 hi def link vimBang vimOper
Doug Kearnsfe6d5b02024-02-14 21:17:43 +0100984 hi def link vimBehaveBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200985 hi def link vimBehaveModel vimBehave
986 hi def link vimBehave vimCommand
987 hi def link vimBracket Delimiter
988 hi def link vimCmplxRepeat SpecialChar
989 hi def link vimCommand Statement
990 hi def link vimComment Comment
Bram Moolenaar2c7f8c52020-04-20 19:52:53 +0200991 hi def link vim9Comment Comment
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200992 hi def link vimCommentString vimString
993 hi def link vimCommentTitle PreProc
994 hi def link vimCondHL vimCommand
dkearnsf6869212023-12-11 01:53:24 +1100995 hi def link vimConst vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200996 hi def link vimContinue Special
dkearns21ce1592024-01-29 04:54:08 +1100997 hi def link vimContinueComment vimComment
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200998 hi def link vimCtrlChar SpecialChar
999 hi def link vimEchoHLNone vimGroup
1000 hi def link vimEchoHL vimCommand
1001 hi def link vimElseIfErr Error
1002 hi def link vimElseif vimCondHL
1003 hi def link vimEnvvar PreProc
1004 hi def link vimError Error
Bram Moolenaar6ba83ba2022-06-12 22:15:57 +01001005 hi def link vimEscape Special
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001006 hi def link vimFBVar vimVar
1007 hi def link vimFgBgAttrib vimHiAttrib
Bram Moolenaarcbaff5e2022-04-08 17:45:08 +01001008 hi def link vimFuncEcho vimCommand
Bram Moolenaar2547aa92020-07-26 17:00:44 +02001009 hi def link vimHiCtermul vimHiTerm
PMuncha606f3a2023-11-15 15:35:49 +01001010 hi def link vimHiCtermfont vimHiTerm
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001011 hi def link vimFold Folded
dkearns1c97b5c2023-12-13 02:47:43 +11001012 hi def link vimFor vimCommand
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001013 hi def link vimFTCmd vimCommand
1014 hi def link vimFTOption vimSynType
1015 hi def link vimFuncKey vimCommand
1016 hi def link vimFuncName Function
1017 hi def link vimFuncSID Special
1018 hi def link vimFuncVar Identifier
1019 hi def link vimGroupAdd vimSynOption
1020 hi def link vimGroupName vimGroup
1021 hi def link vimGroupRem vimSynOption
1022 hi def link vimGroupSpecial Special
1023 hi def link vimGroup Type
1024 hi def link vimHiAttrib PreProc
dkearnsb614b282024-02-12 03:13:34 +11001025 hi def link vimHiBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001026 hi def link vimHiClear vimHighlight
1027 hi def link vimHiCtermFgBg vimHiTerm
1028 hi def link vimHiCTerm vimHiTerm
1029 hi def link vimHighlight vimCommand
1030 hi def link vimHiGroup vimGroupName
1031 hi def link vimHiGuiFgBg vimHiTerm
1032 hi def link vimHiGuiFont vimHiTerm
1033 hi def link vimHiGuiRgb vimNumber
1034 hi def link vimHiGui vimHiTerm
1035 hi def link vimHiNmbr Number
1036 hi def link vimHiStartStop vimHiTerm
1037 hi def link vimHiTerm Type
1038 hi def link vimHLGroup vimGroup
1039 hi def link vimHLMod PreProc
1040 hi def link vimInsert vimString
1041 hi def link vimIskSep Delimiter
1042 hi def link vimKeyCode vimSpecFile
dkearns69866442023-11-22 05:43:40 +11001043 hi def link vimKeymapLineComment vimComment
1044 hi def link vimKeymapTailComment vimComment
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001045 hi def link vimKeyword Statement
1046 hi def link vimLet vimCommand
Bram Moolenaar1ff14ba2019-11-02 14:09:23 +01001047 hi def link vimLetHereDoc vimString
1048 hi def link vimLetHereDocStart Special
1049 hi def link vimLetHereDocStop Special
dkearnsf6869212023-12-11 01:53:24 +11001050 hi def link vimLetRegister Special
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001051 hi def link vimLineComment vimComment
Bram Moolenaar2c7f8c52020-04-20 19:52:53 +02001052 hi def link vim9LineComment vimComment
dkearnsb614b282024-02-12 03:13:34 +11001053 hi def link vimMapBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001054 hi def link vimMapModKey vimFuncSID
1055 hi def link vimMapMod vimBracket
1056 hi def link vimMap vimCommand
1057 hi def link vimMark Number
1058 hi def link vimMarkNumber vimNumber
dkearnsb614b282024-02-12 03:13:34 +11001059 hi def link vimMenuBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001060 hi def link vimMenuMod vimMapMod
1061 hi def link vimMenuNameMore vimMenuName
1062 hi def link vimMenuName PreProc
1063 hi def link vimMtchComment vimComment
1064 hi def link vimNorm vimCommand
1065 hi def link vimNotation Special
1066 hi def link vimNotFunc vimCommand
1067 hi def link vimNotPatSep vimString
1068 hi def link vimNumber Number
1069 hi def link vimOperError Error
1070 hi def link vimOper Operator
Bram Moolenaar388a5d42020-05-26 21:20:45 +02001071 hi def link vimOperStar vimOper
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001072 hi def link vimOption PreProc
1073 hi def link vimParenSep Delimiter
Bram Moolenaard2855f52018-07-31 22:23:58 +02001074 hi def link vimPatSepErr vimError
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001075 hi def link vimPatSepR vimPatSep
1076 hi def link vimPatSep SpecialChar
1077 hi def link vimPatSepZone vimString
1078 hi def link vimPatSepZ vimPatSep
1079 hi def link vimPattern Type
1080 hi def link vimPlainMark vimMark
1081 hi def link vimPlainRegister vimRegister
1082 hi def link vimRegister SpecialChar
1083 hi def link vimScriptDelim Comment
1084 hi def link vimSearchDelim Statement
1085 hi def link vimSearch vimString
1086 hi def link vimSep Delimiter
1087 hi def link vimSetMod vimOption
1088 hi def link vimSetSep Statement
1089 hi def link vimSetString vimString
1090 hi def link vimSpecFile Identifier
1091 hi def link vimSpecFileMod vimSpecFile
1092 hi def link vimSpecial Type
1093 hi def link vimStatement Statement
1094 hi def link vimStringCont vimString
1095 hi def link vimString String
Bram Moolenaard2855f52018-07-31 22:23:58 +02001096 hi def link vimStringEnd vimString
thincacf8695d2024-01-28 18:57:23 +01001097 hi def link vimStringInterpolationBrace vimEscape
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001098 hi def link vimSubst1 vimSubst
1099 hi def link vimSubstDelim Delimiter
1100 hi def link vimSubstFlags Special
1101 hi def link vimSubstSubstr SpecialChar
1102 hi def link vimSubstTwoBS vimString
1103 hi def link vimSubst vimCommand
1104 hi def link vimSynCaseError Error
1105 hi def link vimSynCase Type
1106 hi def link vimSyncC Type
1107 hi def link vimSyncError Error
1108 hi def link vimSyncGroupName vimGroupName
1109 hi def link vimSyncGroup vimGroupName
1110 hi def link vimSyncKey Type
1111 hi def link vimSyncNone Type
1112 hi def link vimSynContains vimSynOption
1113 hi def link vimSynError Error
Brad Kingd4634a22024-01-03 10:17:24 -05001114 hi def link vimSynFoldMethodError Error
1115 hi def link vimSynFoldMethod Type
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001116 hi def link vimSynKeyContainedin vimSynContains
1117 hi def link vimSynKeyOpt vimSynOption
dkearnsc79646d2024-01-05 08:58:48 +11001118 hi def link vimSynCchar vimSynOption
1119 hi def link vimSynCcharValue Character
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001120 hi def link vimSynMtchGrp vimSynOption
1121 hi def link vimSynMtchOpt vimSynOption
1122 hi def link vimSynNextgroup vimSynOption
1123 hi def link vimSynNotPatRange vimSynRegPat
1124 hi def link vimSynOption Special
1125 hi def link vimSynPatRange vimString
1126 hi def link vimSynRegOpt vimSynOption
1127 hi def link vimSynRegPat vimString
1128 hi def link vimSynReg Type
1129 hi def link vimSyntax vimCommand
1130 hi def link vimSynType vimSpecial
1131 hi def link vimTodo Todo
Bram Moolenaar4d8f4762021-06-27 15:18:56 +02001132 hi def link vimType Type
dkearnsf6869212023-12-11 01:53:24 +11001133 hi def link vimUnlet vimCommand
dkearnsb614b282024-02-12 03:13:34 +11001134 hi def link vimUnletBang vimBang
Bram Moolenaarf37506f2016-08-31 22:22:10 +02001135 hi def link vimUnmap vimMap
1136 hi def link vimUserAttrbCmpltFunc Special
1137 hi def link vimUserAttrbCmplt vimSpecial
1138 hi def link vimUserAttrbKey vimOption
1139 hi def link vimUserAttrb vimSpecial
1140 hi def link vimUserAttrbError Error
1141 hi def link vimUserCmdError Error
1142 hi def link vimUserCommand vimCommand
1143 hi def link vimUserFunc Normal
1144 hi def link vimVar Identifier
1145 hi def link vimWarn WarningMsg
1146endif
Bram Moolenaar071d4272004-06-13 20:20:40 +00001147
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +00001148" Current Syntax Variable: {{{2
Bram Moolenaar071d4272004-06-13 20:20:40 +00001149let b:current_syntax = "vim"
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001150
1151" ---------------------------------------------------------------------
1152" Cleanup: {{{1
Bram Moolenaara0f849e2015-10-30 14:37:44 +01001153delc VimFolda
1154delc VimFoldf
1155delc VimFoldl
1156delc VimFoldm
1157delc VimFoldp
1158delc VimFoldP
1159delc VimFoldr
1160delc VimFoldt
Bram Moolenaar6be7f872012-01-20 21:08:56 +01001161let &cpo = s:keepcpo
1162unlet s:keepcpo
Bram Moolenaar071d4272004-06-13 20:20:40 +00001163" vim:ts=18 fdm=marker