xref: /vim-8.2.3635/runtime/syntax/vim.vim (revision 071d4279)
1" Vim syntax file
2" Language:	Vim 6.3 script
3" Maintainer:	Dr. Charles E. Campbell, Jr. <[email protected]>
4" Last Change:	May 25, 2004
5" Version:	6.3-04
6" Automatically generated keyword lists: {{{1
7
8" Quit when a syntax file was already loaded {{{2
9if exists("b:current_syntax")
10  finish
11endif
12
13" vimTodo: contains common special-notices for comments {{{2
14" Use the vimCommentGroup cluster to add your own.
15syn keyword vimTodo contained	COMBAK	NOT	RELEASED	TODO	WIP
16syn cluster vimCommentGroup	contains=vimTodo,@Spell
17
18" regular vim commands {{{2
19syn keyword vimCommand contained	ab[breviate] abc[lear] abo[veleft] al[l] arga[dd] argd[elete] argdo arge[dit] argg[lobal] argl[ocal] ar[gs] argu[ment] as[cii] bad[d] ba[ll] bd[elete] be bel[owright] bf[irst] bl[ast] bm[odified] bn[ext] bN[ext] bo[tright] bp[revious] brea[k] breaka[dd] breakd[el] breakl[ist] br[ewind] bro[wse] bufdo b[uffer] buffers bun[load] bw[ipeout] ca[bbrev] cabc[lear] cal[l] cat[ch] cc ccl[ose] cd ce[nter] cf[ile] cfir[st] cg[etfile] c[hange] changes chd[ir] che[ckpath] checkt[ime] cla[st] cl[ist] clo[se] cmapc[lear] cnew[er] cn[ext] cN[ext] cnf[ile] cNf[ile] cnorea[bbrev] col[der] colo[rscheme] comc[lear] comp[iler] conf[irm] con[tinue] cope[n] co[py] cpf[ile] cp[revious] cq[uit] cr[ewind] cuna[bbrev] cu[nmap] cw[indow] debugg[reedy] delc[ommand] d[elete] DeleteFirst delf[unction] delm[ark] diffg[et] diffpatch diffpu[t] diffsplit diffthis dig[raphs] di[splay] dj[ump] dl[ist] dr[op] ds[earch] dsp[lit] echoe[rr] echom[sg] echon e[dit] el[se] elsei[f] em[enu] emenu* endf[unction] en[dif] endt[ry] endw[hile] ene[w] ex exi[t] f[ile] files filetype fina[lly] fin[d] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] folddoc[losed] foldd[oopen] foldo[pen] fu[nction] g[lobal] go[to] gr[ep] grepa[dd] ha[rdcopy] h[elp] helpf[ind] helpg[rep] helpt[ags] hid[e] his[tory] I ia[bbrev] iabc[lear] if ij[ump] il[ist] imapc[lear] inorea[bbrev] is[earch] isp[lit] iuna[bbrev] iu[nmap] j[oin] ju[mps] k keepj[umps] kee[pmarks] lan[guage] la[st] lc[d] lch[dir] le[ft] lefta[bove] l[ist] lm[ap] lmapc[lear] ln[oremap] lo[adview] loc[kmarks] ls lu[nmap] mak[e] ma[rk] marks mat[ch] menut[ranslate] mk[exrc] mks[ession] mkvie[w] mkv[imrc] mod[e] m[ove] new n[ext] N[ext] nmapc[lear] noh[lsearch] norea[bbrev] norm[al] Nread nu[mber] nun[map] Nw omapc[lear] on[ly] o[pen] opt[ions] ou[nmap] pc[lose] ped[it] pe[rl] perld[o] po[p] popu popu[p] pp[op] pre[serve] prev[ious] p[rint] P[rint] prompt promptf[ind] promptr[epl] ps[earch] pta[g] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptN[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] pyf[ile] py[thon] qa[ll] q[uit] quita[ll] r[ead] rec[over] redi[r] red[o] redr[aw] redraws[tatus] reg[isters] res[ize] ret[ab] retu[rn] rew[ind] ri[ght] rightb[elow] rub[y] rubyd[o] rubyf[ile] ru[ntime] rv[iminfo] sal[l] sa[rgument] sav[eas] sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbN[ext] sbp[revious] sbr[ewind] sb[uffer] scripte[ncoding] scrip[tnames] se[t] setf[iletype] setg[lobal] setl[ocal] sf[ind] sfir[st sh[ell] sign sil[ent] sim[alt] sla[st] sl[eep] sm[agic] sn[ext] sN[ext] sni[ff] sno[magic] so[urce] sp[lit] spr[evious] sre[wind] sta[g] star[tinsert] startr[eplace] stj[ump] st[op] stopi[nsert] sts[elect] sun[hide] sus[pend] sv[iew] syncbind t ta[g] tags tc[l] tcld[o] tclf[ile] te[aroff] tf[irst] the th[row] tj[ump] tl[ast] tm tm[enu] tn[ext] tN[ext] to[pleft] tp[revious] tr[ewind] try ts[elect] tu tu[nmenu] una[bbreviate] u[ndo] unh[ide] unm[ap] up[date] verb[ose] ve[rsion] vert[ical] v[global] vie[w] vi[sual] vmapc[lear] vne[w] vs[plit] vu[nmap] wa[ll] wh[ile] winc[md] windo winp[os] winpos* win[size] wn[ext] wN[ext] wp[revous] wq wqa[ll] w[rite] ws[verb] wv[iminfo] X xa[ll] x[it] y[ank]
20syn match   vimCommand contained	"\<z[-+^.=]"
21
22" vimOptions are caught only when contained in a vimSet {{{2
23syn keyword vimOption contained	: acd ai akm al aleph allowrevins altkeymap ambiwidth ambw anti antialias ar arab arabic arabicshape ari arshape autochdir autoindent autoread autowrite autowriteall aw awa background backspace backup backupcopy backupdir backupext backupskip balloondelay ballooneval bdir bdlay beval bex bg bh bin binary biosk bioskey bk bkc bl bomb breakat brk browsedir bs bsdir bsk bt bufhidden buflisted buftype casemap cb ccv cd cdpath cedit cf ch charconvert ci cin cindent cink cinkeys cino cinoptions cinw cinwords clipboard cmdheight cmdwinheight cmp cms co columns com comments commentstring compatible complete conc conceallevel confirm consk conskey copyindent cp cpo cpoptions cpt crb cscopepathcomp cscopeprg cscopequickfix cscopetag cscopetagorder cscopeverbose cspc csprg csqf cst csto csverb cursorbind cwh debug deco def define delcombine dex dg dict dictionary diff diffexpr diffopt digraph dip dir directory display dy ea ead eadirection eb ed edcompatible ef efm ei ek enc encoding endofline eol ep equalalways equalprg errorbells errorfile errorformat esckeys et eventignore ex expandtab exrc fcl fcs fdc fde fdi fdl fdls fdm fdn fdo fdt fen fenc fencs ff ffs fileencoding fileencodings fileformat fileformats filetype fillchars fk fkmap fml fmr fo foldclose foldcolumn foldenable foldexpr foldignore foldlevel foldlevelstart foldmarker foldmethod foldminlines foldnestmax foldopen foldtext formatoptions formatprg fp ft gcr gd gdefault gfm gfn gfs gfw ghr go gp grepformat grepprg guicursor guifont guifontset guifontwide guiheadroom guioptions guipty helpfile helpheight helplang hf hh hi hid hidden highlight history hk hkmap hkmapp hkp hl hlg hls hlsearch ic icon iconstring ignorecase im imactivatekey imak imc imcmdline imd imdisable imi iminsert ims imsearch inc include includeexpr incsearch inde indentexpr indentkeys indk inex inf infercase insertmode is isf isfname isi isident isk iskeyword isp isprint joinspaces js key keymap keymodel keywordprg km kmp kp langmap langmenu laststatus lazyredraw lbr lcs linebreak lines linespace lisp lispwords list listchars lm lmap loadplugins lpl ls lsp lw lz ma magic makeef makeprg mat matchpairs matchtime maxfuncdepth maxmapdepth maxmem maxmemtot mef menuitems mfd mh mis ml mls mm mmd mmt mod modeline modelines modifiable modified more mouse mousef mousefocus mousehide mousem mousemodel mouses mouseshape mouset mousetime mp mps nf nrformats nu number oft osfiletype pa para paragraphs paste pastetoggle patchexpr patchmode path pdev penc pex pexpr pfn pheader pi pm popt preserveindent previewheight previewwindow printdevice printencoding printexpr printfont printheader printoptions pt pvh pvw readonly remap report restorescreen revins ri rightleft rightleftcmd rl rlc ro rs rtp ru ruf ruler rulerformat runtimepath sb sbo sbr sc scb scr scroll scrollbind scrolljump scrolloff scrollopt scs sect sections secure sel selection selectmode sessionoptions sft sh shcf shell shellcmdflag shellpipe shellquote shellredir shellslash shelltype shellxquote shiftround shiftwidth shm shortmess shortname showbreak showcmd showfulltag showmatch showmode shq si sidescroll sidescrolloff siso sj slm sm smartcase smartindent smarttab smd sn so softtabstop sol sp splitbelow splitright spr sr srr ss ssl ssop st sta startofline statusline stl sts su sua suffixes suffixesadd sw swapfile swapsync swb swf switchbuf sws sxq syn syntax ta tabstop tag tagbsearch taglength tagrelative tags tagstack tb tbi tbidi tbis tbs tenc term termbidi termencoding terse textauto textmode textwidth tf tgst thesaurus tildeop timeout timeoutlen title titlelen titleold titlestring tl tm to toolbar toolbariconsize top tr ts tsl tsr ttimeout ttimeoutlen ttm tty ttybuiltin ttyfast ttym ttymouse ttyscroll ttytype tw tx uc ul undolevels updatecount updatetime ut vb vbs vdir ve verbose vi viewdir viewoptions viminfo virtualedit visualbell vop wa wak warn wb wc wcm wd weirdinvert wfh wh whichwrap wig wildchar wildcharm wildignore wildmenu wildmode wim winaltkeys winfixheight winheight winminheight winminwidth winwidth wiv wiw wm wmh wmnu wmw wrap wrapmargin wrapscan write writeany writebackup writedelay ws ww
24
25" vimOptions: These are the turn-off setting variants {{{2
26syn keyword vimOption contained	noacd noai noakm noallowrevins noaltkeymap noanti noantialias noar noarab noarabic noarabicshape noari noarshape noautochdir noautoindent noautoread noautowrite noautowriteall noaw noawa nobackup noballooneval nobeval nobin nobinary nobiosk nobioskey nobk nobl nobomb nobuflisted nocf noci nocin nocindent nocompatible noconfirm noconsk noconskey nocopyindent nocp nocrb nocscopetag nocscopeverbose nocst nocsverb nocursorbind nodeco nodelcombine nodg nodiff nodigraph nodisable noea noeb noed noedcompatible noek noendofline noeol noequalalways noerrorbells noesckeys noet noex noexpandtab noexrc nofen nofk nofkmap nofoldenable nogd nogdefault noguipty nohid nohidden nohk nohkmap nohkmapp nohkp nohls nohlsearch noic noicon noignorecase noim noimc noimcmdline noimd noincsearch noinf noinfercase noinsertmode nois nojoinspaces nojs nolazyredraw nolbr nolinebreak nolisp nolist noloadplugins nolpl nolz noma nomagic nomh noml nomod nomodeline nomodifiable nomodified nomore nomousef nomousefocus nomousehide nonu nonumber nopaste nopi nopreserveindent nopreviewwindow nopvw noreadonly noremap norestorescreen norevins nori norightleft norightleftcmd norl norlc noro nors noru noruler nosb nosc noscb noscrollbind noscs nosecure nosft noshellslash noshiftround noshortname noshowcmd noshowfulltag noshowmatch noshowmode nosi nosm nosmartcase nosmartindent nosmarttab nosmd nosn nosol nosplitbelow nosplitright nospr nosr nossl nosta nostartofline noswapfile noswf nota notagbsearch notagrelative notagstack notbi notbidi notbs notermbidi noterse notextauto notextmode notf notgst notildeop notimeout notitle noto notop notr nottimeout nottybuiltin nottyfast notx novb novisualbell nowa nowarn nowb noweirdinvert nowfh nowildmenu nowinfixheight nowiv nowmnu nowrap nowrapscan nowrite nowriteany nowritebackup nows
27
28" vimOptions: These are the invertible variants {{{2
29syn keyword vimOption contained	invacd invai invakm invallowrevins invaltkeymap invanti invantialias invar invarab invarabic invarabicshape invari invarshape invautochdir invautoindent invautoread invautowrite invautowriteall invaw invawa invbackup invballooneval invbeval invbin invbinary invbiosk invbioskey invbk invbl invbomb invbuflisted invcf invci invcin invcindent invcompatible invconfirm invconsk invconskey invcopyindent invcp invcrb invcscopetag invcscopeverbose invcst invcsverb invcursorbind invdeco invdelcombine invdg invdiff invdigraph invdisable invea inveb inved invedcompatible invek invendofline inveol invequalalways inverrorbells invesckeys invet invex invexpandtab invexrc invfen invfk invfkmap invfoldenable invgd invgdefault invguipty invhid invhidden invhk invhkmap invhkmapp invhkp invhls invhlsearch invic invicon invignorecase invim invimc invimcmdline invimd invincsearch invinf invinfercase invinsertmode invis invjoinspaces invjs invlazyredraw invlbr invlinebreak invlisp invlist invloadplugins invlpl invlz invma invmagic invmh invml invmod invmodeline invmodifiable invmodified invmore invmousef invmousefocus invmousehide invnu invnumber invpaste invpi invpreserveindent invpreviewwindow invpvw invreadonly invremap invrestorescreen invrevins invri invrightleft invrightleftcmd invrl invrlc invro invrs invru invruler invsb invsc invscb invscrollbind invscs invsecure invsft invshellslash invshiftround invshortname invshowcmd invshowfulltag invshowmatch invshowmode invsi invsm invsmartcase invsmartindent invsmarttab invsmd invsn invsol invsplitbelow invsplitright invspr invsr invssl invsta invstartofline invswapfile invswf invta invtagbsearch invtagrelative invtagstack invtbi invtbidi invtbs invtermbidi invterse invtextauto invtextmode invtf invtgst invtildeop invtimeout invtitle invto invtop invtr invttimeout invttybuiltin invttyfast invtx invvb invvisualbell invwa invwarn invwb invweirdinvert invwfh invwildmenu invwinfixheight invwiv invwmnu invwrap invwrapscan invwrite invwriteany invwritebackup invws
30
31" termcap codes (which can also be set) {{{2
32syn keyword vimOption contained	t_AB t_AF t_al t_AL t_bc t_cd t_ce t_cl t_cm t_Co t_cs t_CS t_CV t_da t_db t_dl t_DL t_F1 t_F2 t_F3 t_F4 t_F5 t_F6 t_F7 t_F8 t_F9 t_fs t_IE t_IS 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_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_ks t_ku t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_RI t_RV t_Sb t_se t_Sf t_so t_sr t_te t_ti t_ts t_ue t_us t_ut t_vb t_ve t_vi t_vs t_WP t_WS t_xs t_ZH t_ZR
33syn match   vimOption contained	"t_%1"
34syn match   vimOption contained	"t_#2"
35syn match   vimOption contained	"t_#4"
36syn match   vimOption contained	"t_@7"
37syn match   vimOption contained	"t_*7"
38syn match   vimOption contained	"t_&8"
39syn match   vimOption contained	"t_%i"
40syn match   vimOption contained	"t_k;"
41
42" unsupported settings: these are supported by vi but don't do anything in vim {{{2
43syn keyword vimErrSetting contained	hardtabs ht w1200 w300 w9600 wi window
44
45" AutoBuf Events {{{2
46syn case ignore
47syn keyword vimAutoEvent contained	BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre Cmd-event CmdwinEnter CmdwinLeave CursorHold E135 E143 E200 E201 E203 E204 EncodingChanged FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter RemoteReply StdinReadPost StdinReadPre Syntax TermChanged TermResponse User UserGettingBored VimEnter VimLeave VimLeavePre WinEnter WinLeave
48
49" Highlight commonly used Groupnames {{{2
50syn 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
51
52" Default highlighting groups {{{2
53syn keyword vimHLGroup contained	Conceal Cursor CursorIM DiffAdd DiffChange DiffDelete DiffText Directory ErrorMsg FoldColumn Folded IncSearch LineNr Menu ModeMsg MoreMsg NonText Normal Question Scrollbar Search SignColumn SpecialKey StatusLine StatusLineNC Title Tooltip VertSplit Visual VisualNOS WarningMsg WildMenu
54syn case match
55
56" Function Names {{{2
57syn keyword vimFuncName contained	append argc argidx argv browse bufexists buflisted bufloaded bufname bufnr bufwinnr byte2line char2nr cindent col confirm cscope_connection cursor delete did_filetype escape eventhandler executable exists expand filereadable filewritable fnamemodify foldclosed foldclosedend foldlevel foldtext foreground function getbufvar getchar getcharmod getcmdline getcmdpos getcwd getfsize getftime getline getreg getregtype getwinposx getwinposy getwinvar glob globpath has hasmapto histadd histdel histget histnr hlexists hlID hostname iconv indent input inputdialog inputrestore inputsave inputsecret isdirectory libcall libcallnr line line2byte lispindent localtime maparg mapcheck match matchend matchstr mode nextnonblank nr2char prevnonblank remote_expr remote_foreground remote_peek remote_read remote_send rename resolve search searchpair server2client serverlist setbufvar setcmdpos setline setreg setwinvar simplify strftime stridx strlen strpart strridx strtrans submatch substitute synID synIDattr synIDtrans system tempname tolower toupper type virtcol visualmode winbufnr wincol winheight winline winnr winrestcmd winwidth
58
59"--- syntax above generated by mkvimvim ---
60
61" Special Vim Highlighting {{{1
62
63" Numbers {{{1
64" =======
65syn match vimNumber	"\<\d\+\([lL]\|\.\d\+\)\="
66syn match vimNumber	"-\d\+\([lL]\|\.\d\+\)\="
67syn match vimNumber	"\<0[xX]\x\+"
68syn match vimNumber	"#\x\{6}"
69
70" All vimCommands are contained by vimIsCommands. {{{1
71syn match vimCmdSep	"[:|]\+"	skipwhite nextgroup=vimAddress,vimAutoCmd,vimCommand,vimExtCmd,vimFilter,vimLet,vimMap,vimMark,vimSet,vimSyntax,vimUserCmd
72syn match vimIsCommand	"\<\a\+\>"	contains=vimCommand
73syn match vimVar		"\<[bwglsav]:\K\k*\>"
74syn match vimVar contained	"\<\K\k*\>"
75
76" Insertions And Appends: insert append {{{1
77" =======================
78syn region vimInsert	matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=a\%[ppend]$"	matchgroup=vimCommand end="^\.$""
79syn region vimInsert	matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=c\%[hange]$"	matchgroup=vimCommand end="^\.$""
80syn region vimInsert	matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=i\%[nsert]$"	matchgroup=vimCommand end="^\.$""
81
82" Behave! {{{1
83" =======
84syn match   vimBehave	"\<be\%[have]\>" skipwhite nextgroup=vimBehaveModel,vimBehaveError
85syn keyword vimBehaveModel contained	mswin	xterm
86syn match   vimBehaveError contained	"[^ ]\+"
87
88" Filetypes {{{1
89" =========
90syn match   vimFiletype	"\<filet\%[ype]\(\s\+\I\i*\)*\(|\|$\)"	skipwhite contains=vimFTCmd,vimFTOption,vimFTError
91syn match   vimFTError  contained	"\I\i*"
92syn keyword vimFTCmd    contained	filet[ype]
93syn keyword vimFTOption contained	detect indent off on plugin
94
95" Augroup : vimAugroupError removed because long augroups caused sync'ing problems. {{{1
96" ======= : Trade-off: Increasing synclines with slower editing vs augroup END error checking.
97syn cluster vimAugroupList	contains=vimIsCommand,vimFunction,vimFunctionError,vimLineComment,vimSpecFile,vimOper,vimNumber,vimComment,vimString,vimSubst,vimMark,vimRegister,vimAddress,vimFilter,vimCmplxRepeat,vimComment,vimLet,vimSet,vimAutoCmd,vimRegion,vimSynLine,vimNotation,vimCtrlChar,vimFuncVar,vimContinue
98syn region  vimAugroup	start="\<aug\%[roup]\>\s\+\K\k*" end="\<aug\%[roup]\>\s\+[eE][nN][dD]\>"	contains=vimAugroupKey,vimAutoCmd,@vimAugroupList keepend
99syn match   vimAugroupError	"\<aug\%[roup]\>\s\+[eE][nN][dD]\>"
100syn keyword vimAugroupKey contained	aug[roup]
101
102" Functions : Tag is provided for those who wish to highlight tagged functions {{{1
103" =========
104syn cluster vimFuncList	contains=vimFuncKey,Tag,vimFuncSID
105syn cluster vimFuncBodyList	contains=vimIsCommand,vimFunction,vimFunctionError,vimFuncBody,vimLineComment,vimSpecFile,vimOper,vimNumber,vimComment,vimString,vimSubst,vimMark,vimRegister,vimAddress,vimFilter,vimCmplxRepeat,vimComment,vimLet,vimSet,vimAutoCmd,vimRegion,vimSynLine,vimNotation,vimCtrlChar,vimFuncVar,vimContinue
106syn match   vimFunctionError	"\<fu\%[nction]!\=\s\+\zs\U\i\{-}\ze\s*("                	contains=vimFuncKey,vimFuncBlank nextgroup=vimFuncBody
107syn match   vimFunction	"\<fu\%[nction]!\=\s\+\(<[sS][iI][dD]>\|[Ss]:\|\u\)\i*\ze\s*("	contains=@vimFuncList nextgroup=vimFuncBody
108syn region  vimFuncBody  contained	start=")"	end="\<endf\%[unction]"		contains=@vimFuncBodyList
109syn match   vimFuncVar   contained	"a:\(\I\i*\|\d\+\)"
110syn match   vimFuncSID   contained	"\c<sid>\|\<s:"
111syn keyword vimFuncKey   contained	fu[nction]
112syn match   vimFuncBlank contained	"\s\+"
113
114syn keyword vimPattern  contained	start	skip	end
115
116" Operators: {{{1
117" =========
118syn cluster vimOperGroup	contains=vimOper,vimOperParen,vimNumber,vimString
119syn match  vimOper                 	"\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\)[?#]\{0,2}"	skipwhite nextgroup=vimString,vimSpecFile
120syn match  vimOper                 	"||\|&&\|[-+.]"	skipwhite nextgroup=vimString,vimSpecFile
121syn region vimOperParen	matchgroup=vimOper start="(" end=")" contains=@vimOperGroup
122syn match  vimOperError	")"
123
124" Special Filenames, Modifiers, Extension Removal: {{{1
125" ===============================================
126syn match vimSpecFile	"<c\(word\|WORD\)>"	nextgroup=vimSpecFileMod,vimSubst
127syn match vimSpecFile	"<\([acs]file\|amatch\|abuf\)>"	nextgroup=vimSpecFileMod,vimSubst
128syn match vimSpecFile	"\s%[ \t:]"ms=s+1,me=e-1	nextgroup=vimSpecFileMod,vimSubst
129syn match vimSpecFile	"\s%$"ms=s+1	nextgroup=vimSpecFileMod,vimSubst
130syn match vimSpecFile	"\s%<"ms=s+1,me=e-1	nextgroup=vimSpecFileMod,vimSubst
131syn match vimSpecFile	"#\d\+\|[#%]<\>"	nextgroup=vimSpecFileMod,vimSubst
132syn match vimSpecFileMod	"\(:[phtre]\)\+"	contained
133
134" User-Specified Commands: {{{1
135" =======================
136syn cluster vimUserCmdList	contains=vimAddress,vimSyntax,vimHighlight,vimAutoCmd,vimCmplxRepeat,vimComment,vimCtrlChar,vimEscapeBrace,vimFilter,vimFunc,vimFunction,vimIsCommand,vimMark,vimNotation,vimNumber,vimOper,vimRegion,vimRegister,vimLet,vimSet,vimSetEqual,vimSetString,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange,vimSynLine
137syn keyword vimUserCommand	contained	com[mand]
138syn match   vimUserCmd	"\<com\%[mand]!\=\>.*$"	contains=vimUserAttrb,vimUserCommand,@vimUserCmdList
139syn match   vimUserAttrb	contained	"-n\%[args]=[01*?+]"	contains=vimUserAttrbKey,vimOper
140syn match   vimUserAttrb	contained	"-com\%[plete]="	contains=vimUserAttrbKey,vimOper nextgroup=vimUserAttrbCmplt,vimUserCmdError
141syn match   vimUserAttrb	contained	"-ra\%[nge]\(=%\|=\d\+\)\="	contains=vimNumber,vimOper,vimUserAttrbKey
142syn match   vimUserAttrb	contained	"-cou\%[nt]=\d\+"	contains=vimNumber,vimOper,vimUserAttrbKey
143syn match   vimUserAttrb	contained	"-bang\=\>"	contains=vimOper,vimUserAttrbKey
144syn match   vimUserAttrb	contained	"-bar\>"	contains=vimOper,vimUserAttrbKey
145syn match   vimUserAttrb	contained	"-re\%[gister]\>"	contains=vimOper,vimUserAttrbKey
146syn match   vimUserCmdError	contained	"\S\+\>"
147syn case ignore
148syn keyword vimUserAttrbKey   contained	bar	ban[g]	cou[nt]	ra[nge] com[plete]	n[args]	re[gister]
149syn keyword vimUserAttrbCmplt contained	augroup buffer command dir environment event expression file function help highlight mapping menu option tag tag_listfiles var
150syn case match
151syn match   vimUserAttrbCmplt contained	"custom,\u\w*"
152
153" Errors: {{{1
154" ======
155syn match  vimElseIfErr	"\<else\s\+if\>"
156
157" Lower Priority Comments: after some vim commands... {{{1
158" =======================
159syn match  vimComment	excludenl +\s"[^\-:.%#=*].*$+lc=1	contains=@vimCommentGroup,vimCommentString
160syn match  vimComment	+\<endif\s\+".*$+lc=5	contains=@vimCommentGroup,vimCommentString
161syn match  vimComment	+\<else\s\+".*$+lc=4	contains=@vimCommentGroup,vimCommentString
162syn region vimCommentString	contained oneline start='\S\s\+"'ms=s+1	end='"'
163
164" Environment Variables: {{{1
165" =====================
166syn match vimEnvvar	"\$\I\i*"
167syn match vimEnvvar	"\${\I\i*}"
168
169" In-String Specials: {{{1
170" Try to catch strings, if nothing else matches (therefore it must precede the others!)
171"  vimEscapeBrace handles ["]  []"] (ie. "s don't terminate string inside [])
172syn region vimEscapeBrace	oneline contained transparent	start="[^\\]\(\\\\\)*\[\^\=\]\=" skip="\\\\\|\\\]" end="\]"me=e-1
173syn match  vimPatSepErr	contained	"\\)"
174syn match  vimPatSep	contained	"\\|"
175syn region vimPatSepZone	oneline contained transparent matchgroup=vimPatSep start="\\%\=(" skip="\\\\" end="\\)"	contains=@vimStringGroup
176syn region vimPatSepZone	oneline contained matchgroup=vimPatSep start="\\%\=(" skip="\\\\" end="\\)"	contains=@vimStringGroup
177syn region vimPatRegion	contained transparent matchgroup=vimPatSep start="\\[z%]\=(" end="\\)"	contains=@vimSubstList oneline
178syn match  vimNotPatSep	contained	"\\\\"
179syn cluster vimStringGroup	contains=vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone
180syn region vimString	oneline keepend	start=+[^:a-zA-Z>!\\]"+lc=1 skip=+\\\\\|\\"+ end=+"+	contains=@vimStringGroup
181syn region vimString	oneline keepend	start=+[^:a-zA-Z>!\\]'+lc=1 end=+'+	contains=@vimStringGroup
182syn region vimString	oneline	start=+=!+lc=1	skip=+\\\\\|\\!+ end=+!+	contains=@vimStringGroup
183syn region vimString	oneline	start="=+"lc=1	skip="\\\\\|\\+" end="+"	contains=@vimStringGroup
184syn region vimString	oneline	start="[^\\]+\s*[^a-zA-Z0-9. \t]"lc=1 skip="\\\\\|\\+" end="+"	contains=@vimStringGroup
185syn region vimString	oneline	start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/"	contains=@vimStringGroup
186syn match  vimString	contained	+"[^"]*\\$+	skipnl nextgroup=vimStringCont
187syn match  vimStringCont	contained	+\(\\\\\|.\)\{-}[^\\]"+
188
189" Substitutions: {{{1
190" =============
191syn cluster vimSubstList	contains=vimPatSep,vimPatRegion,vimPatSepErr,vimSubstTwoBS,vimSubstRange,vimNotation
192syn cluster vimSubstRepList	contains=vimSubstSubstr,vimSubstTwoBS,vimNotation
193syn cluster vimSubstList	add=vimCollection
194syn match   vimSubst	"\(:\+\s*\|^\s*\||\s*\)\<s\%[ubstitute][:[:alpha:]]\@!" nextgroup=vimSubstPat
195syn match   vimSubst	"s\%[ubstitute][:[:alpha:]]\@!"	nextgroup=vimSubstPat contained
196syn match   vimSubst	"/\zss\%[ubstitute]\ze/"	nextgroup=vimSubstPat
197syn match   vimSubst1       contained	"s\%[ubstitute]\>"	nextgroup=vimSubstPat
198syn 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
199syn region  vimSubstRep4    contained	matchgroup=vimSubstDelim start="\z(.\)" skip="\\\\\|\\\z1" end="\z1" matchgroup=vimNotation end="<[cC][rR]>" contains=@vimSubstRepList	nextgroup=vimSubstFlagErr	oneline
200syn region  vimCollection   contained transparent	start="\\\@<!\[" skip="\\\[" end="\]"	contains=vimCollClass
201syn match   vimCollClassErr contained	"\[:.\{-\}:\]"
202syn match   vimCollClass    contained transparent	"\[:\(alnum\|alpha\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|xdigit\|return\|tab\|escape\|backspace\):\]"
203syn match   vimSubstSubstr  contained	"\\z\=\d"
204syn match   vimSubstTwoBS   contained	"\\\\"
205syn match   vimSubstFlagErr contained	"[^< \t\r]\+" contains=vimSubstFlags
206syn match   vimSubstFlags   contained	"[&cegiIpr]\+"
207
208" 'String': {{{1
209syn match  vimString	"[^(,]'[^']\{-}'"lc=1	contains=@vimStringGroup
210
211" Marks, Registers, Addresses, Filters: {{{1
212syn match  vimMark	"'[a-zA-Z0-9]\ze[-+,!]"	nextgroup=vimOper,vimMarkNumber,vimSubst
213syn match  vimMark	"'[<>]\ze[-+,!]"		nextgroup=vimOper,vimMarkNumber,vimSubst
214syn match  vimMark	",\zs'[<>]\ze"		nextgroup=vimOper,vimMarkNumber,vimSubst
215syn match  vimMark	"[!,:]\zs'[a-zA-Z0-9]"	nextgroup=vimOper,vimMarkNumber,vimSubst
216syn match  vimMark	"\<norm\%[al]\s\zs'[a-zA-Z0-9]"	nextgroup=vimOper,vimMarkNumber,vimSubst
217syn match  vimMarkNumber	"[-+]\d\+"		nextgroup=vimSubst contained contains=vimOper
218syn match  vimPlainMark contained	"'[a-zA-Z0-9]"
219
220syn match  vimRegister	'[^(,;.]"[a-zA-Z0-9.%#:_\-/][^a-zA-Z_"]'lc=1,me=e-1
221syn match  vimRegister	'\<norm\s\+"[a-zA-Z0-9]'lc=5
222syn match  vimRegister	'\<normal\s\+"[a-zA-Z0-9]'lc=7
223syn match  vimPlainRegister contained	'"[a-zA-Z0-9\-:.%#*+=]'
224
225syn match  vimAddress	",[.$]"lc=1	skipwhite nextgroup=vimSubst1
226syn match  vimAddress	"%\a"me=e-1	skipwhite nextgroup=vimString,vimSubst1
227
228syn match  vimFilter contained	"^!.\{-}\(|\|$\)"		contains=vimSpecFile
229syn match  vimFilter contained	"\A!.\{-}\(|\|$\)"ms=s+1	contains=vimSpecFile
230
231" Complex repeats (:h complex-repeat) {{{1
232syn match  vimCmplxRepeat	'[^a-zA-Z_/\\]q[0-9a-zA-Z"]'lc=1
233syn match  vimCmplxRepeat	'@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\)'
234
235" Set command and associated set-options (vimOptions) with comment {{{1
236syn region vimSet		matchgroup=vimCommand start="\<setlocal\|set\>" end="|"me=e-1 end="$" matchgroup=vimNotation end="<[cC][rR]>" keepend contains=vimSetEqual,vimOption,vimErrSetting,vimComment,vimSetString,vimSetMod
237syn region vimSetEqual  contained	start="="	skip="\\\\\|\\\s" end="[| \t]\|$"me=e-1 contains=vimCtrlChar,vimSetSep,vimNotation
238syn region vimSetString contained	start=+="+hs=s+1	skip=+\\\\\|\\"+  end=+"+	contains=vimCtrlChar
239syn match  vimSetSep    contained	"[,:]"
240syn match  vimSetMod	contained	"&vim\|[!&]\|all&"
241
242" Let {{{1
243" ===
244syn keyword vimLet	let	unl[et]	skipwhite nextgroup=vimVar
245
246" Autocmd {{{1
247" =======
248syn match   vimAutoEventList	contained	"\(!\s\+\)\=\(\a\+,\)*\a\+"	contains=vimAutoEvent nextgroup=vimAutoCmdSpace
249syn match   vimAutoCmdSpace	contained	"\s\+"	nextgroup=vimAutoCmdSfxList
250syn match   vimAutoCmdSfxList	contained	"\S*"
251syn keyword vimAutoCmd	au[tocmd] do[autocmd] doautoa[ll]	skipwhite nextgroup=vimAutoEventList
252
253" Echo and Execute -- prefer strings! {{{1
254" ================
255syn region  vimEcho	oneline excludenl matchgroup=vimCommand start="\<ec\%[ho]\>" skip="\(\\\\\)*\\|" end="$\||" contains=vimFunc,vimString,varVar
256syn region  vimExecute	oneline excludenl matchgroup=vimCommand start="\<exe\%[cute]\>" skip="\(\\\\\)*\\|" end="$\||\|<[cC][rR]>" contains=vimIsCommand,vimString,vimOper,vimVar,vimNotation
257syn match   vimEchoHL	"echohl\="	skipwhite nextgroup=vimGroup,vimHLGroup,vimEchoHLNone
258syn case ignore
259syn keyword vimEchoHLNone	none
260syn case match
261
262" Maps {{{1
263" ====
264syn cluster vimMapGroup	contains=vimMapBang,vimMapLhs,vimMapMod
265syn keyword vimMap	cm[ap] cno[remap] im[ap] ino[remap] map nm[ap] nn[oremap] no[remap] om[ap] ono[remap] vm[ap] vn[oremap] skipwhite nextgroup=@vimMapGroup
266syn match   vimMapLhs    contained	"\S\+"	contains=vimNotation,vimCtrlChar
267syn match   vimMapBang   contained	"!"	skipwhite nextgroup=vimMapLhs
268syn match   vimMapMod    contained	"\c<\(buffer\|\(local\)\=leader\|plug\|script\|sid\|unique\|silent\)\+>" skipwhite contains=vimMapModKey,vimMapModErr nextgroup=@vimMapGroup
269syn case ignore
270syn keyword vimMapModKey contained	buffer	leader	localleader	plug	script	sid	silent	unique
271syn case match
272
273" Menus {{{1
274" =====
275syn cluster vimMenuList contains=vimMenuBang,vimMenuPriority,vimMenuName,vimMenuMod
276syn 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] unme[nu] vme[nu] vnoreme[nu] vunme[nu] skipwhite nextgroup=@vimMenuList
277syn match   vimMenuName	"[^ \t\\<]\+"	contained nextgroup=vimMenuNameMore,vimMenuMap
278syn match   vimMenuPriority	"\d\+\(\.\d\+\)*"	contained skipwhite nextgroup=vimMenuName
279syn match   vimMenuNameMore	"\c\\\s\|<tab>\|\\\."	contained nextgroup=vimMenuName,vimMenuNameMore contains=vimNotation
280syn match   vimMenuMod    contained	"\c<\(script\|silent\)\+>"  skipwhite contains=vimMapModKey,vimMapModErr nextgroup=@vimMenuList
281syn match   vimMenuMap	"\s"	contained skipwhite nextgroup=vimMenuRhs
282syn match   vimMenuRhs	".*$"	contained contains=vimString,vimComment,vimIsCommand
283syn match   vimMenuBang	"!"	contained skipwhite nextgroup=@vimMenuList
284
285" Angle-Bracket Notation (tnx to Michael Geddes) {{{1
286" ======================
287syn case ignore
288syn match vimNotation	"\(\\\|<lt>\)\=<\([scam]-\)\{0,4}x\=\(f\d\{1,2}\|[^ \t:]\|cr\|lf\|linefeed\|return\|k\=del\%[ete]\|bs\|backspace\|tab\|esc\|right\|left\|help\|undo\|insert\|ins\|k\=home\|k\=end\|kplus\|kminus\|kdivide\|kmultiply\|kenter\|space\|k\=\(page\)\=\(\|down\|up\)\)>" contains=vimBracket
289syn match vimNotation	"\(\\\|<lt>\)\=<\([scam2-4]-\)\{0,4}\(right\|left\|middle\)\(mouse\)\=\(drag\|release\)\=>"	contains=vimBracket
290syn match vimNotation	"\(\\\|<lt>\)\=<\(bslash\|plug\|sid\|space\|bar\|nop\|nul\|lt\)>"	contains=vimBracket
291syn match vimNotation	'\(\\\|<lt>\)\=<C-R>[0-9a-z"%#:.\-=]'he=e-1	contains=vimBracket
292syn match vimNotation	'\(\\\|<lt>\)\=<\(line[12]\|count\|bang\|reg\|args\|lt\|[qf]-args\)>'	contains=vimBracket
293syn match vimNotation	"\(\\\|<lt>\)\=<\([cas]file\|abuf\|amatch\|cword\|cWORD\|client\)>"	contains=vimBracket
294syn match vimBracket contained	"[\\<>]"
295syn case match
296
297" User Function Highlighting (following Gautam Iyer's suggestion)
298" ==========================
299syn match vimFunc	"\%([sS]:\|<[sS][iI][dD]>\)\=\I\i*\ze\s*("		contains=vimUserFunc,vimFuncName
300syn match vimUserFunc "\%([sS]:\|<[sS][iI][dD]>\)\i\+\|\<\u\i*\>\|\<if\>"	contained contains=vimNotation,vimCommand
301
302" Syntax {{{1
303"=======
304syn match   vimGroupList	contained	"@\=[^ \t,]*"	contains=vimGroupSpecial,vimPatSep
305syn match   vimGroupList	contained	"@\=[^ \t,]*,"	nextgroup=vimGroupList contains=vimGroupSpecial,vimPatSep
306syn keyword vimGroupSpecial	contained	ALL	ALLBUT
307syn match   vimSynError	contained	"\i\+"
308syn match   vimSynError	contained	"\i\+="	nextgroup=vimGroupList
309syn match   vimSynContains	contained	"\<contain\(s\|edin\)="	nextgroup=vimGroupList
310syn match   vimSynKeyContainedin	contained	"\<containedin="	nextgroup=vimGroupList
311syn match   vimSynNextgroup	contained	"nextgroup="	nextgroup=vimGroupList
312
313syn match   vimSyntax	"\<sy\%[ntax]\>"	contains=vimCommand skipwhite nextgroup=vimSynType,vimComment
314syn match   vimAuSyntax	contained	"\s+sy\%[ntax]"	contains=vimCommand skipwhite nextgroup=vimSynType,vimComment
315
316" Syntax: case {{{1
317syn keyword vimSynType	contained	case	skipwhite nextgroup=vimSynCase,vimSynCaseError
318syn match   vimSynCaseError	contained	"\i\+"
319syn keyword vimSynCase	contained	ignore	match
320
321" Syntax: clear {{{1
322syn keyword vimSynType	contained	clear	skipwhite nextgroup=vimGroupList
323
324" Syntax: cluster {{{1
325syn keyword vimSynType	contained	cluster	skipwhite nextgroup=vimClusterName
326syn region  vimClusterName	contained	matchgroup=vimGroupName start="\k\+" skip="\\\\\|\\|" matchgroup=vimSep end="$\||" contains=vimGroupAdd,vimGroupRem,vimSynContains,vimSynError
327syn match   vimGroupAdd	contained	"add="	nextgroup=vimGroupList
328syn match   vimGroupRem	contained	"remove="	nextgroup=vimGroupList
329
330" Syntax: include {{{1
331syn keyword vimSynType	contained	include	skipwhite nextgroup=vimGroupList
332
333" Syntax: keyword {{{1
334syn cluster vimSynKeyGroup	contains=vimSynNextgroup,vimSynKeyOpt,vimSynKeyContainedin
335syn keyword vimSynType	contained	keyword	skipwhite nextgroup=vimSynKeyRegion
336syn region  vimSynKeyRegion	contained keepend	matchgroup=vimGroupName start="\k\+" skip="\\\\\|\\|" matchgroup=vimSep end="|\|$" contains=@vimSynKeyGroup
337syn match   vimSynKeyOpt	contained	"\<\(conceal\|contained\|transparent\|skipempty\|skipwhite\|skipnl\)\>"
338
339" Syntax: match {{{1
340syn cluster vimSynMtchGroup	contains=vimMtchComment,vimSynContains,vimSynError,vimSynMtchOpt,vimSynNextgroup,vimSynRegPat,vimNotation
341syn keyword vimSynType	contained	match	skipwhite nextgroup=vimSynMatchRegion
342syn region  vimSynMatchRegion	contained keepend	matchgroup=vimGroupName start="\k\+" matchgroup=vimSep end="|\|$" contains=@vimSynMtchGroup
343syn match   vimSynMtchOpt	contained	"\<\(conceal\|transparent\|contained\|excludenl\|skipempty\|skipwhite\|display\|extend\|skipnl\|fold\)\>"
344if has("conceal")
345 syn match   vimSynMtchOpt	contained	"\<cchar="	nextgroup=VimSynMtchCchar
346 syn match   vimSynMtchCchar	contained	"."
347endif
348
349" Syntax: off and on {{{1
350syn keyword vimSynType	contained	enable	list	manual	off	on	reset
351
352" Syntax: region {{{1
353syn cluster vimSynRegPatGroup	contains=vimPatSep,vimNotPatSep,vimSynPatRange,vimSynNotPatRange,vimSubstSubstr,vimPatRegion,vimPatSepErr,vimNotation
354syn cluster vimSynRegGroup	contains=vimSynContains,vimSynNextgroup,vimSynRegOpt,vimSynReg,vimSynMtchGrp
355syn keyword vimSynType	contained	region	skipwhite nextgroup=vimSynRegion
356syn region  vimSynRegion	contained keepend	matchgroup=vimGroupName start="\k\+" skip="\\\\\|\\|" end="|\|$" contains=@vimSynRegGroup
357syn match   vimSynRegOpt	contained	"\<\(conceal\(ends\)\=\|transparent\|contained\|excludenl\|skipempty\|skipwhite\|display\|keepend\|oneline\|extend\|skipnl\|fold\)\>"
358syn match   vimSynReg	contained	"\(start\|skip\|end\)="he=e-1	nextgroup=vimSynRegPat
359syn match   vimSynMtchGrp	contained	"matchgroup="	nextgroup=vimGroup,vimHLGroup
360syn region  vimSynRegPat	contained extend	start="\z([-`~!@#$%^&*_=+;:'",./?]\)"  skip="\\\\\|\\\z1"  end="\z1"  contains=@vimSynRegPatGroup skipwhite nextgroup=vimSynPatMod,vimSynReg
361syn match   vimSynPatMod	contained	"\(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\([-+]\d\+\)\="
362syn match   vimSynPatMod	contained	"\(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\([-+]\d\+\)\=," nextgroup=vimSynPatMod
363syn match   vimSynPatMod	contained	"lc=\d\+"
364syn match   vimSynPatMod	contained	"lc=\d\+," nextgroup=vimSynPatMod
365syn region  vimSynPatRange	contained	start="\["	skip="\\\\\|\\]"   end="]"
366syn match   vimSynNotPatRange	contained	"\\\\\|\\\["
367syn match   vimMtchComment	contained	'"[^"]\+$'
368
369" Syntax: sync {{{1
370" ============
371syn keyword vimSynType	contained	sync	skipwhite	nextgroup=vimSyncC,vimSyncLines,vimSyncMatch,vimSyncError,vimSyncLinecont,vimSyncRegion
372syn match   vimSyncError	contained	"\i\+"
373syn keyword vimSyncC	contained	ccomment	clear	fromstart
374syn keyword vimSyncMatch	contained	match	skipwhite	nextgroup=vimSyncGroupName
375syn keyword vimSyncRegion	contained	region	skipwhite	nextgroup=vimSynReg
376syn keyword vimSyncLinecont	contained	linecont	skipwhite	nextgroup=vimSynRegPat
377syn match   vimSyncLines	contained	"\(min\|max\)\=lines="	nextgroup=vimNumber
378syn match   vimSyncGroupName	contained	"\k\+"	skipwhite	nextgroup=vimSyncKey
379syn match   vimSyncKey	contained	"\<groupthere\|grouphere\>"	skipwhite nextgroup=vimSyncGroup
380syn match   vimSyncGroup	contained	"\k\+"	skipwhite	nextgroup=vimSynRegPat,vimSyncNone
381syn keyword vimSyncNone	contained	NONE
382
383" Additional IsCommand, here by reasons of precedence {{{1
384" ====================
385syn match vimIsCommand	"<Bar>\s*\a\+"	transparent contains=vimCommand,vimNotation
386
387" Highlighting {{{1
388" ============
389syn cluster vimHighlightCluster	contains=vimHiLink,vimHiClear,vimHiKeyList,vimComment
390syn match   vimHighlight	"\<hi\%[ghlight]\>" skipwhite nextgroup=vimHiBang,@vimHighlightCluster
391syn match   vimHiBang	contained	"!"	  skipwhite nextgroup=@vimHighlightCluster
392
393syn match   vimHiGroup	contained	"\i\+"
394syn case ignore
395syn keyword vimHiAttrib	contained	none bold inverse italic reverse standout underline
396syn keyword vimFgBgAttrib	contained	none bg background fg foreground
397syn case match
398syn match   vimHiAttribList	contained	"\i\+"	contains=vimHiAttrib
399syn match   vimHiAttribList	contained	"\i\+,"he=e-1	contains=vimHiAttrib nextgroup=vimHiAttribList
400syn case ignore
401syn keyword vimHiCtermColor	contained	black blue brown cyan darkBlue darkcyan darkgray darkgreen darkgrey darkmagenta darkred darkyellow gray green grey lightblue lightcyan lightgray lightgreen lightgrey lightmagenta lightred magenta red white yellow
402
403syn case match
404syn match   vimHiFontname	contained	"[a-zA-Z\-*]\+"
405syn match   vimHiGuiFontname	contained	"'[a-zA-Z\-* ]\+'"
406syn match   vimHiGuiRgb	contained	"#\x\{6}"
407syn match   vimHiCtermError	contained	"[^0-9]\i*"
408
409" Highlighting: hi group key=arg ... {{{1
410syn cluster vimHiCluster contains=vimHiGroup,vimHiTerm,vimHiCTerm,vimHiStartStop,vimHiCtermFgBg,vimHiGui,vimHiGuiFont,vimHiGuiFgBg,vimHiKeyError,vimNotation
411syn region vimHiKeyList	contained oneline start="\i\+" skip="\\\\\|\\|" end="$\||"	contains=@vimHiCluster
412syn match  vimHiKeyError	contained	"\i\+="he=e-1
413syn match  vimHiTerm	contained	"\cterm="he=e-1		nextgroup=vimHiAttribList
414syn match  vimHiStartStop	contained	"\c\(start\|stop\)="he=e-1	nextgroup=vimHiTermcap,vimOption
415syn match  vimHiCTerm	contained	"\ccterm="he=e-1		nextgroup=vimHiAttribList
416syn match  vimHiCtermFgBg	contained	"\ccterm[fb]g="he=e-1	nextgroup=vimNumber,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
417syn match  vimHiGui	contained	"\cgui="he=e-1		nextgroup=vimHiAttribList
418syn match  vimHiGuiFont	contained	"\cfont="he=e-1		nextgroup=vimHiFontname
419syn match  vimHiGuiFgBg	contained	"\cgui[fb]g="he=e-1	nextgroup=vimHiGroup,vimHiGuiFontname,vimHiGuiRgb,vimFgBgAttrib
420syn match  vimHiTermcap	contained	"\S\+"		contains=vimNotation
421
422" Highlight: clear {{{1
423syn keyword vimHiClear	contained	clear	nextgroup=vimHiGroup
424
425" Highlight: link {{{1
426syn region vimHiLink	contained oneline matchgroup=vimCommand start="\<\(def\s\+\)\=link\>\|\<def\>" end="$"	contains=vimHiGroup,vimGroup,vimHLGroup,vimNotation
427
428" Control Characters {{{1
429" ==================
430syn match vimCtrlChar	"[--]"
431
432" Beginners - Patterns that involve ^ {{{1
433" =========
434syn match  vimLineComment	+^[ \t:]*".*$+	contains=@vimCommentGroup,vimCommentString,vimCommentTitle
435syn match  vimCommentTitle	'"\s*\u\w*\(\s\+\u\w*\)*:'hs=s+1	contained contains=vimCommentTitleLeader,vimTodo,@vimCommentGroup
436syn match  vimContinue	"^\s*\\"
437syn region vimString	start="^\s*\\\z(['"]\)" skip='\\\\\|\\\z1' end="\z1" oneline keepend contains=@vimStringGroup,vimContinue
438syn match  vimCommentTitleLeader	'"\s\+'ms=s+1	contained
439
440" Scripts  : perl,ruby : Benoit Cerrina {{{1
441" =======    python,tcl: Johannes Zellner
442
443" allow users to prevent embedded script syntax highlighting
444" when vim doesn't have perl/python/ruby/tcl support.  Do
445" so by setting g:vimembedscript= 0 in the user's <.vimrc>.
446if !exists("g:vimembedscript")
447 let g:vimembedscript= 1
448endif
449
450" [-- perl --] {{{2
451if (has("perl") || g:vimembedscript) && filereadable(expand("<sfile>:p:h")."/perl.vim")
452 unlet! b:current_syntax
453 syn include @vimPerlScript <sfile>:p:h/perl.vim
454 syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPerlScript
455 syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*$+ end=+\.$+ contains=@vimPerlScript
456endif
457
458" [-- ruby --] {{{2
459if (has("ruby") || g:vimembedscript) && filereadable(expand("<sfile>:p:h")."/ruby.vim")
460 unlet! b:current_syntax
461 syn include @vimRubyScript <sfile>:p:h/ruby.vim
462 syn region vimRubyRegion matchgroup=vimScriptDelim start=+rub[y]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimRubyScript
463 syn region vimRubyRegion matchgroup=vimScriptDelim start=+rub[y]\s*<<\s*$+ end=+\.$+ contains=@vimRubyScript
464endif
465
466" [-- python --] {{{2
467if (has("python") || g:vimembedscript) && filereadable(expand("<sfile>:p:h")."/python.vim")
468 unlet! b:current_syntax
469 syn include @vimPythonScript <sfile>:p:h/python.vim
470 syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPythonScript
471 syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon]\s*<<\s*$+ end=+\.$+ contains=@vimPythonScript
472endif
473
474" [-- tcl --] {{{2
475if (has("tcl") || g:vimembedscript) && filereadable(expand("<sfile>:p:h")."/tcl.vim")
476 unlet! b:current_syntax
477 syn include @vimTclScript <sfile>:p:h/tcl.vim
478 syn region vimTclRegion matchgroup=vimScriptDelim start=+tc[l]\=\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimTclScript
479 syn region vimTclRegion matchgroup=vimScriptDelim start=+tc[l]\=\s*<<\s*$+ end=+\.$+ contains=@vimTclScript
480endif
481
482" Synchronize (speed) {{{1
483"============
484if exists("g:vim_minlines")
485 exe "syn sync minlines=".g:vim_minlines
486endif
487if exists("g:vim_maxlines")
488 exe "syn sync maxlines=".g:vim_maxlines
489else
490 syn sync maxlines=60
491endif
492syn sync linecont	"^\s\+\\"
493syn sync match vimAugroupSyncA	groupthere NONE	"\<aug\%[roup]\>\s\+[eE][nN][dD]"
494
495" Highlighting Settings {{{1
496" ====================
497
498hi def link vimAuHighlight	vimHighlight
499hi def link vimSubst1	vimSubst
500hi def link vimBehaveModel	vimBehave
501
502hi def link vimAddress	vimMark
503"  hi def link vimAugroupError	vimError
504hi def link vimAugroupKey	vimCommand
505hi def link vimAutoCmdOpt	vimOption
506hi def link vimAutoCmd	vimCommand
507hi def link vimAutoSet	vimCommand
508hi def link vimBehaveError	vimError
509hi def link vimBehave	vimCommand
510hi def link vimCollClassErr	vimError
511hi def link vimCommentString	vimString
512hi def link vimCondHL	vimCommand
513hi def link vimEchoHLNone	vimGroup
514hi def link vimEchoHL	vimCommand
515hi def link vimElseif	vimCondHL
516hi def link vimErrSetting	vimError
517hi def link vimFgBgAttrib	vimHiAttrib
518hi def link vimFTCmd	vimCommand
519hi def link vimFTError	vimError
520hi def link vimFTOption	vimSynType
521hi def link VimFunc         	vimError
522hi def link vimFuncKey	vimCommand
523hi def link vimFunctionError	vimError
524hi def link vimGroupAdd	vimSynOption
525hi def link vimGroupRem	vimSynOption
526hi def link vimHiAttribList	vimError
527hi def link vimHiCtermError	vimError
528hi def link vimHiCtermFgBg	vimHiTerm
529hi def link vimHiCTerm	vimHiTerm
530hi def link vimHighlight	vimCommand
531hi def link vimHiGroup	vimGroupName
532hi def link vimHiGuiFgBg	vimHiTerm
533hi def link vimHiGuiFont	vimHiTerm
534hi def link vimHiGuiRgb	vimNumber
535hi def link vimHiGui	vimHiTerm
536hi def link vimHiKeyError	vimError
537hi def link vimHiStartStop	vimHiTerm
538hi def link vimHLGroup	vimGroup
539hi def link vimInsert	vimString
540hi def link vimKeyCodeError	vimError
541hi def link vimKeyCode	vimSpecFile
542hi def link vimLet	vimCommand
543hi def link vimLineComment	vimComment
544hi def link vimMapBang	vimCommand
545hi def link vimMapModErr	vimError
546hi def link vimMapModKey	vimFuncSID
547hi def link vimMapMod	vimBracket
548hi def link vimMap	vimCommand
549hi def link vimMarkNumber	vimNumber
550hi def link vimMenuMod	vimMapMod
551hi def link vimMenuNameMore	vimMenuName
552hi def link vimMtchComment	vimComment
553hi def link vimNotFunc	vimCommand
554hi def link vimNotPatSep	vimString
555hi def link vimPatSepErr	vimPatSep
556hi def link vimPatSepZone	vimString
557hi def link vimPlainMark	vimMark
558hi def link vimPlainRegister	vimRegister
559hi def link vimSetMod	vimOption
560hi def link vimSetString	vimString
561hi def link vimSpecFileMod	vimSpecFile
562hi def link vimStringCont	vimString
563hi def link vimSubstFlagErr	vimError
564hi def link vimSubstTwoBS	vimString
565hi def link vimSubst	vimCommand
566hi def link vimSynCaseError	vimError
567hi def link vimSyncGroupName	vimGroupName
568hi def link vimSyncGroup	vimGroupName
569hi def link vimSynContains	vimSynOption
570hi def link vimSynKeyContainedin	vimSynContains
571hi def link vimSynKeyOpt	vimSynOption
572hi def link vimSynMtchGrp	vimSynOption
573hi def link vimSynMtchOpt	vimSynOption
574hi def link vimSynNextgroup	vimSynOption
575hi def link vimSynNotPatRange	vimSynRegPat
576hi def link vimSynPatRange	vimString
577hi def link vimSynRegOpt	vimSynOption
578hi def link vimSynRegPat	vimString
579hi def link vimSyntax	vimCommand
580hi def link vimSynType	vimSpecial
581hi def link vimUserAttrbCmplt	vimSpecial
582hi def link vimUserAttrbKey	vimOption
583hi def link vimUserAttrb	vimSpecial
584hi def link vimUserCommand	vimCommand
585hi def link vimUserFunc	Normal
586
587hi def link vimAutoEvent	Type
588hi def link vimBracket	Delimiter
589hi def link vimCmplxRepeat	SpecialChar
590hi def link vimCommand	Statement
591hi def link vimComment	Comment
592hi def link vimCommentTitle	PreProc
593hi def link vimContinue	Special
594hi def link vimCtrlChar	SpecialChar
595hi def link vimElseIfErr	Error
596hi def link vimEnvvar	PreProc
597hi def link vimError	Error
598hi def link vimFold	Folded
599hi def link vimFuncName	Function
600hi def link vimFuncSID	Special
601hi def link vimFuncVar	Identifier
602hi def link vimGroup	Type
603hi def link vimGroupSpecial	Special
604hi def link vimHLMod	PreProc
605hi def link vimHiAttrib	PreProc
606hi def link vimHiTerm	Type
607hi def link vimKeyword	Statement
608hi def link vimMark	Number
609hi def link vimMenuName	PreProc
610hi def link vimNotation	Special
611hi def link vimNumber	Number
612hi def link vimOper	Operator
613hi def link vimOption	PreProc
614hi def link vimOperError	Error
615hi def link vimPatSep	SpecialChar
616hi def link vimPattern	Type
617hi def link vimRegister	SpecialChar
618hi def link vimScriptDelim	Comment
619hi def link vimSep	Delimiter
620hi def link vimSetSep	Statement
621hi def link vimSpecFile	Identifier
622hi def link vimSpecial	Type
623hi def link vimStatement	Statement
624hi def link vimString	String
625hi def link vimSubstDelim	Delimiter
626hi def link vimSubstFlags	Special
627hi def link vimSubstSubstr	SpecialChar
628hi def link vimSynCase	Type
629hi def link vimSynCaseError	Error
630hi def link vimSynError	Error
631hi def link vimSynOption	Special
632hi def link vimSynReg	Type
633hi def link vimSyncC	Type
634hi def link vimSyncError	Error
635hi def link vimSyncKey	Type
636hi def link vimSyncNone	Type
637hi def link vimTodo	Todo
638hi def link vimUserCmdError	Error
639
640" Current Syntax Variable: {{{1
641let b:current_syntax = "vim"
642" vim:ts=18  fdm=marker
643