|
| 1 | +" Vim syntax file |
| 2 | +" Language: VIMperator configuration file |
| 3 | +" Maintainer: Doug Kearns <[email protected]> |
| 4 | +" Last Change: 2008 Jan 22 |
| 5 | + |
| 6 | +if exists("b:current_syntax") |
| 7 | + finish |
| 8 | +endif |
| 9 | + |
| 10 | +let s:cpo_save = &cpo |
| 11 | +set cpo&vim |
| 12 | + |
| 13 | +syn include @javascriptTop syntax/javascript.vim |
| 14 | +unlet b:current_syntax |
| 15 | + |
| 16 | +syn include @cssTop syntax/css.vim |
| 17 | +unlet b:current_syntax |
| 18 | + |
| 19 | +syn match vimperatorCommandStart "\%(^\s*:\=\)\@<=" nextgroup=vimperatorCommand,vimperatorAutoCmd |
| 20 | + |
| 21 | +syn keyword vimperatorCommand ab[breviate] ab[clear] addo[ns] bN[ext] b[uffer] ba[ck] bd[elete] beep bf[irst] bl[ast] bma[rk] |
| 22 | + \ bmarks bn[ext] bp[revious] br[ewind] buffers bun[load] bw[ipeout] ca[bbrev] cabc[lear] cd chd[ir] cm[ap] cmapc[lear] |
| 23 | + \ cno[remap] colo[rscheme] com[mand] comc[lear] cu[nmap] cuna[bbrev] delbm[arks] delc[ommand] delm[arks] delmac[ros] |
| 24 | + \ delqm[arks] dels[tyle] dia[log] dl do[autocmd] doautoa[ll] downl[oads] e[dit] ec[ho] echoe[rr] echom[sg] em[enu] exe[cute] |
| 25 | + \ exu[sage] files fini[sh] fo[rward] fw h[elp] ha[rdcopy] hi[ghlight] hist[ory] hs ia[bbrev] iabc[lear] im[ap] imapc[lear] |
| 26 | + \ ino[remap] iu[nmap] iuna[bbrev] javas[cript] js ju[mps] let loadplugins lpl ls ma[rk] macros map mapc[lear] marks mes[sages] |
| 27 | + \ mkv[imperatorrc] no[remap] noh[lsearch] norm[al] o[pen] optionu[sage] pa[geinfo] pagest[yle] pc[lose] pl[ay] pref[erences] |
| 28 | + \ prefs pw[d] q[uit] qa[ll] qma[rk] qmarks quita[ll] re[draw] re[load] reloada[ll] res[tart] run runt[ime] sav[eas] sb[ar] |
| 29 | + \ sb[open] sbcl[ose] scrip[tnames] se[t] setg[lobal] setl[ocal] sideb[ar] so[urce] st[op] sty[le] tN[ext] t[open] tab |
| 30 | + \ tabN[ext] tabc[lose] tabd[uplicate] tabde[tach] tabe[dit] tabfir[st] tabl[ast] tabm[ove] tabn[ext] tabnew tabo[nly] tabopen |
| 31 | + \ tabp[revious] tabr[ewind] tabs time tn[ext] tp[revious] u[ndo] una[bbreviate] undoa[ll] unl[et] unm[ap] ve[rsion] |
| 32 | + \ vie[wsource] viu[sage] w[rite] wc[lose] win[open] winc[lose] wine[dit] wo[pen] wq wqa[ll] xa[ll] zo[om] |
| 33 | + \ contained |
| 34 | +
|
| 35 | +syn match vimperatorCommand "!" contained |
| 36 | + |
| 37 | +syn keyword vimperatorAutoCmd au[tocmd] contained nextgroup=vimperatorAutoEventList skipwhite |
| 38 | + |
| 39 | +syn keyword vimperatorAutoEvent BookmarkAdd DOMLoad LocationChange PageLoadPre PageLoad ShellCmdPost VimperatorEnter |
| 40 | + \ VimperatorLeavePre VimperatorLeave |
| 41 | + \ contained |
| 42 | + |
| 43 | +syn match vimperatorAutoEventList "\(\a\+,\)*\a\+" contained contains=vimperatorAutoEvent |
| 44 | + |
| 45 | +syn region vimperatorSet matchgroup=vimperatorCommand start="\%(^\s*:\=\)\@<=\<\%(setl\%[ocal]\|setg\%[lobal]\|set\=\)\=\>" |
| 46 | + \ end="$" keepend oneline contains=vimperatorOption,vimperatorString |
| 47 | + |
| 48 | +syn keyword vimperatorOption activate act cdpath cd complete cpt defsearch ds editor eventignore ei extendedhinttags eht |
| 49 | + \ followhints fh guioptions go helpfile hf hintmatching hm hinttags ht hinttimeout hto history hi laststatus ls messages msgs |
| 50 | + \ newtab nextpattern pageinfo pa popups pps previouspattern runtimepath rtp scroll scr shell sh shellcmdflag shcf |
| 51 | + \ showstatuslinks ssli showtabline stal suggestengines t_vb titlestring urlseparator verbose vbs wildcase wic wildignore wig |
| 52 | + \ wildmode wim wildoptions wop wordseparators wsp |
| 53 | + \ contained nextgroup=vimperatorSetMod |
| 54 | + |
| 55 | +" toggle options |
| 56 | +syn match vimperatorOption "\<\%(no\|inv\)\=\%(errorbells\|eb\|exrc\|ex\|focuscontent\|fc\|fullscreen\|fs\|ignorecase\|ic\)\>!\=" |
| 57 | + \ contained nextgroup=vimperatorSetMod |
| 58 | +syn match vimperatorOption "\<\%(no\|inv\)\=\%(incsearch\|is\|insertmode\|im\|hlsearch\|hls\|linksearch\|lks\)\>!\=" |
| 59 | + \ contained nextgroup=vimperatorSetMod |
| 60 | +syn match vimperatorOption "\<\%(no\|inv\)\=\%(loadplugins\|lpl\|more\|online\|preload\|showmode\|smd\|smartcase\|scs\)\>!\=" |
| 61 | + \ contained nextgroup=vimperatorSetMod |
| 62 | +syn match vimperatorOption "\<\%(no\|inv\)\=\%(online\|visualbell\|vb\|usermode\|um\)\>!\=" |
| 63 | + \ contained nextgroup=vimperatorSetMod |
| 64 | + |
| 65 | +syn match vimperatorSetMod "\%(\<[a-z_]\+\)\@<=&" contained |
| 66 | + |
| 67 | +syn region vimperatorJavaScript start="\%(^\s*\%(javascript\|js\)\s\+\)\@<=" end="$" contains=@javascriptTop keepend oneline |
| 68 | +syn region vimperatorJavaScript matchgroup=vimperatorJavascriptDelimiter |
| 69 | + \ start="\%(^\s*\%(javascript\|js\)\s\+\)\@<=<<\s*\z(\h\w*\)"hs=s+2 end="^\z1$" contains=@javascriptTop fold |
| 70 | + |
| 71 | +let s:cssRegionStart = '\%(^\s*sty\%[le]!\=\s\+\%(-\%(n\|name\)\%(\s\+\|=\)\S\+\s\+\)\=[^-]\S\+\s\+\)\@<=' |
| 72 | +execute 'syn region vimperatorCss start="' . s:cssRegionStart . '" end="$" contains=@cssTop keepend oneline' |
| 73 | +execute 'syn region vimperatorCss matchgroup=vimperatorCssDelimiter' |
| 74 | + \ 'start="' . s:cssRegionStart . '<<\s*\z(\h\w*\)"hs=s+2 end="^\z1$" contains=@cssTop fold' |
| 75 | + |
| 76 | +syn match vimperatorNotation "<[0-9A-Za-z-]\+>" |
| 77 | + |
| 78 | +syn match vimperatorComment +".*$+ contains=vimperatorTodo,@Spell |
| 79 | +syn keyword vimperatorTodo FIXME NOTE TODO XXX contained |
| 80 | + |
| 81 | +syn region vimperatorString start="\z(["']\)" end="\z1" skip="\\\\\|\\\z1" oneline |
| 82 | + |
| 83 | +syn match vimperatorLineComment +^\s*".*$+ contains=vimperatorTodo,@Spell |
| 84 | + |
| 85 | +" NOTE: match vim.vim highlighting group names |
| 86 | +hi def link vimperatorAutoCmd vimperatorCommand |
| 87 | +hi def link vimperatorAutoEvent Type |
| 88 | +hi def link vimperatorCommand Statement |
| 89 | +hi def link vimperatorComment Comment |
| 90 | +hi def link vimperatorJavascriptDelimiter Delimiter |
| 91 | +hi def link vimperatorCssDelimiter Delimiter |
| 92 | +hi def link vimperatorNotation Special |
| 93 | +hi def link vimperatorLineComment Comment |
| 94 | +hi def link vimperatorOption PreProc |
| 95 | +hi def link vimperatorSetMod vimperatorOption |
| 96 | +hi def link vimperatorString String |
| 97 | +hi def link vimperatorTodo Todo |
| 98 | + |
| 99 | +let b:current_syntax = "vimperator" |
| 100 | + |
| 101 | +let &cpo = s:cpo_save |
| 102 | +unlet s:cpo_save |
| 103 | + |
| 104 | +" vim: tw=130 et ts=4 sw=4: |
0 commit comments