forked from gsygsygsyd/backup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshBrushVim.js
227 lines (225 loc) · 17.6 KB
/
shBrushVim.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* @version
* 2.0.287 (February 06 2009)
*
* @author
* Alex Gorbatchev
*
* @copyright
* Copyright (C) 2004-2009 Alex Gorbatchev.
*
* Licensed under a GNU Lesser General Public License.
* http://creativecommons.org/licenses/LGPL/2.1/
*
* SyntaxHighlighter is donationware. You are allowed to download, modify and distribute
* the source code in accordance with LGPL 2.1 license, however if you want to use
* SyntaxHighlighter on your site or include it in your product, you must donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*/
/**
* If you use the Vim brush please give credit where credit is due by leaving
* this and the above comments in
*
* Vim Brush
* @author Shawn Biddle http://www.shawnbiddle.com/
*/
SyntaxHighlighter.brushes.Vim = function()
{
var keywords = 'ab abbreviate abc abclear abo aboveleft al all arga argadd argd argdelete' +
'argdo arge argedit argg argglobal argl arglocal ar args argu argument as' +
'ascii bad badd ba ball bd bdelete be bel belowright bf bfirst bl blast bm' +
'bmodified bn bnext bN bNext bo botright bp bprevious brea break breaka' +
'breakadd breakd breakdel breakl breaklist br brewind bro browse bufdo b' +
'buffer buffers bun bunload bw bwipeout ca cabbrev cabc cabclear caddb caddbuffer' +
'cad caddexpr caddf caddfile cal call cat catch cb cbuffer cc ccl cclose cd ce center' +
'cex cexpr cf cfile cfir cfirst cgetb cgetbuffer cgete cgetexpr cg cgetfile c change' +
'changes chd chdir che checkpath checkt checktime cla clast cl clist clo close cmapc' +
'cmapclear cnew cnewer cn cnext cN cNext cnf cnfile cNfcNfile cnorea cnoreabbrev col' +
'colder colo colorscheme comc comclear comp compiler conf confirm con continue cope copen' +
'co copy cpf cpfile cp cprevious cq cquit cr crewind cuna cunabbrev cu cunmap cw' +
'cwindow debugg debuggreedy delc delcommand d delete delf delfunction delm' +
'delmarks diffg diffget diffoff diffpatch diffpu diffput diffsplit diffthis diffu' +
'diffupdate dig digraphs di display dj djump dl dlist dr drop ds dsearch dsp' +
'dsplit earlier echoe echoerr echom echomsg echon e edit el else elsei elseif em' +
'emenu emenu* endfo endfor endf endfunction endfun en endif endt endtry endw endwhile' +
'ene enew ex exi exit exu exusage f file files filetype fina finally fin find' +
'fini finish fir first fix fixdel fo fold foldc foldclose folddoc folddoclosed' +
'foldd folddoopen foldo foldopen for fu fun function go goto gr grep grepa grepadd ha' +
'hardcopy h help helpf helpfind helpg helpgrep helpt helptags hid hide his' +
'history ia iabbrev iabc iabclear if ij ijump il ilist imapc imapclear inorea' +
'inoreabbrev is isearch isp isplit iuna iunabbrev iu iunmap j join ju jumps k' +
'keepalt keepj keepjumps kee keepmarks laddb laddbuffer lad laddexpr laddf' +
'laddfile lan language la last later lb lbuffer lc lcd lch lchdir lcl lclose let ' +
'left lefta leftabove lex lexpr lf lfile lfir lfirst lgetb lgetbuffer lgete' +
'lgetexpr lg lgetfile lgr lgrep lgrepa lgrepadd lh lhelpgrep l list ll lla llast' +
'lli llist lmak lmake lm lmap lmapc lmapclear lnew lnewer lne lnext lN lNext lnf' +
'lnfile lNf lNfile ln lnoremap lo loadview loc lockmarks lockv lockvar lol lolder' +
'lop lopen lpf lpfile lp lprevious lr lrewind ls lt ltag lu lunmap lv lvimgrep' +
'lvimgrepa lvimgrepadd lw lwindow mak make ma mark marks mat match menut' +
'menutranslate mk mkexrc mks mksession mksp mkspell mkvie mkview mkv mkvimrc mod' +
'mode m move mzf mzfile mz mzscheme nbkey new n next N Next nmapc nmapclear noh' +
'nohlsearch norea noreabbrev nu number nun nunmap omapc omapclear on only o open' +
'opt options ou ounmap pc pclose ped pedit pe perl perld perldo po pop popu popu' +
'popup pp ppop pre preserve prev previous p print P Print profd profdel prof' +
'profile promptf promptfind promptr promptrepl ps psearch pta ptag ptf ptfirst' +
'ptj ptjump ptl ptlast ptn ptnext ptN ptNext ptp ptprevious ptr ptrewind pts' +
'ptselect pu put pw pwd pyf pyfile py python qa qall q quit quita quitall r read' +
'rec recover redi redir red redo redr redraw redraws redrawstatus reg registers' +
'res resize ret retab retu return rew rewind ri right rightb rightbelow rub ruby' +
'rubyd rubydo rubyf rubyfile ru runtime rv rviminfo sal sall san sandbox sa' +
'sargument sav saveas sba sball sbf sbfirst sbl sblast sbm sbmodified sbn sbnext' +
'sbN sbNext sbp sbprevious sbr sbrewind sb sbuffer scripte scriptencoding scrip' +
'scriptnames se set setf setfiletype setg setglobal setl setlocal sf sfind sfir' +
'sfirst sh shell sign sil silent sim simalt sla slast sl sleep sm smagic sm smap' +
'smapc smapclear sme smenu sn snext sN sNext sni sniff sno snomagic snor snoremap' +
'snoreme snoremenu sor sort so source spelld spelldump spe spellgood spelli' +
'spellinfo spellr spellrepall spellu spellundo spellw spellwrong sp split spr' +
'sprevious sre srewind sta stag startg startgreplace star startinsert startr' +
'startreplace stj stjump st stop stopi stopinsert sts stselect sun sunhide sunm' +
'sunmap sus suspend sv sview syncbind t tab tabc tabclose tabd tabdo tabe tabedit' +
'tabf tabfind tabfir tabfirst tabl tablast tabm tabmove tabnew tabn tabnext tabN' +
'tabNext tabo tabonly tabp tabprevious tabr tabrewind tabs ta tag tags tc tcl' +
'tcld tcldo tclf tclfile te tearoff tf tfirst th throw tj tjump tl tlast tm tm' +
'tmenu tn tnext tN tNext to topleft tp tprevious tr trewind try ts tselect tu tu' +
'tunmenu una unabbreviate u undo undoj undojoin undol undolist unh unhide unlo' +
'unlockvar unm unmap up update verb verbose ve version vert vertical vie view vim' +
'vimgrep vimgrepa vimgrepadd vi visual viu viusage vmapc vmapclear vne vnew vs' +
'vsplit vu vunmap wa wall wh while winc wincmd windo winp winpos win winsize wn' +
'wnext wN wNext wp wprevious wq wqa wqall w write ws wsverb wv wviminfo X xa xall' +
'x xit xm xmap xmapc xmapclear xme xmenu XMLent XMLns xn xnoremap xnoreme' +
'xnoremenu xu xunmap y yank'
;
var commands = 'autocmd 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 balloonexpr bdir bdlay beval bex bexpr 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 completeopt confirm consk conskey copyindent cot cp cpo cpoptions' +
'cpt cscopepathcomp cscopeprg cscopequickfix cscopetag cscopetagorder' +
'cscopeverbose cspc csprg csqf cst csto csverb cuc cul cursorcolumn cursorline' +
'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 fex ff ffs fileencoding' +
'fileencodings fileformat fileformats fillchars fk fkmap flp fml fmr fo' +
'foldclose foldcolumn foldenable foldexpr foldignore foldlevel foldlevelstart' +
'foldmarker foldmethod foldminlines foldnestmax foldopen foldtext formatexpr' +
'formatlistpat formatoptions formatprg fp fs fsync ft gcr gd gdefault gfm gfn gfs' +
'gfw ghr go gp grepformat grepprg gtl gtt guicursor guifont guifontset' +
'guifontwide guiheadroom guioptions guipty guitablabel guitabtooltip 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 macatsui magic makeef makeprg mat matchpairs matchtime maxcombine' +
'maxfuncdepth maxmapdepth maxmem maxmempattern maxmemtot mco mef menuitems mfd mh' +
'mis mkspellmem ml mls mm mmd mmp mmt mod modeline modelines modifiable modified' +
'more mouse mousef mousefocus mousehide mousem mousemodel mouses mouseshape' +
'mouset mousetime mp mps msm mzq mzquantum nf nrformats nu number numberwidth nuw' +
'odev oft ofu omnifunc opendevice operatorfunc opfunc osfiletype pa para' +
'paragraphs paste pastetoggle patchexpr patchmode path pdev penc pex pexpr pfn ph' +
'pheader pi pm pmbcs pmbfn popt preserveindent previewheight previewwindow' +
'printdevice printencoding printexpr printfont printheader printmbcharset' +
'printmbfont printoptions prompt pt pumheight 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 shelltemp shelltype shellxquote shiftround shiftwidth shm shortmess' +
'shortname showbreak showcmd showfulltag showmatch showmode showtabline shq si' +
'sidescroll sidescrolloff siso sj slm sm smartcase smartindent smarttab smc smd' +
'sn so softtabstop sol sp spc spell spellcapcheck spellfile spelllang' +
'spellsuggest spf spl splitbelow splitright spr sps sr srr ss ssl ssop st sta' +
'stal startofline statusline stl stmp sts su sua suffixes suffixesadd sw swapfile' +
'swapsync swb swf switchbuf sws sxq syn synmaxcol syntax ta tabline tabpagemax' +
'tabstop tag tagbsearch taglength tagrelative tags tagstack tal 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 tpm 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 verbosefile vfile vi viewdir' +
'viewoptions viminfo virtualedit visualbell vop wa wak warn wb wc wcm wd' +
'weirdinvert wfh wfw wh whichwrap wi wig wildchar wildcharm wildignore wildmenu' +
'wildmode wildoptions wim winaltkeys window winfixheight winfixwidth winheight' +
'winminheight winminwidth winwidth wiv wiw wm wmh wmnu wmw wop wrap wrapmargin' +
'wrapscan write writeany writebackup writedelay ws ww 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 nocuc' +
'nocul nocursorcolumn nocursorline 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 nomacatsui nomagic' +
'nomh noml nomod nomodeline nomodifiable nomodified nomore nomousef nomousefocus' +
'nomousehide nonu nonumber noodev noopendevice nopaste nopi nopreserveindent' +
'nopreviewwindow noprompt nopvw noreadonly noremap norestorescreen norevins nori' +
'norightleft norightleftcmd norl norlc noro nors noru noruler nosb nosc noscb' +
'noscrollbind noscs nosecure nosft noshellslash noshelltemp noshiftround' +
'noshortname noshowcmd noshowfulltag noshowmatch noshowmode nosi nosm nosmartcase' +
'nosmartindent nosmarttab nosmd nosn nosol nospell nosplitbelow nosplitright' +
'nospr nosr nossl nosta nostartofline nostmp 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 nowfw nowildmenu nowinfixheight nowinfixwidth nowiv nowmnu nowrap' +
'nowrapscan nowrite nowriteany nowritebackup nows 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 invcuc invcul' +
'invcursorcolumn invcursorline 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 invmacatsui invmagic invmh invml invmod' +
'invmodeline invmodifiable invmodified invmore invmousef invmousefocus' +
'invmousehide invnu invnumber invodev invopendevice invpaste invpi' +
'invpreserveindent invpreviewwindow invprompt invpvw invreadonly invremap' +
'invrestorescreen invrevins invri invrightleft invrightleftcmd invrl invrlc invro' +
'invrs invru invruler invsb invsc invscb invscrollbind invscs invsecure invsft' +
'invshellslash invshelltemp invshiftround invshortname invshowcmd invshowfulltag' +
'invshowmatch invshowmode invsi invsm invsmartcase invsmartindent invsmarttab' +
'invsmd invsn invsol invspell invsplitbelow invsplitright invspr invsr invssl' +
'invsta invstartofline invstmp 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 invwfw invwildmenu invwinfixheight' +
'invwinfixwidth invwiv invwmnu invwrap invwrapscan invwrite invwriteany' +
'invwritebackup invws t_AB t_AF t_al t_AL t_bc t_cd t_ce t_Ce t_cl t_cm t_Co t_cs' +
't_Cs t_CS t_CV t_da t_db t_dl t_DL t_EI 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_SI 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 '
;
this.regexList = [
{ regex: /^\s*\".*$/gm, css: 'comments' }, // one line comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
{ regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' }, // keywords
{ regex: new RegExp(this.getKeywords(commands), 'gmi'), css: 'functions' } // commands
];
}
SyntaxHighlighter.brushes.Vim.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.Vim.aliases = ['vim', 'Vim'];