" Vim syntax file " Language: Vim 5.4e script " Maintainer: Dr. Charles E. Campbell, Jr. " Last Change: February 19, 1999 " Version: 5.4e-03 " Remove old syntax syn clear syn keyword vimTodo contained COMBAK NOT RELEASED TODO " regular vim commands syn keyword vimCommand contained N[ext] co[py] imapc[lear] ono[remap] stj[ump] syn keyword vimCommand contained P[rint] col[der] ime onoreme sts[elect] syn keyword vimCommand contained X com[mand] imenu onoremenu sun[hide] syn keyword vimCommand contained a[ppend] comc[lear] ino[remap] ou[nmap] sus[pend] syn keyword vimCommand contained ab[breviate] con[tinue] inorea[bbrev] ounme sv[iew] syn keyword vimCommand contained abc[lear] conf[irm] inoreme ounmenu sy[ntax] syn keyword vimCommand contained al[l] cp[revious] inoremenu p[rint] syncbind syn keyword vimCommand contained am cq[uit] is[earch] pe[rl] syntax syn keyword vimCommand contained amenu cr[ewind] isp[lit] perld[o] t syn keyword vimCommand contained an cu[nmap] iu[nmap] po[p] tN[ext] syn keyword vimCommand contained anoremenu cuna[bbrev] iuna[bbrev] pre[serve] ta[g] syn keyword vimCommand contained ar[gs] cunme iunme prev[ious] tags syn keyword vimCommand contained argu[ment] cunmenu iunmenu promptf[ind] tc[l] syn keyword vimCommand contained as[cii] d[elete] j[oin] promptr[epl] tcld[o] syn keyword vimCommand contained au[tocmd] delc[ommand] ju[mps] pu[t] tclf[ile] syn keyword vimCommand contained aug[roup] delf[unction] k pw[d] te[aroff] syn keyword vimCommand contained aun di[splay] l[ist] py[thon] tj[ump] syn keyword vimCommand contained aunmenu dig[raphs] la[st] pyf[ile] tl[ast] syn keyword vimCommand contained autocmd display le[ft] q[uit] tm[enu] syn keyword vimCommand contained bN[ext] dj[ump] let qa[ll] tn[ext] syn keyword vimCommand contained b[uffer] dl[ist] ls r[ead] tp[revious] syn keyword vimCommand contained ba[ll] do[autocmd] m[ove] rec[over] tr[ewind] syn keyword vimCommand contained bad[d] doautoa[ll] ma[rk] red[o] ts[elect] syn keyword vimCommand contained bd[elete] ds[earch] mak[e] redi[r] tu[nmenu] syn keyword vimCommand contained be[have] dsp[lit] map reg[isters] u[ndo] syn keyword vimCommand contained bl[ast] e[dit] mapc[lear] res[ize] una[bbreviate] syn keyword vimCommand contained bm[odified] ec[ho] marks ret[ab] unh[ide] syn keyword vimCommand contained bn[ext] echoh[l] me retu[rn] unl[et] syn keyword vimCommand contained bp[revious] echon menu rew[ind] unm[ap] syn keyword vimCommand contained br[ewind] el[se] mk[exrc] ri[ght] unme syn keyword vimCommand contained brea[k] elsei[f] mks[ession] rv[iminfo] unmenu syn keyword vimCommand contained bro[wse] eme mkv[imrc] sN[ext] v[global] syn keyword vimCommand contained buffers emenu mod[e] s[ubstitute] ve[rsion] syn keyword vimCommand contained bun[load] en[dif] n[ext] sa[rgument] vi[sual] syn keyword vimCommand contained cN[ext] endf[unction] new sal[l] vie[w] syn keyword vimCommand contained c[hange] endw[hile] nm[ap] sbN[ext] vm[ap] syn keyword vimCommand contained ca[bbrev] ex nmapc[lear] sb[uffer] vmapc[lear] syn keyword vimCommand contained cabc[lear] exe[cute] nme sba[ll] vme syn keyword vimCommand contained cal[l] exi[t] nmenu sbl[ast] vmenu syn keyword vimCommand contained cc f[ile] nn[oremap] sbm[odified] vn[oremap] syn keyword vimCommand contained cd files nnoreme sbn[ext] vnoreme syn keyword vimCommand contained ce[nter] fix[del] nnoremenu sbp[revious] vnoremenu syn keyword vimCommand contained cf[ile] fu[nction] no[remap] sbr[ewind] vu[nmap] syn keyword vimCommand contained chd[ir] g[lobal] noh[lsearch] se[t] vunme syn keyword vimCommand contained che[ckpath] go[to] norea[bbrev] sh[ell] vunmenu syn keyword vimCommand contained cl[ist] gr[ep] noreme si[malt] wN[ext] syn keyword vimCommand contained cla[st] h[elp] noremenu sl[eep] w[rite] syn keyword vimCommand contained clo[se] helpf[ind] norm[al] sla[st] wa[ll] syn keyword vimCommand contained cm[ap] hi[ghlight] nu[mber] sm[agic] wh[ile] syn keyword vimCommand contained cmapc[lear] hid[e] nun[map] sn[ext] winp[os] syn keyword vimCommand contained cme his[tory] nunme sno[magic] wn[ext] syn keyword vimCommand contained cmenu i[nsert] nunmenu so[urce] wp[revous] syn keyword vimCommand contained cn[ext] ia[bbrev] o[pen] sp[lit] wq syn keyword vimCommand contained cnew[er] iabc[lear] om[ap] spr[evious] wqa[ll] syn keyword vimCommand contained cno[remap] if omapc[lear] sr[ewind] wv[iminfo] syn keyword vimCommand contained cnorea[bbrev] ij[ump] ome st[op] x[it] syn keyword vimCommand contained cnoreme il[ist] omenu sta[g] xa[ll] syn keyword vimCommand contained cnoremenu im[ap] on[ly] start[insert] y[ank] syn match vimCommand contained "z[-+^.=]" " All vimCommands are contained by vimIsCommands. syn match vimIsCommand "^\s*[a-zA-Z]\+" transparent contains=vimCommand syn match vimIsCommand "[:|]\s*[a-zA-Z]\+" transparent contains=vimCommand " vimOptions are caught only when contained in a vimSet syn keyword vimOption contained ai equalalways km scb tbi syn keyword vimOption contained akm equalprg kp scr tbs syn keyword vimOption contained al errorbells langmap scroll term syn keyword vimOption contained aleph errorfile laststatus scrollbind terse syn keyword vimOption contained allowrevins errorformat lazyredraw scrolljump textauto syn keyword vimOption contained altkeymap esckeys lbr scrolloff textmode syn keyword vimOption contained ari et lcs scrollopt textwidth syn keyword vimOption contained autoindent eventignore linebreak scs tf syn keyword vimOption contained autowrite ex lines sect tildeop syn keyword vimOption contained aw expandtab lisp sections timeout syn keyword vimOption contained background exrc list secure timeoutlen syn keyword vimOption contained backspace fe listchars sel title syn keyword vimOption contained backup ff lmap selection titlelen syn keyword vimOption contained backupdir ffs ls selectmode titlestring syn keyword vimOption contained backupext fileencoding lz sessionoptions tl syn keyword vimOption contained bdir fileformat magic sft tm syn keyword vimOption contained bex fileformats makeef sh to syn keyword vimOption contained bg filetype makeprg shcf toolbar syn keyword vimOption contained bin fk mat shell top syn keyword vimOption contained binary fkmap matchpairs shellcmdflag tr syn keyword vimOption contained biosk fo matchtime shellpipe ts syn keyword vimOption contained bioskey formatoptions maxfuncdepth shellquote tsl syn keyword vimOption contained bk formatprg maxmapdepth shellredir ttimeout syn keyword vimOption contained breakat fp maxmem shelltype ttimeoutlen syn keyword vimOption contained brk ft maxmemtot shellxquote ttm syn keyword vimOption contained browsedir gcr mef shiftround ttybuiltin syn keyword vimOption contained bs gd mfd shiftwidth ttyfast syn keyword vimOption contained bsdir gdefault mh shm ttym syn keyword vimOption contained cf gfm ml shortmess ttymouse syn keyword vimOption contained ch gfn mls shortname ttyscroll syn keyword vimOption contained cin go mm showbreak ttytype syn keyword vimOption contained cindent gp mmd showcmd tw syn keyword vimOption contained cink grepformat mmt showfulltag tx syn keyword vimOption contained cinkeys grepprg mod showmatch uc syn keyword vimOption contained cino guicursor modeline showmode ul syn keyword vimOption contained cinoptions guifont modelines shq undolevels syn keyword vimOption contained cinw guioptions modified si updatecount syn keyword vimOption contained cinwords guipty more sidescroll updatetime syn keyword vimOption contained cmdheight helpfile mouse sj ut syn keyword vimOption contained co helpheight mousef slm vb syn keyword vimOption contained columns hf mousefocus sm vbs syn keyword vimOption contained com hh mousehide smartcase verbose syn keyword vimOption contained comments hi mousem smartindent vi syn keyword vimOption contained compatible hid mousemodel smarttab viminfo syn keyword vimOption contained complete hidden mouset smd visualbell syn keyword vimOption contained confirm highlight mousetime sn wa syn keyword vimOption contained consk history mp so wak syn keyword vimOption contained conskey hk mps softtabstop warn syn keyword vimOption contained cp hkmap nf sol wb syn keyword vimOption contained cpo hkmapp nrformats sp wc syn keyword vimOption contained cpoptions hkp nu splitbelow wcm syn keyword vimOption contained cpt hl number sr wd syn keyword vimOption contained cscopeprg hls oft srr weirdinvert syn keyword vimOption contained cscopetag hlsearch osfiletype ss wh syn keyword vimOption contained cscopetagorder ic pa ssop whichwrap syn keyword vimOption contained cscopeverbose icon para st wig syn keyword vimOption contained csprg iconstring paragraphs sta wildchar syn keyword vimOption contained cst ignorecase paste startofline wildcharm syn keyword vimOption contained csto im patchmode statusline wildignore syn keyword vimOption contained csverb inc path stl wildmenu syn keyword vimOption contained def include pm sts wildmode syn keyword vimOption contained define incsearch readonly su wim syn keyword vimOption contained dg inf remap suffixes winaltkeys syn keyword vimOption contained dict infercase report sw winheight syn keyword vimOption contained dictionary insertmode restorescreen swapfile winminheight syn keyword vimOption contained digraph is revins swapsync wiv syn keyword vimOption contained dir isf ri swf wm syn keyword vimOption contained directory isfname rightleft sws wmh syn keyword vimOption contained ea isi rl sxq wmnu syn keyword vimOption contained eb isident ro syn wrap syn keyword vimOption contained ed isk rs syntax wrapmargin syn keyword vimOption contained edcompatible iskeyword ru ta wrapscan syn keyword vimOption contained ef isp ruf tabstop write syn keyword vimOption contained efm isprint ruler tag writeany syn keyword vimOption contained ei joinspaces rulerformat tagbsearch writebackup syn keyword vimOption contained ek js sb taglength writedelay syn keyword vimOption contained endofline key sbo tagrelative ws syn keyword vimOption contained eol keymodel sbr tags ww syn keyword vimOption contained ep keywordprg sc tb " These are the turn-off setting variants syn keyword vimOption contained noai noedcompatible noinfercase norl notagrelative syn keyword vimOption contained noakm noek noinsertmode noro notbi syn keyword vimOption contained noalkeymap noendofline nois nors notbs syn keyword vimOption contained noallowrevins noeol nojoinspaces noru noterse syn keyword vimOption contained noari noequalalways nojs noruler notextauto syn keyword vimOption contained noautoindent noerrorbells nolazyredraw nosb notextmode syn keyword vimOption contained noautowrite noesckeys nolbr nosc notf syn keyword vimOption contained noaw noet nolinebreak noscs notildeop syn keyword vimOption contained nobackup noex nolisp nosecure notimeout syn keyword vimOption contained nobin noexpandtab nolist noshiftround notitle syn keyword vimOption contained nobinary noexrc nolz noshortname noto syn keyword vimOption contained nobiosk nofk nomagic noshowcmd notop syn keyword vimOption contained nobioskey nofkmap nomh noshowmatch notr syn keyword vimOption contained nobk nogd noml noshowmode nottimeout syn keyword vimOption contained nocf nogdefault nomod nosi nottybuiltin syn keyword vimOption contained nocin noguipty nomodeline nosm nottyfast syn keyword vimOption contained nocindent nohid nomodified nosmartcase notx syn keyword vimOption contained nocompatible nohidden nomore nosmartindent novb syn keyword vimOption contained noconfirm nohk nomousef nosmarttab novisualbell syn keyword vimOption contained noconsk nohkmap nomousefocus nosmd nowa syn keyword vimOption contained noconskey nohkmapp nomousehide nosn nowarn syn keyword vimOption contained nocp nohkp nonu nosol nowb syn keyword vimOption contained nocscopetag nohls nonumber nosplitbelow noweirdinvert syn keyword vimOption contained nocscopeverbose nohlsearch nopaste nosr nowiv syn keyword vimOption contained nocst noic noreadonly nosta nowrap syn keyword vimOption contained nocsverb noicon noremap nostartofline nowrapscan syn keyword vimOption contained nodg noignorecase norestorescreen noswapfile nowrite syn keyword vimOption contained nodigraph noim norevins noswf nowriteany syn keyword vimOption contained noea noincsearch nori nota nowritebackup syn keyword vimOption contained noeb noinf norightleft notagbsearch nows syn keyword vimOption contained noed " termcap codes (which can also be set) syn keyword vimOption contained t_AB t_RI t_da t_k9 t_ks t_so syn keyword vimOption contained t_AF t_Sb t_db t_kD t_ku t_sr syn keyword vimOption contained t_AL t_Sf t_dl t_kI t_le t_te syn keyword vimOption contained t_CS t_ZH t_k1 t_kN t_mb t_ti syn keyword vimOption contained t_Co t_ZR t_k2 t_kP t_md t_ue syn keyword vimOption contained t_DL t_al t_k3 t_kb t_me t_us syn keyword vimOption contained t_F1 t_bc t_k4 t_kd t_mr t_vb syn keyword vimOption contained t_F2 t_cd t_k5 t_ke t_ms t_ve syn keyword vimOption contained t_K1 t_ce t_k6 t_kh t_nd t_vi syn keyword vimOption contained t_K3 t_cl t_k7 t_kl t_op t_vs syn keyword vimOption contained t_K4 t_cm t_k8 t_kr t_se t_xs syn keyword vimOption contained t_K5 t_cs syn match vimOption contained "t_#4" syn match vimOption contained "t_%1" syn match vimOption contained "t_%i" syn match vimOption contained "t_&8" syn match vimOption contained "t_@7" syn match vimOption contained "t_k;" " these settings don't actually cause errors in vim, but were supported by vi and don't do anything in vim syn keyword vimErrSetting contained hardtabs w1200 w9600 wi window syn keyword vimErrSetting contained ht w300 " AutoBuf Events syn keyword vimAutoEvent contained BufCreate BufReadPost FileChangedShell FilterWritePost TermChanged syn keyword vimAutoEvent contained BufDelete BufReadPre FileReadPost FilterWritePre User syn keyword vimAutoEvent contained BufEnter BufUnload FileReadPre FocusGained VimEnter syn keyword vimAutoEvent contained BufFilePost BufWrite FileType FocusLost VimLeave syn keyword vimAutoEvent contained BufFilePre BufWritePost FileWritePost StdinReadPost VimLeavePre syn keyword vimAutoEvent contained BufLeave BufWritePre FileWritePre StdinReadPre WinEnter syn keyword vimAutoEvent contained BufNewFile FileAppendPost FilterReadPost Syntax WinLeave syn keyword vimAutoEvent contained BufRead FileAppendPre FilterReadPre " Highlight commonly used Groupnames syn keyword vimGroup Comment Identifier Keyword Type Delimiter syn keyword vimGroup Constant Function Exception StorageClass SpecialComment syn keyword vimGroup String Statement PreProc Structure Debug syn keyword vimGroup Character Conditional Include Typedef Ignore syn keyword vimGroup Number Repeat Define Special Error syn keyword vimGroup Boolean Label Macro SpecialChar Todo syn keyword vimGroup Float Operator PreCondit Tag " Default highlighting groups syn keyword vimHLGroup Cursor LineNr NonText Search Title syn keyword vimHLGroup Directory Menu Normal SpecialKey Visual syn keyword vimHLGroup ErrorMsg ModeMsg Question StatusLine WarningMsg syn keyword vimHLGroup IncSearch MoreMsg Scrollbar StatusLineNC " Function Names syn keyword vimFuncName contained argc did_filetype has line strpart syn keyword vimFuncName contained argv escape histadd line2byte substitute syn keyword vimFuncName contained browse exists histdel maparg synID syn keyword vimFuncName contained bufexists expand histget match synIDattr syn keyword vimFuncName contained bufname filereadable histnr matchend synIDtrans syn keyword vimFuncName contained bufnr fnamemodify hlID matchstr tempname syn keyword vimFuncName contained byte2line getcwd hlexists nr2char virtcol syn keyword vimFuncName contained char2nr getline hostname setline winbufnr syn keyword vimFuncName contained col getwinposx input strftime winheight syn keyword vimFuncName contained confirm getwinposy isdirectory strlen winnr syn keyword vimFuncName contained delete syn match vimFunc contained "\I\i*\s*(" contains=vimFuncName "--- syntax above generated by mkvimvim --- " Special Vim Highlighting " Behave! " ======= syn match vimBehave "^\s*\(behave\|behav\|beha\|beh\|be\)" contains=vimCommand skipwhite nextgroup=vimBehaveModel,vimBehaveError syn match vimBehave "[:|]\s*\(behave\|behav\|beha\|beh\|be\)"lc=1 contains=vimCommand skipwhite nextgroup=vimBehaveModel,vimBehaveError syn keyword vimBehaveModel contained mswin xterm syn match vimBehaveError contained "[^ ]\+" " Functions " ========= syn match vimFunction "\(function\|functio\|functi\|funct\|func\|fun\|fu\)!\=\s\+[A-Z][a-z0-9]*(" contains=vimCommand nextgroup=vimFuncBody syn match vimFunctionError "\(function\|functio\|functi\|funct\|func\|fun\|fu\)!\=\s\+[a-z0-9].*(" contains=vimCommand nextgroup=vimFuncBody syn region vimFuncBody contained start=")" end="\" nextgroup=vimSpecFileMod,vimSubst syn match vimSpecFile "#\d\+\|[#%]<" nextgroup=vimSpecFileMod,vimSubst syn match vimSpecFileMod "\(:[phtre]\)\+" contained " Conditionals syn match vimConditional "^\s*\(continue\|continu\|contin\|conti\|cont\|con\)\>" syn match vimConditional "^\s*\(endif\|endi\|end\|en\)\>" syn match vimConditional "^\s*\(endwhile\|endwhil\|endwhi\|endwh\|endw\)\>" syn match vimConditional "^\s*\(while\|whil\|whi\|wh\)\>" syn match vimConditional "^\s*break\=\>" syn match vimConditional "^\s*else\>" syn match vimConditional "^\s*elseif\=\>" syn match vimConditional "^\s*if\>" syn match vimConditional "[:|]\s*\(continue\|continu\|contin\|conti\|cont\|con\)\>"lc=1 syn match vimConditional "[:|]\s*\(endif\|endi\|end\|en\)\>"lc=1 syn match vimConditional "[:|]\s*\(endwhile\|endwhil\|endwhi\|endwh\|endw\)\>"lc=1 syn match vimConditional "[:|]\s*\(while\|whil\|whi\|wh\)\>"lc=1 syn match vimConditional "[:|]\s*break\=\>"lc=1 syn match vimConditional "[:|]\s*else\>"lc=1 syn match vimConditional "[:|]\s*elseif\=\>"lc=1 syn match vimConditional "[:|]\s*if\>"lc=1 " Operators syn match vimOper "||\|&&\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|+\|-\|=\|\." skipwhite nextgroup=vimString " User-Specified Commands syn cluster vimUserCmdList contains=vimAddress,vimSyntax,vimHighlight,vimAutoCmd,vimCmplxRepeat,vimComment,vimConditional,vimCtrlChar,vimEscapeBrace,vimFilter,vimFunc,vimFunction,vimGroup,vimHLGroup,vimIsCommand,vimIsCommand,vimMark,vimNotation,vimNumber,vimOper,vimRegion,vimRegister,vimSet,vimSetEqual,vimSetString,vimSpecFile,vimString,vimSubst,vimSubstEnd,vimSubstRange,vimSynLine syn region vimUserCmd transparent oneline matchgroup=vimStatement start="^\s*\(command\|comman\|comma\|comm\|com\)" end="$" contains=vimUserAttrb,@vimUserCmdList syn region vimUserCmd transparent oneline matchgroup=vimStatement start="[:|]\s*\(command\|comman\|comma\|comm\|com\)"hs=s+1 end="$" contains=vimUserAttrb,@vimUserCmdList syn match vimUserAttrb contained "-nargs=[01*?+]" contains=vimUserAttrbKey,vimOper syn match vimUserAttrb contained transparent "-complete=\(augroup\|buffer\|command\|dir\|event\|file\|help\|highlight\|menu\|option\|tag\|var\)" contains=vimUserAttrbCmplt,vimOper syn match vimUserAttrb contained "-range\(=%\|=[0-9]\+\)\=" contains=vimNumber,vimOper,vimUserAttrbKey syn match vimUserAttrb contained "-count=[0-9]\+" contains=vimNumber,vimOper,vimUserAttrbKey syn match vimUserAttrb contained "-bang\|-register" contains=vimOper,vimUserAttrbKey syn keyword vimUserAttrbKey contained bang count range syn keyword vimUserAttrbKey contained complete nargs register syn keyword vimUserAttrbCmplt contained augroup dir help menu tag syn keyword vimUserAttrbCmplt contained buffer event highlight option var syn keyword vimUserAttrbCmplt contained command file " Numbers syn match vimNumber "\<\d\+.\d\+" syn match vimNumber "\<\d\+L\=" syn match vimNumber "-\d\+.\d\+" syn match vimNumber "-\d\+L\=" syn match vimNumber "[[;:]\d\+"lc=1 syn match vimNumber "0[xX][0-9a-fA-F]\+" syn match vimNumber "#[0-9a-fA-F]\+" " Lower Priority Comments: after some vim commands... syn match vimComment +\s"[^\-:.%#=*].*$+lc=1 contains=vimTodo,vimCommentString syn match vimComment +\!\\]"+lc=1 skip=+\(\\\\\)*\\"+ end=+"+ contains=vimEscapeBrace,vimPatSep,vimNotPatSep syn region vimString oneline start=+[^:a-zA-Z>!\\]'+lc=1 skip=+\(\\\\\)*\\'+ end=+'+ contains=vimEscapeBrace,vimPatSep,vimNotPatSep syn region vimString oneline start=+=!+lc=1 skip=+\(\\\\\)*\\!+ end=+!+ contains=vimEscapeBrace,vimPatSep,vimNotPatSep syn region vimString oneline start="=+"lc=1 skip="\(\\\\\)*\\+" end="+" contains=vimEscapeBrace,vimPatSep,vimNotPatSep syn region vimString oneline start="[^\\]+\s*[^a-zA-Z0-9.]"lc=1 skip="\(\\\\\)*\\+" end="+" contains=vimEscapeBrace,vimPatSep,vimNotPatSep syn region vimString oneline start="\s/\s*[^a-zA-Z]"lc=1 skip="\(\\\\\)*\\+" end="/" contains=vimEscapeBrace,vimPatSep,vimNotPatSep syn match vimString contained +"[^"]*\\$+ skipnl nextgroup=vimStringCont syn match vimStringCont contained +\(\\\\\|.\)\{-}[^\\]"+ " Substitutions syn region vimSubst oneline start=":\=s/.\{-}" skip="\(\\\\\)*\\/" end="/" contains=vimPatSep,vimSubstTwoBS,vimSubstRange,vimNotation nextgroup=vimSubstEnd syn region vimSubstEnd contained oneline start="."lc=1 skip="\(\\\\\)*\\/" end="/" contains=vimSubstPat,vimSubstTwoBS,vimNotation syn region vimSubst oneline start=":\=s?.\{-}" skip="\(\\\\\)*\\?" end="?" contains=vimPatSep,vimSubstTwoBS,vimSubstRange,vimNotation nextgroup=vimSubstEnd syn region vimSubstEnd contained oneline start="."lc=1 skip="\(\\\\\)*\\?" end="?" contains=vimSubstPat,vimSubstTwoBS,vimNotation syn region vimSubstRange contained oneline start="\[" skip="\(\\\\\)*\\]" end="]" syn match vimSubstPat contained "\\\d" syn match vimSubstTwoBS contained "\\\\" " Marks, Registers, Addresses, Filters syn match vimMark "[!,:]'[a-zA-Z0-9]"lc=1 syn match vimMark "'[a-zA-Z0-9][,!]"me=e-1 syn match vimMark "'[<>][,!]"me=e-1 syn match vimMark "[^a-zA-Z]norm\s'[a-zA-Z0-9]"lc=6 syn match vimMark "[^a-zA-Z]normal\s'[a-zA-Z0-9]"lc=8 syn match vimPlainMark "'[a-zA-Z0-9]" contained syn match vimRegister '[^(,;]"[a-zA-Z0-9\-:.%#*=][^a-zA-Z_"]'lc=1 syn match vimRegister '[^a-zA-Z]norm\s\+"[a-zA-Z0-9]'lc=6 syn match vimRegister '[^a-zA-Z]normal\s\+"[a-zA-Z0-9]'lc=8 syn match vimPlainRegister '"[a-zA-Z0-9\-:.%#*=]' contained syn match vimAddress ",\."lc=1 syn match vimAddress "[:|][%.]"lc=1 syn match vimAddress "%"lc=5 syn match vimFilter ":\s*!"ms=e syn match vimFilter "[^a-zA-Z]!"lc=1 " Complex repeats (:h complex-repeat) syn match vimCmplxRepeat '[^a-zA-Z_/\\]q[0-9a-zA-Z"]'lc=1 syn match vimCmplxRepeat '@[0-9a-z".=@:]' " High Priority Comments: beginning of line with optional spaces then " syn match vimLineComment +^\s*".*$+ contains=vimTodo,vimCommentString,vimCommentTitle syn match vimCommentTitle contained "\([A-Z][a-z]*\s*\)\+:" " Set command and associated set-options (vimOptions) with comment syn region vimSet matchgroup=vimCommand start="\s*set\>" end="|\|$" keepend contains=vimSetEqual,vimOption,vimErrSetting,vimComment,vimSetString syn region vimSetEqual contained start="=" skip="\(\\\\\)*\\\s" end="[| \t]\|$"me=e-1 contains=vimCtrlChar syn region vimSetString contained start=+="+hs=s+1 skip=+\(\\\\\)\\"+ end=+"+ contains=vimCtrlChar " Autocmd syn cluster vimAutoCmdCluster contains=vimAutoCmdOpt,vimAutoEvent,vimComment,vimFilter,vimAuHighlight,vimIsCommand,vimIsCommand2,vimNotation,vimSet,vimSpecFile,vimString,vimAuSyntax syn match vimIsCommand2 contained transparent "[ \t][a-zA-Z_]\+"lc=1 contains=vimCommand syn keyword vimAutoCmdOpt contained nested syn region vimAutoCmd matchgroup=vimAutoSet start=+^\s*\(autocmd\|au\|doautocmd\|doau\)\>+ end="$" keepend contains=@vimAutoCmdCluster syn region vimAutoCmd matchgroup=vimAutoSet start=+[:|]\s*\(autocmd\|au\|doautocmd\|doau\)\>+ end="$" keepend contains=@vimAutoCmdCluster syn region vimAutoCmd matchgroup=vimAutoSet start=+^\s*\(doautoa\|doautoall\)\>+ end="$" keepend contains=@vimAutoCmdCluster syn region vimAutoCmd matchgroup=vimAutoSet start=+[:|]\s*\(autocmd\|au\|doautocmd\|doau\)\>+lc=1 end="$" keepend contains=@vimAutoCmdCluster " Echo -- prefer strings! syn region vimEcho oneline start="\<\(echo\|ech\|ec\)\>" skip="\(\\\\\)*|" end="$\||" contains=vimCommand,vimString,vimOper syn region vimEcho oneline start="^\s*\(echo\|ech\|ec\)\>" skip="\(\\\\\)*|" end="$\||" contains=vimCommand,vimString,vimOper " Syntax "======= syn match vimGroupList contained "@\=[^ \t,]*" contains=vimGroupSpecial,vimPatSep syn match vimGroupList contained "@\=[^ \t,]*," nextgroup=vimGroupList contains=vimGroupSpecial,vimPatSep syn keyword vimGroupSpecial contained ALL ALLBUT syn match vimSynError contained "\i\+" syn match vimSynError contained "\i\+=" nextgroup=vimGroupList syn match vimSynContains contained "contains=" nextgroup=vimGroupList syn match vimSynNextgroup contained "nextgroup=" nextgroup=vimGroupList syn match vimSyntax "^\s*\(syntax\|synta\|synt\|syn\|sy\)" contains=vimCommand skipwhite nextgroup=vimSynType,vimComment syn match vimSyntax "[:|]\s*\(syntax\|synta\|synt\|syn\|sy\)" contains=vimCommand skipwhite nextgroup=vimSynType,vimComment syn match vimAuSyntax contained "\s+\(syntax\|synta\|synt\|syn\|sy\)" contains=vimCommand skipwhite nextgroup=vimSynType,vimComment " Syntax: case syn keyword vimSynType contained case skipwhite nextgroup=vimSynCase,vimSynCaseError syn match vimSynCaseError contained "\i\+" syn keyword vimSynCase contained ignore match " Syntax: clear syn keyword vimSynType contained clear skipwhite nextgroup=vimGroupList " Syntax: cluster syn keyword vimSynType contained cluster skipwhite nextgroup=vimClusterName syn region vimClusterName contained matchgroup=vimGroupName start="\k\+" skip="\(\\\\\)*\\|" end="$\||" contains=vimGroupAdd,vimGroupRem,vimSynContains,vimSynError syn match vimGroupAdd contained "add=" nextgroup=vimGroupList syn match vimGroupRem contained "remove=" nextgroup=vimGroupList " Syntax: include syn keyword vimSynType contained include skipwhite nextgroup=vimGroupList " Syntax: keyword syn keyword vimSynType contained keyword skipwhite nextgroup=vimSynKeyRegion syn region vimSynKeyRegion contained oneline matchgroup=vimGroupName start="\k\+" skip="\(\\\\\)*\\|" end="$\||" contains=vimSynNextgroup,vimSynKeyOpt syn match vimSynKeyOpt contained "\<\(contained\|transparent\|skipempty\|skipwhite\|skipnl\)\>" " Syntax: match syn keyword vimSynType contained match skipwhite nextgroup=vimSynMatchRegion syn region vimSynMatchRegion contained oneline keepend matchgroup=vimGroupName start="\k\+" end="$" contains=vimComment,vimSynContains,vimSynError,vimSynKeyOpt,vimSynNextgroup,vimSynRegPat " Syntax: off syn keyword vimSynType contained off " Syntax: region syn keyword vimSynType contained region skipwhite nextgroup=vimSynRegion syn region vimSynRegion contained oneline matchgroup=vimGroupName start="\k\+" skip="\(\\\\\)*\\|" end="$\||" contains=vimSynContains,vimSynNextgroup,vimSynRegOpt,vimSynReg,vimSynMtchGrp syn match vimSynRegOpt contained "\<\(contained\|transparent\|skipempty\|skipwhite\|skipnl\|oneline\|keepend\)\>" syn match vimSynReg contained "\(start\|skip\|end\)="he=e-1 nextgroup=vimSynRegPat syn match vimSynMtchGrp contained "matchgroup=" syn region vimSynRegPat contained oneline start="!" skip="\(\\\\\)*\\!" end="!" contains=vimPatSep,vimNotPatSep,vimSynPatRange,vimSynNotPatRange nextgroup=vimSynPatMod syn region vimSynRegPat contained oneline start="%" skip="\(\\\\\)*\\-" end="%" contains=vimPatSep,vimNotPatSep,vimSynPatRange,vimSynNotPatRange nextgroup=vimSynPatMod syn region vimSynRegPat contained oneline start="'" skip="\(\\\\\)*\\'" end="'" contains=vimPatSep,vimNotPatSep,vimSynPatRange,vimSynNotPatRange nextgroup=vimSynPatMod syn region vimSynRegPat contained oneline start="+" skip="\(\\\\\)*\\+" end="+" contains=vimPatSep,vimNotPatSep,vimSynPatRange,vimSynNotPatRange nextgroup=vimSynPatMod syn region vimSynRegPat contained oneline start="@" skip="\(\\\\\)*\\@" end="@" contains=vimPatSep,vimNotPatSep,vimSynPatRange,vimSynNotPatRange nextgroup=vimSynPatMod syn region vimSynRegPat contained oneline start='"' skip='\(\\\\\)*\\"' end='"' contains=vimPatSep,vimNotPatSep,vimSynPatRange,vimSynNotPatRange nextgroup=vimSynPatMod syn region vimSynRegPat contained oneline start='/' skip='\(\\\\\)*\\/' end='/' contains=vimPatSep,vimNotPatSep,vimSynPatRange,vimSynNotPatRange nextgroup=vimSynPatMod syn region vimSynRegPat contained oneline start=',' skip='\(\\\\\)*\\,' end=',' contains=vimPatSep,vimNotPatSep,vimSynPatRange,vimSynNotPatRange nextgroup=vimSynPatMod syn region vimSynRegPat contained oneline start='\$' skip='\(\\\\\)*\\\$' end='\$' contains=vimPatSep,vimNotPatSep,vimSynPatRange,vimSynNotPatRange nextgroup=vimSynPatMod syn match vimSynPatMod contained "\(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\([-+][0-9]\+\)\=" syn match vimSynPatMod contained "\(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\([-+][0-9]\+\)\=," nextgroup=vimSynPatMod syn match vimSynPatMod contained "lc=[0-9]" syn match vimSynPatMod contained "lc=[0-9]," nextgroup=vimSynPatMod syn region vimSynPatRange contained oneline start="\[" skip="\(\\\\\)*\\]" end="]" syn match vimSynNotPatRange contained "\(\\\\\)*\\\[" " Syntax: sync syn keyword vimSynType contained sync skipwhite nextgroup=vimSyncC,vimSyncLines,vimSyncMatch,vimSyncError,vimSyncLinecont syn match vimSyncError contained "\i\+" syn keyword vimSyncC contained ccomment clear syn keyword vimSyncMatch contained match skipwhite nextgroup=vimSyncGroupName syn keyword vimSyncLinecont contained linecont skipwhite nextgroup=vimSynRegPat syn match vimSyncLines contained "\(minlines\|maxlines\|lines\)=" nextgroup=vimNumber syn match vimSyncGroupName contained "\k\+" skipwhite nextgroup=vimSyncKey syn match vimSyncKey contained "\" skipwhite nextgroup=vimSyncGroup syn match vimSyncGroup contained "\k\+" skipwhite nextgroup=vimSynRegPat,vimSyncNone syn keyword vimSyncNone contained NONE " Additional IsCommand stuff, here by reasons of precedence " ==================== syn match vimIsCommand "\s*[a-zA-Z]\+" transparent contains=vimCommand,vimNotation " Highlighting " ============ syn match vimHighlight "^\s*\(highlight\|highligh\|highlig\|highli\|highl\|high\|hig\|hi\)" skipwhite nextgroup=vimHiLink,vimHiClear,vimHiKeyList,vimComment syn match vimHighlight "[:|]\s*\(highlight\|highligh\|highlig\|highli\|highl\|high\|hig\|hi\)" skipwhite nextgroup=vimHiLink,vimHiClear,vimHiKeyList,vimComment syn match vimAuHighlight contained "\s+\(highlight\|highligh\|highlig\|highli\|highl\|high\|hig\|hi\)" skipwhite nextgroup=vimHiLink,vimHiClear,vimHiKeyList,vimComment syn match vimHiGroup contained "\i\+" syn case ignore syn keyword vimHiAttrib contained none bold inverse italic reverse standout underline syn keyword vimFgBgAttrib contained none bg background fg foreground syn case match syn match vimHiAttribList contained "\i\+" contains=vimHiAttrib syn match vimHiAttribList contained "\i\+,"he=e-1 contains=vimHiAttrib nextgroup=vimHiAttribList,vimHiAttrib syn case ignore syn keyword vimHiCtermColor contained black darkcyan darkred lightcyan lightred syn keyword vimHiCtermColor contained blue darkgray gray lightgray magenta syn keyword vimHiCtermColor contained brown darkgreen green lightgreen red syn keyword vimHiCtermColor contained cyan darkgrey grey lightgrey white syn keyword vimHiCtermColor contained darkBlue darkmagenta lightblue lightmagenta yellow syn case match syn match vimHiFontname contained "[a-zA-z\-*]\+" syn match vimHiGuiFontname contained "'[a-zA-z\-* ]\+'" syn match vimHiGuiRgb contained "#\x\{6}" syn match vimHiCtermError contained "[^0-9]\i*" " Highlighting: hi group key=arg ... syn cluster vimHiCluster contains=vimHiGroup,vimHiTerm,vimHiCTerm,vimHiStartStop,vimHiCtermFgBg,vimHiGui,vimHiGuiFont,vimHiGuiFgBg,vimHiKeyError syn region vimHiKeyList contained oneline start="\i\+" skip="\(\\\\\)*\\|" end="$\||" contains=@vimHiCluster syn match vimHiKeyError contained "\i\+="he=e-1 syn match vimHiTerm contained "[tT][eE][rR][mM]="he=e-1 nextgroup=vimHiAttribList syn match vimHiStartStop contained "\([sS][tT][aA][rR][tT]\|[sS][tT][oO][pP]\)="he=e-1 nextgroup=vimHiTermcap,vimOption syn match vimHiCTerm contained "[cC][tT][eE][rR][mM]="he=e-1 nextgroup=vimHiAttribList syn match vimHiCtermFgBg contained "[cC][tT][eE][rR][mM][fFbB][gG]="he=e-1 nextgroup=vimNumber,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError syn match vimHiGui contained "[gG][uU][iI]="he=e-1 nextgroup=vimHiAttribList syn match vimHiGuiFont contained "[fF][oO][nN][tT]="he=e-1 nextgroup=vimHiFontname syn match vimHiGuiFgBg contained "[gG][uU][iI][fFbB][gG]="he=e-1 nextgroup=vimHiGroup,vimHiGuiFontname,vimHiGuiRgb,vimFgBgAttrib syn match vimHiTermcap contained "\S\+" contains=vimNotation " Highlight: clear syn keyword vimHiClear contained clear nextgroup=vimHiGroup " Highlight: link syn region vimHiLink contained oneline matchgroup=vimCommand start="link" end="$" contains=vimHiGroup,vimGroup " Angle-Bracket Notation (tnx to Michael Geddes) " ====================== syn case ignore syn match vimNotation "<\([scam]-\)\{0,4}\(f[0-9]\{1,2}\|\S\|cr\|lf\|linefeed\|return\|del\(ete\)\ =\|bs\|backspace\|tab\|esc\|right\|left\|Help\|Undo\|Insert\|Ins\|k\=Home\|k \=End\|kPlus\|kMinus\|kDivide\|kMultiply\|kEnter\|k\=\(page\)\=\(\|down\|up\)\)>" contains=vimBracket syn match vimNotation "<\([scam2-4]-\)\{0,4}\(right\|left\|middle\)\(mouse\|drag\|release\)>" contains=vimBracket syn match vimNotation "<\(nul\|bar\|bslash\|lt\|space\)>" contains=vimBracket syn match vimNotation '[0-9a-z"%#:.\-=]'he=e-1 contains=vimBracket syn match vimBracket contained "[<>]" syn match vimBracket contained "[<>]" syn case match " Control Characters " ================== syn match vimCtrlChar "[- -]" " Highlighting Settings " ==================== if !exists("did_vim_syntax_inits") let did_vim_syntax_inits = 1 " The default methods for highlighting. Can be overridden later hi link vimAuHighlight vimHighlight hi link vimAddress vimMark hi link vimAutoCmdOpt vimOption hi link vimAutoSet vimCommand hi link vimBehaveError vimError hi link vimCommentString vimString hi link vimConditional vimStatement hi link vimErrSetting vimError hi link vimFgBgAttrib vimHiAttrib hi link vimFilter vimOper hi link vimFunctionError vimError hi link vimGroupAdd vimSynOption hi link vimGroupRem vimSynOption hi link vimHLGroup vimGroup hi link vimHiAttribList vimError hi link vimHiCTerm vimHiTerm hi link vimHiCtermError vimError hi link vimHiCtermFgBg vimHiTerm hi link vimHiGroup vimGroupName hi link vimHiGui vimHiTerm hi link vimHiGuiFgBg vimHiTerm hi link vimHiGuiFont vimHiTerm hi link vimHiGuiRgb vimNumber hi link vimHiKeyError vimError hi link vimHiStartStop vimHiTerm hi link vimHighlight vimCommand hi link vimKeyCode vimSpecFile hi link vimKeyCodeError vimError hi link vimLineComment vimComment hi link vimNotPatSep vimString hi link vimPlainMark vimMark hi link vimPlainRegister vimRegister hi link vimSetString vimString hi link vimSpecFileMod vimSpecFile hi link vimStringCont vimString hi link vimSynCaseError vimError hi link vimSynContains vimSynOption hi link vimSynKeyOpt vimSynOption hi link vimSynMtchGrp vimSynOption hi link vimSynNextgroup vimSynOption hi link vimSynNotPatRange vimSynRegPat hi link vimSynPatRange vimString hi link vimSynRegOpt vimSynOption hi link vimSynRegPat vimString hi link vimSynType vimSpecial hi link vimSyncGroup vimGroupName hi link vimSyncGroupName vimGroupName hi link vimUserAttrb vimSpecial hi link vimUserAttrbCmplt vimSpecial hi link vimUserAttrbKey vimOption hi link vimUserCmd vimCommand hi link vimAutoEvent Type hi link vimBracket Delimiter hi link vimCmplxRepeat SpecialChar hi link vimCommand Statement hi link vimComment Comment hi link vimCommentTitle PreProc hi link vimCtrlChar SpecialChar hi link vimError Error hi link vimFuncName Function hi link vimFuncVar Identifier hi link vimGroup Type hi link vimGroupSpecial Special hi link vimHLMod PreProc hi link vimHiAttrib PreProc hi link vimHiTerm Type hi link vimKeyword Statement hi link vimMark Number hi link vimNotation Special hi link vimNumber Number hi link vimOper Operator hi link vimOption PreProc hi link vimPatSep SpecialChar hi link vimPattern Type hi link vimRegister SpecialChar hi link vimSpecFile Identifier hi link vimSpecial Type hi link vimStatement Statement hi link vimString String hi link vimSubstPat SpecialChar hi link vimSynCase Type hi link vimSynCaseError Error hi link vimSynError Error hi link vimSynOption Special hi link vimSynReg Type hi link vimSyncC Type hi link vimSyncError Error hi link vimSyncKey Type hi link vimSyncNone Type hi link vimTodo Todo endif let b:current_syntax = "vim" " vim: ts=17