1" Vim syntax file 2" Language: Vim 7.0 script 3" Maintainer: Dr. Charles E. Campbell, Jr. <[email protected]> 4" Last Change: December 07, 2004 5" Version: 7.0-02 NOT RELEASED 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 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[arks] diffg[et] diffoff 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 keepalt 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] mzf[ile] mz[scheme] new n[ext] N[ext] nmapc[lear] noh[lsearch] norea[bbrev] 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] sandbox 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 cfu ch charconvert ci cin cindent cink cinkeys cino cinoptions cinw cinwords clipboard cmdheight cmdwinheight cmp cms co columns com comments commentstring compatible complete completefunc confirm consk conskey copyindent cp cpo cpoptions cpt cscopepathcomp cscopeprg cscopequickfix cscopetag cscopetagorder cscopeverbose cspc csprg csqf cst csto csverb 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 mzq mzquantum nf nrformats nu number numberwidth nuw oft osfiletype pa para paragraphs paste pastetoggle patchexpr patchmode path pdev penc pex pexpr pfn pheader pi pm pmbcs pmbfn popt preserveindent previewheight previewwindow printdevice printencoding printexpr printfont printheader printmbcharset printmbfont printoptions pt pvh pvw qe quoteescape 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 nocscopetag nocscopeverbose nocst nocsverb 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 invcscopetag invcscopeverbose invcst invcsverb 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 ColorScheme 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 InsertChange InsertEnter InsertLeave 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 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 match vimHLGroup contained "Conceal" 55syn case match 56 57" Function Names {{{2 58syn keyword vimFuncName contained append argc argidx argv browse browsedir bufexists buflisted bufloaded bufname bufnr bufwinnr byte2line byteidx char2nr cindent col confirm cscope_connection cursor delete did_filetype diff_filler diff_hlID escape eventhandler executable exists expand filereadable filewritable finddir findfile fnamemodify foldclosed foldclosedend foldlevel foldtext foldtextresult foreground function getbufvar getchar getcharmod getcmdline getcmdpos getcwd getfperm getfsize getftime getftype 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 repeat 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 tr type virtcol visualmode winbufnr wincol winheight winline winnr winrestcmd winwidth 59 60"--- syntax above generated by mkvimvim --- 61"--- syntax above generated by mkvimvim --- 62" Special Vim Highlighting (not automatic) {{{1 63 64" Numbers {{{2 65" ======= 66syn match vimNumber "\<\d\+\([lL]\|\.\d\+\)\=" 67syn match vimNumber "-\d\+\([lL]\|\.\d\+\)\=" 68syn match vimNumber "\<0[xX]\x\+" 69syn match vimNumber "#\x\{6}" 70 71" All vimCommands are contained by vimIsCommands. {{{2 72syn match vimCmdSep "[:|]\+" skipwhite nextgroup=vimAddress,vimAutoCmd,vimCommand,vimExtCmd,vimFilter,vimLet,vimMap,vimMark,vimSet,vimSyntax,vimUserCmd 73syn match vimIsCommand "\<\h\w*\>" contains=vimCommand 74syn match vimVar "\<[bwglsav]:\K\k*\>" 75syn match vimVar contained "\<\K\k*\>" 76 77" Insertions And Appends: insert append {{{2 78" ======================= 79syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=a\%[ppend]$" matchgroup=vimCommand end="^\.$"" 80syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=c\%[hange]$" matchgroup=vimCommand end="^\.$"" 81syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=i\%[nsert]$" matchgroup=vimCommand end="^\.$"" 82 83" Behave! {{{2 84" ======= 85syn match vimBehave "\<be\%[have]\>" skipwhite nextgroup=vimBehaveModel,vimBehaveError 86syn keyword vimBehaveModel contained mswin xterm 87if !exists("g:vimsyntax_noerror") 88 syn match vimBehaveError contained "[^ ]\+" 89endif 90 91" Filetypes {{{2 92" ========= 93syn match vimFiletype "\<filet\%[ype]\(\s\+\I\i*\)*" skipwhite contains=vimFTCmd,vimFTOption,vimFTError 94if !exists("g:vimsyntax_noerror") 95 syn match vimFTError contained "\I\i*" 96endif 97syn keyword vimFTCmd contained filet[ype] 98syn keyword vimFTOption contained detect indent off on plugin 99 100" Augroup : vimAugroupError removed because long augroups caused sync'ing problems. {{{2 101" ======= : Trade-off: Increasing synclines with slower editing vs augroup END error checking. 102syn 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 103syn region vimAugroup start="\<aug\%[roup]\>\s\+\K\k*" end="\<aug\%[roup]\>\s\+[eE][nN][dD]\>" contains=vimAugroupKey,vimAutoCmd,@vimAugroupList keepend 104if !exists("g:vimsyntax_noerror") 105 syn match vimAugroupError "\<aug\%[roup]\>\s\+[eE][nN][dD]\>" 106endif 107syn keyword vimAugroupKey contained aug[roup] 108 109" Functions : Tag is provided for those who wish to highlight tagged functions {{{2 110" ========= 111syn cluster vimFuncList contains=vimCommand,vimFuncKey,Tag,vimFuncSID 112syn 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 113if !exists("g:vimsyntax_noerror") 114 syn match vimFunctionError "\<fu\%[nction]!\=\s\+\zs\U\i\{-}\ze\s*(" contains=vimFuncKey,vimFuncBlank nextgroup=vimFuncBody 115endif 116syn match vimFunction "\<fu\%[nction]!\=\s\+\(<[sS][iI][dD]>\|[Ss]:\|\u\)\i*\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody 117syn region vimFuncBody contained start=")" end="\<endf\%[unction]" contains=@vimFuncBodyList 118syn match vimFuncVar contained "a:\(\I\i*\|\d\+\)" 119syn match vimFuncSID contained "\c<sid>\|\<s:" 120syn keyword vimFuncKey contained fu[nction] 121syn match vimFuncBlank contained "\s\+" 122 123syn keyword vimPattern contained start skip end 124 125" Operators: {{{2 126" ========= 127syn cluster vimOperGroup contains=vimOper,vimOperParen,vimNumber,vimString,vimOperOk 128syn match vimOper "\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile 129syn match vimOper "||\|&&\|[-+.]" skipwhite nextgroup=vimString,vimSpecFile 130syn region vimOperParen oneline matchgroup=vimOper start="(" end=")" contains=@vimOperGroup 131syn region vimOperParen oneline matchgroup=vimSep start="{" end="}" contains=@vimOperGroup nextgroup=vimVar 132syn match vimOperOk "\<[aiAIrR][()]" 133if !exists("g:vimsyntax_noerror") 134 syn match vimOperError ")" 135endif 136 137" Special Filenames, Modifiers, Extension Removal: {{{2 138" =============================================== 139syn match vimSpecFile "<c\(word\|WORD\)>" nextgroup=vimSpecFileMod,vimSubst 140syn match vimSpecFile "<\([acs]file\|amatch\|abuf\)>" nextgroup=vimSpecFileMod,vimSubst 141syn match vimSpecFile "\s%[ \t:]"ms=s+1,me=e-1 nextgroup=vimSpecFileMod,vimSubst 142syn match vimSpecFile "\s%$"ms=s+1 nextgroup=vimSpecFileMod,vimSubst 143syn match vimSpecFile "\s%<"ms=s+1,me=e-1 nextgroup=vimSpecFileMod,vimSubst 144syn match vimSpecFile "#\d\+\|[#%]<\>" nextgroup=vimSpecFileMod,vimSubst 145syn match vimSpecFileMod "\(:[phtre]\)\+" contained 146 147" User-Specified Commands: {{{2 148" ======================= 149syn 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 150syn keyword vimUserCommand contained com[mand] 151syn match vimUserCmd "\<com\%[mand]!\=\>.*$" contains=vimUserAttrb,vimUserCommand,@vimUserCmdList 152syn match vimUserAttrb contained "-n\%[args]=[01*?+]" contains=vimUserAttrbKey,vimOper 153syn match vimUserAttrb contained "-com\%[plete]=" contains=vimUserAttrbKey,vimOper nextgroup=vimUserAttrbCmplt,vimUserCmdError 154syn match vimUserAttrb contained "-ra\%[nge]\(=%\|=\d\+\)\=" contains=vimNumber,vimOper,vimUserAttrbKey 155syn match vimUserAttrb contained "-cou\%[nt]=\d\+" contains=vimNumber,vimOper,vimUserAttrbKey 156syn match vimUserAttrb contained "-bang\=\>" contains=vimOper,vimUserAttrbKey 157syn match vimUserAttrb contained "-bar\>" contains=vimOper,vimUserAttrbKey 158syn match vimUserAttrb contained "-re\%[gister]\>" contains=vimOper,vimUserAttrbKey 159if !exists("g:vimsyntax_noerror") 160 syn match vimUserCmdError contained "\S\+\>" 161endif 162syn case ignore 163syn keyword vimUserAttrbKey contained bar ban[g] cou[nt] ra[nge] com[plete] n[args] re[gister] 164syn keyword vimUserAttrbCmplt contained augroup buffer command dir environment event expression file function help highlight mapping menu option tag tag_listfiles var 165syn case match 166syn match vimUserAttrbCmplt contained "custom,\u\w*" 167 168" Errors: {{{2 169" ====== 170if !exists("g:vimsyntax_noerror") 171 syn match vimElseIfErr "\<else\s\+if\>" 172endif 173 174" Lower Priority Comments: after some vim commands... {{{2 175" ======================= 176syn match vimComment excludenl +\s"[^\-:.%#=*].*$+lc=1 contains=@vimCommentGroup,vimCommentString 177syn match vimComment +\<endif\s\+".*$+lc=5 contains=@vimCommentGroup,vimCommentString 178syn match vimComment +\<else\s\+".*$+lc=4 contains=@vimCommentGroup,vimCommentString 179syn region vimCommentString contained oneline start='\S\s\+"'ms=s+1 end='"' 180 181" Environment Variables: {{{2 182" ===================== 183syn match vimEnvvar "\$\I\i*" 184syn match vimEnvvar "\${\I\i*}" 185 186" In-String Specials: {{{2 187" Try to catch strings, if nothing else matches (therefore it must precede the others!) 188" vimEscapeBrace handles ["] []"] (ie. "s don't terminate string inside []) 189syn region vimEscapeBrace oneline contained transparent start="[^\\]\(\\\\\)*\[\^\=\]\=" skip="\\\\\|\\\]" end="\]"me=e-1 190syn match vimPatSepErr contained "\\)" 191syn match vimPatSep contained "\\|" 192syn region vimPatSepZone oneline contained matchgroup=vimPatSep start="\\%\=(" skip="\\\\" end="\\)\|[^\]['"]" contains=@vimStringGroup 193syn region vimPatRegion contained transparent matchgroup=vimPatSep start="\\[z%]\=(" end="\\)" contains=@vimSubstList oneline 194syn match vimNotPatSep contained "\\\\" 195syn cluster vimStringGroup contains=vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone 196syn region vimString oneline keepend start=+[^:a-zA-Z>!\\]"+lc=1 skip=+\\\\\|\\"+ end=+"+ contains=@vimStringGroup 197syn region vimString oneline keepend start=+[^:a-zA-Z>!\\]'+lc=1 end=+'+ contains=@vimStringGroup 198syn region vimString oneline start=+=!+lc=1 skip=+\\\\\|\\!+ end=+!+ contains=@vimStringGroup 199syn region vimString oneline start="=+"lc=1 skip="\\\\\|\\+" end="+" contains=@vimStringGroup 200syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup 201syn match vimString contained +"[^"]*\\$+ skipnl nextgroup=vimStringCont 202syn match vimStringCont contained +\(\\\\\|.\)\{-}[^\\]"+ 203 204" Substitutions: {{{2 205" ============= 206syn cluster vimSubstList contains=vimPatSep,vimPatRegion,vimPatSepErr,vimSubstTwoBS,vimSubstRange,vimNotation 207syn cluster vimSubstRepList contains=vimSubstSubstr,vimSubstTwoBS,vimNotation 208syn cluster vimSubstList add=vimCollection 209syn match vimSubst "\(:\+\s*\|^\s*\||\s*\)\<s\%[ubstitute][:[:alpha:]]\@!" nextgroup=vimSubstPat 210syn match vimSubst "s\%[ubstitute][:[:alpha:]]\@!" nextgroup=vimSubstPat contained 211syn match vimSubst "/\zss\%[ubstitute]\ze/" nextgroup=vimSubstPat 212syn match vimSubst1 contained "s\%[ubstitute]\>" nextgroup=vimSubstPat 213syn 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 214syn region vimSubstRep4 contained matchgroup=vimSubstDelim start="\z(.\)" skip="\\\\\|\\\z1" end="\z1" matchgroup=vimNotation end="<[cC][rR]>" contains=@vimSubstRepList nextgroup=vimSubstFlagErr oneline 215syn region vimCollection contained transparent start="\\\@<!\[" skip="\\\[" end="\]" contains=vimCollClass 216syn match vimCollClassErr contained "\[:.\{-\}:\]" 217syn match vimCollClass contained transparent "\[:\(alnum\|alpha\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|xdigit\|return\|tab\|escape\|backspace\):\]" 218syn match vimSubstSubstr contained "\\z\=\d" 219syn match vimSubstTwoBS contained "\\\\" 220syn match vimSubstFlagErr contained "[^< \t\r]\+" contains=vimSubstFlags 221syn match vimSubstFlags contained "[&cegiIpr]\+" 222 223" 'String': {{{2 224syn match vimString "[^(,]'[^']\{-}'"lc=1 contains=@vimStringGroup 225 226" Marks, Registers, Addresses, Filters: {{{2 227syn match vimMark "'[a-zA-Z0-9]\ze[-+,!]" nextgroup=vimOper,vimMarkNumber,vimSubst 228syn match vimMark "'[<>]\ze[-+,!]" nextgroup=vimOper,vimMarkNumber,vimSubst 229syn match vimMark ",\zs'[<>]\ze" nextgroup=vimOper,vimMarkNumber,vimSubst 230syn match vimMark "[!,:]\zs'[a-zA-Z0-9]" nextgroup=vimOper,vimMarkNumber,vimSubst 231syn match vimMark "\<norm\%[al]\s\zs'[a-zA-Z0-9]" nextgroup=vimOper,vimMarkNumber,vimSubst 232syn match vimMarkNumber "[-+]\d\+" nextgroup=vimSubst contained contains=vimOper 233syn match vimPlainMark contained "'[a-zA-Z0-9]" 234 235syn match vimRegister '[^(,;.]"[a-zA-Z0-9.%#:_\-/][^a-zA-Z_"]'lc=1,me=e-1 236syn match vimRegister '\<norm\s\+"[a-zA-Z0-9]'lc=5 237syn match vimRegister '\<normal\s\+"[a-zA-Z0-9]'lc=7 238syn match vimRegister '@"' 239syn match vimPlainRegister contained '"[a-zA-Z0-9\-:.%#*+=]' 240 241syn match vimAddress ",[.$]"lc=1 skipwhite nextgroup=vimSubst1 242syn match vimAddress "%\a"me=e-1 skipwhite nextgroup=vimString,vimSubst1 243 244syn match vimFilter contained "^!.\{-}\(|\|$\)" contains=vimSpecFile 245syn match vimFilter contained "\A!.\{-}\(|\|$\)"ms=s+1 contains=vimSpecFile 246 247" Complex repeats (:h complex-repeat) {{{2 248syn match vimCmplxRepeat '[^a-zA-Z_/\\()]q[0-9a-zA-Z"]'lc=1 249syn match vimCmplxRepeat '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\)' 250 251" Set command and associated set-options (vimOptions) with comment {{{2 252syn 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 253syn region vimSetEqual contained start="=" skip="\\\\\|\\\s" end="[| \t]\|$"me=e-1 contains=vimCtrlChar,vimSetSep,vimNotation 254syn region vimSetString contained start=+="+hs=s+1 skip=+\\\\\|\\"+ end=+"+ contains=vimCtrlChar 255syn match vimSetSep contained "[,:]" 256syn match vimSetMod contained "&vim\|[!&]\|all&" 257 258" Let {{{2 259" === 260syn keyword vimLet let unl[et] skipwhite nextgroup=vimVar 261 262" Autocmd {{{2 263" ======= 264syn match vimAutoEventList contained "\(!\s\+\)\=\(\a\+,\)*\a\+" contains=vimAutoEvent nextgroup=vimAutoCmdSpace 265syn match vimAutoCmdSpace contained "\s\+" nextgroup=vimAutoCmdSfxList 266syn match vimAutoCmdSfxList contained "\S*" 267syn keyword vimAutoCmd au[tocmd] do[autocmd] doautoa[ll] skipwhite nextgroup=vimAutoEventList 268 269" Echo and Execute -- prefer strings! {{{2 270" ================ 271syn region vimEcho oneline excludenl matchgroup=vimCommand start="\<ec\%[ho]\>" skip="\(\\\\\)*\\|" end="$\||" contains=vimFunc,vimString,varVar 272syn region vimExecute oneline excludenl matchgroup=vimCommand start="\<exe\%[cute]\>" skip="\(\\\\\)*\\|" end="$\||\|<[cC][rR]>" contains=vimIsCommand,vimString,vimOper,vimVar,vimNotation,vimOperParen 273syn match vimEchoHL "echohl\=" skipwhite nextgroup=vimGroup,vimHLGroup,vimEchoHLNone 274syn case ignore 275syn keyword vimEchoHLNone none 276syn case match 277 278" Maps {{{2 279" ==== 280syn cluster vimMapGroup contains=vimMapBang,vimMapLhs,vimMapMod 281syn 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 282syn match vimMapLhs contained "\S\+" contains=vimNotation,vimCtrlChar 283syn match vimMapBang contained "!" skipwhite nextgroup=vimMapLhs 284syn match vimMapMod contained "\c<\(buffer\|\(local\)\=leader\|plug\|script\|sid\|unique\|silent\)\+>" skipwhite contains=vimMapModKey,vimMapModErr nextgroup=@vimMapGroup 285syn case ignore 286syn keyword vimMapModKey contained buffer leader localleader plug script sid silent unique 287syn case match 288 289" Menus {{{2 290" ===== 291syn cluster vimMenuList contains=vimMenuBang,vimMenuPriority,vimMenuName,vimMenuMod 292syn 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 293syn match vimMenuName "[^ \t\\<]\+" contained nextgroup=vimMenuNameMore,vimMenuMap 294syn match vimMenuPriority "\d\+\(\.\d\+\)*" contained skipwhite nextgroup=vimMenuName 295syn match vimMenuNameMore "\c\\\s\|<tab>\|\\\." contained nextgroup=vimMenuName,vimMenuNameMore contains=vimNotation 296syn match vimMenuMod contained "\c<\(script\|silent\)\+>" skipwhite contains=vimMapModKey,vimMapModErr nextgroup=@vimMenuList 297syn match vimMenuMap "\s" contained skipwhite nextgroup=vimMenuRhs 298syn match vimMenuRhs ".*$" contained contains=vimString,vimComment,vimIsCommand 299syn match vimMenuBang "!" contained skipwhite nextgroup=@vimMenuList 300 301" Angle-Bracket Notation (tnx to Michael Geddes) {{{2 302" ====================== 303syn case ignore 304syn 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 305syn match vimNotation "\(\\\|<lt>\)\=<\([scam2-4]-\)\{0,4}\(right\|left\|middle\)\(mouse\)\=\(drag\|release\)\=>" contains=vimBracket 306syn match vimNotation "\(\\\|<lt>\)\=<\(bslash\|plug\|sid\|space\|bar\|nop\|nul\|lt\)>" contains=vimBracket 307syn match vimNotation '\(\\\|<lt>\)\=<C-R>[0-9a-z"%#:.\-=]'he=e-1 contains=vimBracket 308syn match vimNotation '\(\\\|<lt>\)\=<\(line[12]\|count\|bang\|reg\|args\|lt\|[qf]-args\)>' contains=vimBracket 309syn match vimNotation "\(\\\|<lt>\)\=<\([cas]file\|abuf\|amatch\|cword\|cWORD\|client\)>" contains=vimBracket 310syn match vimBracket contained "[\\<>]" 311syn case match 312 313" User Function Highlighting (following Gautam Iyer's suggestion) {{{2 314" ========================== 315syn match vimFunc "\%([sS]:\|<[sS][iI][dD]>\)\=\I\i*\ze\s*(" contains=vimFuncName,vimUserFunc,vimCommand,vimNotFunc,vimExecute 316syn match vimUserFunc contained "\%([sS]:\|<[sS][iI][dD]>\)\i\+\|\<\u\i*\>\|\<if\>" contains=vimNotation,vimCommand 317syn match vimNotFunc contained "\<[aiAIrR](" 318 319" Syntax {{{2 320"======= 321syn match vimGroupList contained "@\=[^ \t,]*" contains=vimGroupSpecial,vimPatSep 322syn match vimGroupList contained "@\=[^ \t,]*," nextgroup=vimGroupList contains=vimGroupSpecial,vimPatSep 323syn keyword vimGroupSpecial contained ALL ALLBUT 324if !exists("g:vimsyntax_noerror") 325 syn match vimSynError contained "\i\+" 326 syn match vimSynError contained "\i\+=" nextgroup=vimGroupList 327endif 328syn match vimSynContains contained "\<contain\(s\|edin\)=" nextgroup=vimGroupList 329syn match vimSynKeyContainedin contained "\<containedin=" nextgroup=vimGroupList 330syn match vimSynNextgroup contained "nextgroup=" nextgroup=vimGroupList 331 332syn match vimSyntax "\<sy\%[ntax]\>" contains=vimCommand skipwhite nextgroup=vimSynType,vimComment 333syn match vimAuSyntax contained "\s+sy\%[ntax]" contains=vimCommand skipwhite nextgroup=vimSynType,vimComment 334 335" Syntax: case {{{2 336syn keyword vimSynType contained case skipwhite nextgroup=vimSynCase,vimSynCaseError 337if !exists("g:vimsyntax_noerror") 338 syn match vimSynCaseError contained "\i\+" 339endif 340syn keyword vimSynCase contained ignore match 341 342" Syntax: clear {{{2 343syn keyword vimSynType contained clear skipwhite nextgroup=vimGroupList 344 345" Syntax: cluster {{{2 346syn keyword vimSynType contained cluster skipwhite nextgroup=vimClusterName 347syn region vimClusterName contained matchgroup=vimGroupName start="\k\+" skip="\\\\\|\\|" matchgroup=vimSep end="$\||" contains=vimGroupAdd,vimGroupRem,vimSynContains,vimSynError 348syn match vimGroupAdd contained "add=" nextgroup=vimGroupList 349syn match vimGroupRem contained "remove=" nextgroup=vimGroupList 350 351" Syntax: include {{{2 352syn keyword vimSynType contained include skipwhite nextgroup=vimGroupList 353 354" Syntax: keyword {{{2 355syn cluster vimSynKeyGroup contains=vimSynNextgroup,vimSynKeyOpt,vimSynKeyContainedin 356syn keyword vimSynType contained keyword skipwhite nextgroup=vimSynKeyRegion 357syn region vimSynKeyRegion contained keepend matchgroup=vimGroupName start="\k\+" skip="\\\\\|\\|" matchgroup=vimSep end="|\|$" contains=@vimSynKeyGroup 358syn match vimSynKeyOpt contained "\<\(conceal\|contained\|transparent\|skipempty\|skipwhite\|skipnl\)\>" 359 360" Syntax: match {{{2 361syn cluster vimSynMtchGroup contains=vimMtchComment,vimSynContains,vimSynError,vimSynMtchOpt,vimSynNextgroup,vimSynRegPat,vimNotation 362syn keyword vimSynType contained match skipwhite nextgroup=vimSynMatchRegion 363syn region vimSynMatchRegion contained keepend matchgroup=vimGroupName start="\k\+" matchgroup=vimSep end="|\|$" contains=@vimSynMtchGroup 364syn match vimSynMtchOpt contained "\<\(conceal\|transparent\|contained\|excludenl\|skipempty\|skipwhite\|display\|extend\|skipnl\|fold\)\>" 365if has("conceal") 366 syn match vimSynMtchOpt contained "\<cchar=" nextgroup=VimSynMtchCchar 367 syn match vimSynMtchCchar contained "." 368endif 369 370" Syntax: off and on {{{2 371syn keyword vimSynType contained enable list manual off on reset 372 373" Syntax: region {{{2 374syn cluster vimSynRegPatGroup contains=vimPatSep,vimNotPatSep,vimSynPatRange,vimSynNotPatRange,vimSubstSubstr,vimPatRegion,vimPatSepErr,vimNotation 375syn cluster vimSynRegGroup contains=vimSynContains,vimSynNextgroup,vimSynRegOpt,vimSynReg,vimSynMtchGrp 376syn keyword vimSynType contained region skipwhite nextgroup=vimSynRegion 377syn region vimSynRegion contained keepend matchgroup=vimGroupName start="\k\+" skip="\\\\\|\\|" end="|\|$" contains=@vimSynRegGroup 378syn match vimSynRegOpt contained "\<\(conceal\(ends\)\=\|transparent\|contained\|excludenl\|skipempty\|skipwhite\|display\|keepend\|oneline\|extend\|skipnl\|fold\)\>" 379syn match vimSynReg contained "\(start\|skip\|end\)="he=e-1 nextgroup=vimSynRegPat 380syn match vimSynMtchGrp contained "matchgroup=" nextgroup=vimGroup,vimHLGroup 381syn region vimSynRegPat contained extend start="\z([-`~!@#$%^&*_=+;:'",./?]\)" skip="\\\\\|\\\z1" end="\z1" contains=@vimSynRegPatGroup skipwhite nextgroup=vimSynPatMod,vimSynReg 382syn match vimSynPatMod contained "\(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\([-+]\d\+\)\=" 383syn match vimSynPatMod contained "\(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\([-+]\d\+\)\=," nextgroup=vimSynPatMod 384syn match vimSynPatMod contained "lc=\d\+" 385syn match vimSynPatMod contained "lc=\d\+," nextgroup=vimSynPatMod 386syn region vimSynPatRange contained start="\[" skip="\\\\\|\\]" end="]" 387syn match vimSynNotPatRange contained "\\\\\|\\\[" 388syn match vimMtchComment contained '"[^"]\+$' 389 390" Syntax: sync {{{2 391" ============ 392syn keyword vimSynType contained sync skipwhite nextgroup=vimSyncC,vimSyncLines,vimSyncMatch,vimSyncError,vimSyncLinecont,vimSyncRegion 393if !exists("g:vimsyntax_noerror") 394 syn match vimSyncError contained "\i\+" 395endif 396syn keyword vimSyncC contained ccomment clear fromstart 397syn keyword vimSyncMatch contained match skipwhite nextgroup=vimSyncGroupName 398syn keyword vimSyncRegion contained region skipwhite nextgroup=vimSynReg 399syn keyword vimSyncLinecont contained linecont skipwhite nextgroup=vimSynRegPat 400syn match vimSyncLines contained "\(min\|max\)\=lines=" nextgroup=vimNumber 401syn match vimSyncGroupName contained "\k\+" skipwhite nextgroup=vimSyncKey 402syn match vimSyncKey contained "\<groupthere\|grouphere\>" skipwhite nextgroup=vimSyncGroup 403syn match vimSyncGroup contained "\k\+" skipwhite nextgroup=vimSynRegPat,vimSyncNone 404syn keyword vimSyncNone contained NONE 405 406" Additional IsCommand, here by reasons of precedence {{{2 407" ==================== 408syn match vimIsCommand "<Bar>\s*\a\+" transparent contains=vimCommand,vimNotation 409 410" Highlighting {{{2 411" ============ 412syn cluster vimHighlightCluster contains=vimHiLink,vimHiClear,vimHiKeyList,vimComment 413syn match vimHighlight "\<hi\%[ghlight]\>" skipwhite nextgroup=vimHiBang,@vimHighlightCluster 414syn match vimHiBang contained "!" skipwhite nextgroup=@vimHighlightCluster 415 416syn match vimHiGroup contained "\i\+" 417syn case ignore 418syn keyword vimHiAttrib contained none bold inverse italic reverse standout underline 419syn keyword vimFgBgAttrib contained none bg background fg foreground 420syn case match 421syn match vimHiAttribList contained "\i\+" contains=vimHiAttrib 422syn match vimHiAttribList contained "\i\+,"he=e-1 contains=vimHiAttrib nextgroup=vimHiAttribList 423syn case ignore 424syn 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 425 426syn case match 427syn match vimHiFontname contained "[a-zA-Z\-*]\+" 428syn match vimHiGuiFontname contained "'[a-zA-Z\-* ]\+'" 429syn match vimHiGuiRgb contained "#\x\{6}" 430if !exists("g:vimsyntax_noerror") 431 syn match vimHiCtermError contained "[^0-9]\i*" 432endif 433 434" Highlighting: hi group key=arg ... {{{2 435syn cluster vimHiCluster contains=vimHiGroup,vimHiTerm,vimHiCTerm,vimHiStartStop,vimHiCtermFgBg,vimHiGui,vimHiGuiFont,vimHiGuiFgBg,vimHiKeyError,vimNotation 436syn region vimHiKeyList contained oneline start="\i\+" skip="\\\\\|\\|" end="$\||" contains=@vimHiCluster 437if !exists("g:vimsyntax_noerror") 438 syn match vimHiKeyError contained "\i\+="he=e-1 439endif 440syn match vimHiTerm contained "\cterm="he=e-1 nextgroup=vimHiAttribList 441syn match vimHiStartStop contained "\c\(start\|stop\)="he=e-1 nextgroup=vimHiTermcap,vimOption 442syn match vimHiCTerm contained "\ccterm="he=e-1 nextgroup=vimHiAttribList 443syn match vimHiCtermFgBg contained "\ccterm[fb]g="he=e-1 nextgroup=vimNumber,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError 444syn match vimHiGui contained "\cgui="he=e-1 nextgroup=vimHiAttribList 445syn match vimHiGuiFont contained "\cfont="he=e-1 nextgroup=vimHiFontname 446syn match vimHiGuiFgBg contained "\cgui[fb]g="he=e-1 nextgroup=vimHiGroup,vimHiGuiFontname,vimHiGuiRgb,vimFgBgAttrib 447syn match vimHiTermcap contained "\S\+" contains=vimNotation 448 449" Highlight: clear {{{2 450syn keyword vimHiClear contained clear nextgroup=vimHiGroup 451 452" Highlight: link {{{2 453syn region vimHiLink contained oneline matchgroup=vimCommand start="\<\(def\s\+\)\=link\>\|\<def\>" end="$" contains=vimHiGroup,vimGroup,vimHLGroup,vimNotation 454 455" Control Characters {{{2 456" ================== 457syn match vimCtrlChar "[--]" 458 459" Beginners - Patterns that involve ^ {{{2 460" ========= 461syn match vimLineComment +^[ \t:]*".*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle 462syn match vimCommentTitle '"\s*\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vimCommentTitleLeader,vimTodo,@vimCommentGroup 463syn match vimContinue "^\s*\\" 464syn region vimString start="^\s*\\\z(['"]\)" skip='\\\\\|\\\z1' end="\z1" oneline keepend contains=@vimStringGroup,vimContinue 465syn match vimCommentTitleLeader '"\s\+'ms=s+1 contained 466 467" Scripts : perl,ruby : Benoit Cerrina {{{2 468" ======= python,tcl: Johannes Zellner 469 470" allow users to prevent embedded script syntax highlighting 471" when vim doesn't have perl/python/ruby/tcl support. Do 472" so by setting g:vimembedscript= 0 in the user's <.vimrc>. 473if !exists("g:vimembedscript") 474 let g:vimembedscript= 1 475endif 476 477" [-- perl --] {{{3 478if (has("perl") || g:vimembedscript) && filereadable(expand("<sfile>:p:h")."/perl.vim") 479 unlet! b:current_syntax 480 syn include @vimPerlScript <sfile>:p:h/perl.vim 481 syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPerlScript 482 syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*$+ end=+\.$+ contains=@vimPerlScript 483endif 484 485" [-- ruby --] {{{3 486if (has("ruby") || g:vimembedscript) && filereadable(expand("<sfile>:p:h")."/ruby.vim") 487 unlet! b:current_syntax 488 syn include @vimRubyScript <sfile>:p:h/ruby.vim 489 syn region vimRubyRegion matchgroup=vimScriptDelim start=+rub[y]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimRubyScript 490 syn region vimRubyRegion matchgroup=vimScriptDelim start=+rub[y]\s*<<\s*$+ end=+\.$+ contains=@vimRubyScript 491endif 492 493" [-- python --] {{{3 494if (has("python") || g:vimembedscript) && filereadable(expand("<sfile>:p:h")."/python.vim") 495 unlet! b:current_syntax 496 syn include @vimPythonScript <sfile>:p:h/python.vim 497 syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPythonScript 498 syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon]\s*<<\s*$+ end=+\.$+ contains=@vimPythonScript 499endif 500 501" [-- tcl --] {{{3 502if (has("tcl") || g:vimembedscript) && filereadable(expand("<sfile>:p:h")."/tcl.vim") 503 unlet! b:current_syntax 504 syn include @vimTclScript <sfile>:p:h/tcl.vim 505 syn region vimTclRegion matchgroup=vimScriptDelim start=+tc[l]\=\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimTclScript 506 syn region vimTclRegion matchgroup=vimScriptDelim start=+tc[l]\=\s*<<\s*$+ end=+\.$+ contains=@vimTclScript 507endif 508 509" [-- mzscheme --] {{{3 510if (has("mzscheme") || g:vimembedscript) && filereadable(expand("<sfile>:p:h")."/scheme.vim") 511 unlet! b:current_syntax 512 let iskKeep= &isk 513 syn include @vimMzSchemeScript <sfile>:p:h/scheme.vim 514 let &isk= iskKeep 515 syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimMzSchemeScript 516 syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*$+ end=+\.$+ contains=@vimMzSchemeScript 517endif 518 519" Synchronize (speed) {{{2 520"============ 521if exists("g:vim_minlines") 522 exe "syn sync minlines=".g:vim_minlines 523endif 524if exists("g:vim_maxlines") 525 exe "syn sync maxlines=".g:vim_maxlines 526else 527 syn sync maxlines=60 528endif 529syn sync linecont "^\s\+\\" 530syn sync match vimAugroupSyncA groupthere NONE "\<aug\%[roup]\>\s\+[eE][nN][dD]" 531 532" Highlighting Settings {{{2 533" ==================== 534 535hi def link vimAuHighlight vimHighlight 536hi def link vimSubst1 vimSubst 537hi def link vimBehaveModel vimBehave 538 539if !exists("g:vimsyntax_noerror") 540" hi def link vimAugroupError vimError 541 hi def link vimBehaveError vimError 542 hi def link vimCollClassErr vimError 543 hi def link vimErrSetting vimError 544 hi def link vimFTError vimError 545 hi def link vimFunctionError vimError 546 hi def link vimFunc vimError 547 hi def link vimHiAttribList vimError 548 hi def link vimHiCtermError vimError 549 hi def link vimHiKeyError vimError 550 hi def link vimKeyCodeError vimError 551 hi def link vimMapModErr vimError 552 hi def link vimSubstFlagErr vimError 553 hi def link vimSynCaseError vimError 554endif 555 556hi def link vimAddress vimMark 557hi def link vimAugroupKey vimCommand 558hi def link vimAutoCmdOpt vimOption 559hi def link vimAutoCmd vimCommand 560hi def link vimAutoSet vimCommand 561hi def link vimBehave vimCommand 562hi def link vimCommentString vimString 563hi def link vimCondHL vimCommand 564hi def link vimEchoHLNone vimGroup 565hi def link vimEchoHL vimCommand 566hi def link vimElseif vimCondHL 567hi def link vimFgBgAttrib vimHiAttrib 568hi def link vimFTCmd vimCommand 569hi def link vimFTOption vimSynType 570hi def link vimFuncKey vimCommand 571hi def link vimGroupAdd vimSynOption 572hi def link vimGroupRem vimSynOption 573hi def link vimHiCtermFgBg vimHiTerm 574hi def link vimHiCTerm vimHiTerm 575hi def link vimHighlight vimCommand 576hi def link vimHiGroup vimGroupName 577hi def link vimHiGuiFgBg vimHiTerm 578hi def link vimHiGuiFont vimHiTerm 579hi def link vimHiGuiRgb vimNumber 580hi def link vimHiGui vimHiTerm 581hi def link vimHiStartStop vimHiTerm 582hi def link vimHLGroup vimGroup 583hi def link vimInsert vimString 584hi def link vimKeyCode vimSpecFile 585hi def link vimLet vimCommand 586hi def link vimLineComment vimComment 587hi def link vimMapBang vimCommand 588hi def link vimMapModKey vimFuncSID 589hi def link vimMapMod vimBracket 590hi def link vimMap vimCommand 591hi def link vimMarkNumber vimNumber 592hi def link vimMenuMod vimMapMod 593hi def link vimMenuNameMore vimMenuName 594hi def link vimMtchComment vimComment 595hi def link vimNotFunc vimCommand 596hi def link vimNotPatSep vimString 597hi def link vimPatSepErr vimPatSep 598hi def link vimPatSepZone vimString 599hi def link vimPlainMark vimMark 600hi def link vimPlainRegister vimRegister 601hi def link vimSetMod vimOption 602hi def link vimSetString vimString 603hi def link vimSpecFileMod vimSpecFile 604hi def link vimStringCont vimString 605hi def link vimSubstTwoBS vimString 606hi def link vimSubst vimCommand 607hi def link vimSyncGroupName vimGroupName 608hi def link vimSyncGroup vimGroupName 609hi def link vimSynContains vimSynOption 610hi def link vimSynKeyContainedin vimSynContains 611hi def link vimSynKeyOpt vimSynOption 612hi def link vimSynMtchGrp vimSynOption 613hi def link vimSynMtchOpt vimSynOption 614hi def link vimSynNextgroup vimSynOption 615hi def link vimSynNotPatRange vimSynRegPat 616hi def link vimSynPatRange vimString 617hi def link vimSynRegOpt vimSynOption 618hi def link vimSynRegPat vimString 619hi def link vimSyntax vimCommand 620hi def link vimSynType vimSpecial 621hi def link vimUserAttrbCmplt vimSpecial 622hi def link vimUserAttrbKey vimOption 623hi def link vimUserAttrb vimSpecial 624hi def link vimUserCommand vimCommand 625hi def link vimUserFunc Normal 626 627hi def link vimAutoEvent Type 628hi def link vimBracket Delimiter 629hi def link vimCmplxRepeat SpecialChar 630hi def link vimCommand Statement 631hi def link vimComment Comment 632hi def link vimCommentTitle PreProc 633hi def link vimContinue Special 634hi def link vimCtrlChar SpecialChar 635hi def link vimElseIfErr Error 636hi def link vimEnvvar PreProc 637hi def link vimError Error 638hi def link vimFold Folded 639hi def link vimFuncName Function 640hi def link vimFuncSID Special 641hi def link vimFuncVar Identifier 642hi def link vimGroup Type 643hi def link vimGroupSpecial Special 644hi def link vimHLMod PreProc 645hi def link vimHiAttrib PreProc 646hi def link vimHiTerm Type 647hi def link vimKeyword Statement 648hi def link vimMark Number 649hi def link vimMenuName PreProc 650hi def link vimNotation Special 651hi def link vimNumber Number 652hi def link vimOper Operator 653hi def link vimOption PreProc 654hi def link vimOperError Error 655hi def link vimPatSep SpecialChar 656hi def link vimPattern Type 657hi def link vimRegister SpecialChar 658hi def link vimScriptDelim Comment 659hi def link vimSep Delimiter 660hi def link vimSetSep Statement 661hi def link vimSpecFile Identifier 662hi def link vimSpecial Type 663hi def link vimStatement Statement 664hi def link vimString String 665hi def link vimSubstDelim Delimiter 666hi def link vimSubstFlags Special 667hi def link vimSubstSubstr SpecialChar 668hi def link vimSynCase Type 669hi def link vimSynCaseError Error 670hi def link vimSynError Error 671hi def link vimSynOption Special 672hi def link vimSynReg Type 673hi def link vimSyncC Type 674hi def link vimSyncError Error 675hi def link vimSyncKey Type 676hi def link vimSyncNone Type 677hi def link vimTodo Todo 678hi def link vimUserCmdError Error 679 680" Current Syntax Variable: {{{2 681let b:current_syntax = "vim" 682" vim:ts=18 fdm=marker 683