From a1c96bff9d50a78c436203124a29da1e85cc169a Mon Sep 17 00:00:00 2001 From: Samuel Flores Date: Tue, 31 Jul 2012 22:09:13 -0300 Subject: [PATCH 1/5] Added Support to Ruby Language --- prism-dark.css | 12 ++++++++---- prism-funky.css | 10 +++++++--- prism.css | 12 ++++++++---- prism.js | 21 ++++++++++++++++++++- 4 files changed, 43 insertions(+), 12 deletions(-) diff --git a/prism-dark.css b/prism-dark.css index 44b7b730d2..cc3fc1eee8 100644 --- a/prism-dark.css +++ b/prism-dark.css @@ -13,11 +13,11 @@ pre[class*="language-"] { text-align: left; white-space: pre; word-spacing: normal; - + -moz-tab-size: 4; -o-tab-size: 4; tab-size: 4; - + -webkit-hyphens: none; -moz-hyphens: none; -ms-hyphens: none; @@ -33,7 +33,7 @@ pre[class*="language-"], pre[class*="language-"] { padding: 1em; margin: .5em 0; - overflow: auto; + overflow: auto; border: .3em solid hsl(30,20%,40%); border-radius: .5em; box-shadow: 1px 1px .5em black inset; @@ -63,6 +63,8 @@ pre[class*="language-"] { } .token.property, +.token.const, +.token.symbol, .token.tag, .token.boolean, .token.number { @@ -70,12 +72,14 @@ pre[class*="language-"] { } .token.selector, +.token.builtin, .token.attr-name, .token.string { color: hsl(75, 70%, 60%); } .token.operator, +.token.inst-var, .token.entity, .token.url, .language-css .token.string, @@ -101,4 +105,4 @@ pre[class*="language-"] { .token.entity { cursor: help; -} \ No newline at end of file +} diff --git a/prism-funky.css b/prism-funky.css index ba31709c94..a7e8c5dcc0 100644 --- a/prism-funky.css +++ b/prism-funky.css @@ -11,11 +11,11 @@ pre[class*="language-"] { text-align: left; white-space: pre; word-spacing: normal; - + -moz-tab-size: 4; -o-tab-size: 4; tab-size: 4; - + -webkit-hyphens: none; -moz-hyphens: none; -ms-hyphens: none; @@ -60,6 +60,8 @@ code[class*="language-"] { } .token.property, +.token.const, +.token.symbol, .token.tag, .token.boolean, .token.number { @@ -67,12 +69,14 @@ code[class*="language-"] { } .token.selector, +.token.builtin, .token.attr-name, .token.string { color: yellow; } .token.operator, +.token.inst-var, .token.entity, .token.url, .language-css .token.string { @@ -97,4 +101,4 @@ code[class*="language-"] { .token.entity { cursor: help; -} \ No newline at end of file +} diff --git a/prism.css b/prism.css index a74df7e0c6..1630a592c8 100644 --- a/prism.css +++ b/prism.css @@ -13,11 +13,11 @@ pre[class*="language-"] { text-align: left; white-space: pre; word-spacing: normal; - + -moz-tab-size: 4; -o-tab-size: 4; tab-size: 4; - + -webkit-hyphens: none; -moz-hyphens: none; -ms-hyphens: none; @@ -28,7 +28,7 @@ pre[class*="language-"] { pre[class*="language-"] { padding: 1em; margin: .5em 0; - overflow: auto; + overflow: auto; } :not(pre) > code[class*="language-"], @@ -58,6 +58,8 @@ pre[class*="language-"] { } .token.property, +.token.const, +.token.symbol, .token.tag, .token.boolean, .token.number { @@ -65,12 +67,14 @@ pre[class*="language-"] { } .token.selector, +.token.builtin, .token.attr-name, .token.string { color: #690; } .token.operator, +.token.inst-var, .token.entity, .token.url, .language-css .token.string, @@ -97,4 +101,4 @@ pre[class*="language-"] { .token.entity { cursor: help; -} \ No newline at end of file +} diff --git a/prism.js b/prism.js index b52f1461c5..6e4033e2d7 100644 --- a/prism.js +++ b/prism.js @@ -412,6 +412,25 @@ Prism.languages.javascript = { 'punctuation': /[{}[\];(),.:]/g }; +Prism.languages.ruby = { + 'comment': /#[^\r\n]*(\r?\n|$)/g, + 'string': /("|')(\\?.)*?\1/g, + 'regex': { + pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g, + lookbehind: true + }, + 'keyword': /\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/g, + 'builtin': /\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/, + 'boolean': /\b(true|false)\b/g, + 'number': /\b-?(0x)?\d*\.?\d+\b/g, + 'operator': /[-+]{1,2}|!|=?<|=?>|={1,2}|(&){1,2}|\|?\||\?|\*|\//g, + 'inst-var': /[@&]\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/g, + 'symbol': /:\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/g, + 'const': /\b[A-Z][a-zA-Z_0-9]*[?!]?\b/g, + 'ignore': /&(lt|gt|amp);/gi, + 'punctuation': /[{}[\];(),.:]/g +}; + if (Prism.languages.markup) { Prism.languages.insertBefore('markup', 'tag', { 'script': { @@ -425,4 +444,4 @@ if (Prism.languages.markup) { } } }); -} \ No newline at end of file +} From a202d08f5ec0a416d274b232c414e216784c6287 Mon Sep 17 00:00:00 2001 From: Samuel Flores Date: Tue, 31 Jul 2012 22:12:42 -0300 Subject: [PATCH 2/5] Added support to VIM language --- prism.js | 174 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 92 insertions(+), 82 deletions(-) diff --git a/prism.js b/prism.js index 6e4033e2d7..4d9a6966b1 100644 --- a/prism.js +++ b/prism.js @@ -1,8 +1,8 @@ -/*********************************************** - Begin prism-core.js -***********************************************/ +/*********************************************** + Begin prism-core.js +***********************************************/ /** * Prism: Lightweight, robust, elegant syntax highlighting @@ -21,32 +21,32 @@ var _ = self.Prism = { root = root || _.languages; var grammar = root[inside]; var ret = {}; - + for (var token in grammar) { - + if (grammar.hasOwnProperty(token)) { - + if (token == before) { - + for (var newToken in insert) { - + if (insert.hasOwnProperty(newToken)) { ret[newToken] = insert[newToken]; } } } - + ret[token] = grammar[token]; } } - + return root[inside] = ret; }, - + DFS: function(o, callback) { for (var i in o) { callback.call(o, i, o[i]); - + if (Object.prototype.toString.call(o) === '[object Object]') { _.languages.DFS(o[i], callback); } @@ -61,15 +61,15 @@ var _ = self.Prism = { _.highlightElement(element, async === true, callback); } }, - + highlightElement: function(element, async, callback) { // Find language var language, grammar, parent = element; - + while (parent && !lang.test(parent.className)) { parent = parent.parentNode; } - + if (parent) { language = (parent.className.match(lang) || [,''])[1]; grammar = _.languages[language]; @@ -78,48 +78,48 @@ var _ = self.Prism = { if (!grammar) { return; } - + // Set language on the element, if not present element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language; - + // Set language on the parent, for styling parent = element.parentNode; - + if (/pre/i.test(parent.nodeName)) { - parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language; + parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language; } var code = element.textContent.trim(); - + if(!code) { return; } - + code = code.replace(/&/g, '&').replace(//g, '>').replace(/\u00a0/g, ' '); //console.time(code.slice(0,50)); - + var env = { element: element, language: language, grammar: grammar, code: code }; - + _.hooks.run('before-highlight', env); - + if (async && self.Worker) { - var worker = new Worker(_.filename); - + var worker = new Worker(_.filename); + worker.onmessage = function(evt) { env.highlightedCode = Token.stringify(JSON.parse(evt.data)); env.element.innerHTML = env.highlightedCode; - + callback && callback.call(env.element); //console.timeEnd(code.slice(0,50)); _.hooks.run('after-highlight', env); }; - + worker.postMessage(JSON.stringify({ language: env.language, code: env.code @@ -128,61 +128,61 @@ var _ = self.Prism = { else { env.highlightedCode = _.highlight(env.code, env.grammar) env.element.innerHTML = env.highlightedCode; - + callback && callback.call(element); - + _.hooks.run('after-highlight', env); //console.timeEnd(code.slice(0,50)); } }, - + highlight: function (text, grammar) { return Token.stringify(_.tokenize(text, grammar)); }, - + tokenize: function(text, grammar) { var Token = _.Token; - + var strarr = [text]; - + var rest = grammar.rest; - + if (rest) { for (var token in rest) { grammar[token] = rest[token]; } - + delete grammar.rest; } - + tokenloop: for (var token in grammar) { if(!grammar.hasOwnProperty(token) || !grammar[token]) { continue; } - - var pattern = grammar[token], + + var pattern = grammar[token], inside = pattern.inside, lookbehind = !!pattern.lookbehind || 0; - + pattern = pattern.pattern || pattern; - + for (var i=0; i text.length) { // Something went terribly wrong, ABORT, ABORT! break tokenloop; } - + if (str instanceof Token) { continue; } - + pattern.lastIndex = 0; - + var match = pattern.exec(str); - + if (match) { if(lookbehind) { lookbehind = match[1].length; @@ -193,22 +193,22 @@ var _ = self.Prism = { len = match.length, to = from + len, before = str.slice(0, from + 1), - after = str.slice(to + 1); + after = str.slice(to + 1); var args = [i, 1]; - + if (before) { args.push(before); } - + var wrapped = new Token(token, inside? _.tokenize(match, inside) : match); - + args.push(wrapped); - + if (after) { args.push(after); } - + Array.prototype.splice.apply(strarr, args); } } @@ -216,25 +216,25 @@ var _ = self.Prism = { return strarr; }, - + hooks: { all: {}, - + add: function (name, callback) { var hooks = _.hooks.all; - + hooks[name] = hooks[name] || []; - + hooks[name].push(callback); }, - + run: function (name, env) { var callbacks = _.hooks.all[name]; - + if (!callbacks || !callbacks.length) { return; } - + for (var i=0, callback; callback = callbacks[i++];) { callback(env); } @@ -251,15 +251,15 @@ Token.stringify = function(o) { if (typeof o == 'string') { return o; } - + if (Object.prototype.toString.call(o) == '[object Array]') { for (var i=0; i' + env.content + ''; - + }; if (!self.document) { @@ -290,11 +290,11 @@ if (!self.document) { var message = JSON.parse(evt.data), lang = message.language, code = message.code; - + self.postMessage(JSON.stringify(_.tokenize(code, _.languages[lang]))); self.close(); }, false); - + return; } @@ -305,7 +305,7 @@ script = script[script.length - 1]; if (script) { _.filename = script.src; - + if (document.addEventListener && !script.hasAttribute('data-manual')) { document.addEventListener('DOMContentLoaded', _.highlightAll); } @@ -313,9 +313,9 @@ if (script) { })(); -/*********************************************** - Begin prism-markup.js -***********************************************/ +/*********************************************** + Begin prism-markup.js +***********************************************/ Prism.languages.markup = { 'comment': /<!--[\w\W]*?--(>|>)/g, @@ -345,7 +345,7 @@ Prism.languages.markup = { 'namespace': /^[\w-]+?:/ } } - + } }, 'entity': /&#?[\da-z]{1,8};/gi @@ -359,9 +359,9 @@ Prism.hooks.add('wrap', function(env) { } }); -/*********************************************** - Begin prism-css.js -***********************************************/ +/*********************************************** + Begin prism-css.js +***********************************************/ Prism.languages.css = { 'comment': /\/\*[\w\W]*?\*\//g, @@ -390,9 +390,9 @@ if (Prism.languages.markup) { }); } -/*********************************************** - Begin prism-javascript.js -***********************************************/ +/*********************************************** + Begin prism-javascript.js +***********************************************/ Prism.languages.javascript = { 'comment': { @@ -431,6 +431,16 @@ Prism.languages.ruby = { 'punctuation': /[{}[\];(),.:]/g }; +Prism.languages.vim = { + 'string': /("|')(\\?.)*?\1/g, + 'comment': /("+[^"\r\n]*|^".*)(\r?\n|$)/g, + 'keyword': /\b(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)\b/g, + 'builtin': /\b(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)\b/, + 'number': /\b-?(0x)?\d*\.?\d+\b/g, + 'operator': /[-+]{1,2}|!|=?<|=?>|={1,2}|(&){1,2}|\|?\||\?|\*|\//g, + 'punctuation': /[{}[\];(),.:]/g +}; + if (Prism.languages.markup) { Prism.languages.insertBefore('markup', 'tag', { 'script': { From 9ebdcb9b2babcf4d3d98df5f9f8249d2cd06fa38 Mon Sep 17 00:00:00 2001 From: Samuel Flores Date: Tue, 31 Jul 2012 22:54:56 -0300 Subject: [PATCH 3/5] moved language definitions to plugins --- plugins/ruby-language/prism-ruby-language.js | 26 +++ .../ruby-language/prism-ruby-language.min.js | 1 + plugins/vim-language/prism-vim-language.js | 17 ++ .../vim-language/prism-vim-language.min.js | 1 + prism-dark.css | 22 +- prism-funky.css | 20 +- prism.css | 22 +- prism.js | 195 ++++++++---------- 8 files changed, 160 insertions(+), 144 deletions(-) create mode 100644 plugins/ruby-language/prism-ruby-language.js create mode 100644 plugins/ruby-language/prism-ruby-language.min.js create mode 100644 plugins/vim-language/prism-vim-language.js create mode 100644 plugins/vim-language/prism-vim-language.min.js diff --git a/plugins/ruby-language/prism-ruby-language.js b/plugins/ruby-language/prism-ruby-language.js new file mode 100644 index 0000000000..ab988377c8 --- /dev/null +++ b/plugins/ruby-language/prism-ruby-language.js @@ -0,0 +1,26 @@ +(function(){ + +if(!window.Prism) { + return; +} + +Prism.languages.ruby = { + 'comment': /#[^\r\n]*(\r?\n|$)/g, + 'string': /("|')(\\?.)*?\1/g, + 'regex': { + pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g, + lookbehind: true + }, + 'keyword': /\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/g, + 'builtin': /\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/, + 'boolean': /\b(true|false)\b/g, + 'number': /\b-?(0x)?\d*\.?\d+\b/g, + 'operator': /[-+]{1,2}|!|=?<|=?>|={1,2}|(&){1,2}|\|?\||\?|\*|\//g, + 'inst-var': /[@&]\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/g, + 'symbol': /:\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/g, + 'const': /\b[A-Z][a-zA-Z_0-9]*[?!]?\b/g, + 'ignore': /&(lt|gt|amp);/gi, + 'punctuation': /[{}[\];(),.:]/g +}; + +})(); \ No newline at end of file diff --git a/plugins/ruby-language/prism-ruby-language.min.js b/plugins/ruby-language/prism-ruby-language.min.js new file mode 100644 index 0000000000..82ec4c300c --- /dev/null +++ b/plugins/ruby-language/prism-ruby-language.min.js @@ -0,0 +1 @@ +(function(){if(!window.Prism){return}Prism.languages.ruby={'comment':/#[^\r\n]*(\r?\n|$)/g,'string':/("|')(\\?.)*?\1/g,'regex':{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.})]))/g,lookbehind:true},'keyword':/\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/g,'builtin':/\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,'boolean':/\b(true|false)\b/g,'number':/\b-?(0x)?\d*\.?\d+\b/g,'operator':/[-+]{1,2}|!|=?<|=?>|={1,2}|(&){1,2}|\|?\||\?|\*|\//g,'inst-var':/[@&]\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/g,'symbol':/:\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/g,'const':/\b[A-Z][a-zA-Z_0-9]*[?!]?\b/g,'ignore':/&(lt|gt|amp);/gi,'punctuation':/[{}[\];(),.:]/g}})(); \ No newline at end of file diff --git a/plugins/vim-language/prism-vim-language.js b/plugins/vim-language/prism-vim-language.js new file mode 100644 index 0000000000..94e297daf4 --- /dev/null +++ b/plugins/vim-language/prism-vim-language.js @@ -0,0 +1,17 @@ +(function(){ + +if(!window.Prism) { + return; +} + +Prism.languages.vim = { + 'string': /("|')(\\?.)*?\1/g, + 'comment': /("+[^"\r\n]*|^".*)(\r?\n|$)/g, + 'keyword': /\b(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)\b/g, + 'builtin': /\b(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)\b/, + 'number': /\b-?(0x)?\d*\.?\d+\b/g, + 'operator': /[-+]{1,2}|!|=?<|=?>|={1,2}|(&){1,2}|\|?\||\?|\*|\//g, + 'punctuation': /[{}[\];(),.:]/g +}; + +})(); \ No newline at end of file diff --git a/plugins/vim-language/prism-vim-language.min.js b/plugins/vim-language/prism-vim-language.min.js new file mode 100644 index 0000000000..32a7517ca0 --- /dev/null +++ b/plugins/vim-language/prism-vim-language.min.js @@ -0,0 +1 @@ +(function(){if(!window.Prism){return}Prism.languages.vim={'string':/("|')(\\?.)*?\1/g,'comment':/("+[^"\r\n]*|^".*)(\r?\n|$)/g,'keyword':/\b(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)\b/g,'builtin':/\b(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)\b/,'number':/\b-?(0x)?\d*\.?\d+\b/g,'operator':/[-+]{1,2}|!|=?<|=?>|={1,2}|(&){1,2}|\|?\||\?|\*|\//g,'punctuation':/[{}[\];(),.:]/g}})(); \ No newline at end of file diff --git a/prism-dark.css b/prism-dark.css index cc3fc1eee8..082555f107 100644 --- a/prism-dark.css +++ b/prism-dark.css @@ -13,11 +13,11 @@ pre[class*="language-"] { text-align: left; white-space: pre; word-spacing: normal; - + -moz-tab-size: 4; -o-tab-size: 4; tab-size: 4; - + -webkit-hyphens: none; -moz-hyphens: none; -ms-hyphens: none; @@ -33,7 +33,7 @@ pre[class*="language-"], pre[class*="language-"] { padding: 1em; margin: .5em 0; - overflow: auto; + overflow: auto; border: .3em solid hsl(30,20%,40%); border-radius: .5em; box-shadow: 1px 1px .5em black inset; @@ -63,27 +63,27 @@ pre[class*="language-"] { } .token.property, -.token.const, -.token.symbol, .token.tag, .token.boolean, -.token.number { +.token.number, +.token.const, +.token.symbol { color: hsl(350, 40%, 70%); } .token.selector, -.token.builtin, .token.attr-name, -.token.string { +.token.string, +.token.builtin { color: hsl(75, 70%, 60%); } .token.operator, -.token.inst-var, .token.entity, .token.url, .language-css .token.string, -.style .token.string { +.style .token.string, +.token.inst-var { color: hsl(40, 90%, 60%); } @@ -105,4 +105,4 @@ pre[class*="language-"] { .token.entity { cursor: help; -} +} \ No newline at end of file diff --git a/prism-funky.css b/prism-funky.css index a7e8c5dcc0..4d9f23bd47 100644 --- a/prism-funky.css +++ b/prism-funky.css @@ -11,11 +11,11 @@ pre[class*="language-"] { text-align: left; white-space: pre; word-spacing: normal; - + -moz-tab-size: 4; -o-tab-size: 4; tab-size: 4; - + -webkit-hyphens: none; -moz-hyphens: none; -ms-hyphens: none; @@ -60,26 +60,26 @@ code[class*="language-"] { } .token.property, -.token.const, -.token.symbol, .token.tag, .token.boolean, -.token.number { +.token.number, +.token.const, +.token.symbol { color: #0cf; } .token.selector, -.token.builtin, .token.attr-name, -.token.string { +.token.string, +.token.builtin { color: yellow; } .token.operator, -.token.inst-var, .token.entity, .token.url, -.language-css .token.string { +.language-css .token.string, +.token.inst-var { color: yellowgreen; } @@ -101,4 +101,4 @@ code[class*="language-"] { .token.entity { cursor: help; -} +} \ No newline at end of file diff --git a/prism.css b/prism.css index 1630a592c8..fdbc85a029 100644 --- a/prism.css +++ b/prism.css @@ -13,11 +13,11 @@ pre[class*="language-"] { text-align: left; white-space: pre; word-spacing: normal; - + -moz-tab-size: 4; -o-tab-size: 4; tab-size: 4; - + -webkit-hyphens: none; -moz-hyphens: none; -ms-hyphens: none; @@ -28,7 +28,7 @@ pre[class*="language-"] { pre[class*="language-"] { padding: 1em; margin: .5em 0; - overflow: auto; + overflow: auto; } :not(pre) > code[class*="language-"], @@ -58,27 +58,27 @@ pre[class*="language-"] { } .token.property, -.token.const, -.token.symbol, .token.tag, .token.boolean, -.token.number { +.token.number, +.token.const, +.token.symbol { color: #905; } .token.selector, -.token.builtin, .token.attr-name, -.token.string { +.token.string, +.token.builtin { color: #690; } .token.operator, -.token.inst-var, .token.entity, .token.url, .language-css .token.string, -.style .token.string { +.style .token.string, +.token.inst-var { color: #a67f59; background: hsla(0,0%,100%,.5); } @@ -101,4 +101,4 @@ pre[class*="language-"] { .token.entity { cursor: help; -} +} \ No newline at end of file diff --git a/prism.js b/prism.js index 4d9a6966b1..b52f1461c5 100644 --- a/prism.js +++ b/prism.js @@ -1,8 +1,8 @@ -/*********************************************** - Begin prism-core.js -***********************************************/ +/*********************************************** + Begin prism-core.js +***********************************************/ /** * Prism: Lightweight, robust, elegant syntax highlighting @@ -21,32 +21,32 @@ var _ = self.Prism = { root = root || _.languages; var grammar = root[inside]; var ret = {}; - + for (var token in grammar) { - + if (grammar.hasOwnProperty(token)) { - + if (token == before) { - + for (var newToken in insert) { - + if (insert.hasOwnProperty(newToken)) { ret[newToken] = insert[newToken]; } } } - + ret[token] = grammar[token]; } } - + return root[inside] = ret; }, - + DFS: function(o, callback) { for (var i in o) { callback.call(o, i, o[i]); - + if (Object.prototype.toString.call(o) === '[object Object]') { _.languages.DFS(o[i], callback); } @@ -61,15 +61,15 @@ var _ = self.Prism = { _.highlightElement(element, async === true, callback); } }, - + highlightElement: function(element, async, callback) { // Find language var language, grammar, parent = element; - + while (parent && !lang.test(parent.className)) { parent = parent.parentNode; } - + if (parent) { language = (parent.className.match(lang) || [,''])[1]; grammar = _.languages[language]; @@ -78,48 +78,48 @@ var _ = self.Prism = { if (!grammar) { return; } - + // Set language on the element, if not present element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language; - + // Set language on the parent, for styling parent = element.parentNode; - + if (/pre/i.test(parent.nodeName)) { - parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language; + parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language; } var code = element.textContent.trim(); - + if(!code) { return; } - + code = code.replace(/&/g, '&').replace(//g, '>').replace(/\u00a0/g, ' '); //console.time(code.slice(0,50)); - + var env = { element: element, language: language, grammar: grammar, code: code }; - + _.hooks.run('before-highlight', env); - + if (async && self.Worker) { - var worker = new Worker(_.filename); - + var worker = new Worker(_.filename); + worker.onmessage = function(evt) { env.highlightedCode = Token.stringify(JSON.parse(evt.data)); env.element.innerHTML = env.highlightedCode; - + callback && callback.call(env.element); //console.timeEnd(code.slice(0,50)); _.hooks.run('after-highlight', env); }; - + worker.postMessage(JSON.stringify({ language: env.language, code: env.code @@ -128,61 +128,61 @@ var _ = self.Prism = { else { env.highlightedCode = _.highlight(env.code, env.grammar) env.element.innerHTML = env.highlightedCode; - + callback && callback.call(element); - + _.hooks.run('after-highlight', env); //console.timeEnd(code.slice(0,50)); } }, - + highlight: function (text, grammar) { return Token.stringify(_.tokenize(text, grammar)); }, - + tokenize: function(text, grammar) { var Token = _.Token; - + var strarr = [text]; - + var rest = grammar.rest; - + if (rest) { for (var token in rest) { grammar[token] = rest[token]; } - + delete grammar.rest; } - + tokenloop: for (var token in grammar) { if(!grammar.hasOwnProperty(token) || !grammar[token]) { continue; } - - var pattern = grammar[token], + + var pattern = grammar[token], inside = pattern.inside, lookbehind = !!pattern.lookbehind || 0; - + pattern = pattern.pattern || pattern; - + for (var i=0; i text.length) { // Something went terribly wrong, ABORT, ABORT! break tokenloop; } - + if (str instanceof Token) { continue; } - + pattern.lastIndex = 0; - + var match = pattern.exec(str); - + if (match) { if(lookbehind) { lookbehind = match[1].length; @@ -193,22 +193,22 @@ var _ = self.Prism = { len = match.length, to = from + len, before = str.slice(0, from + 1), - after = str.slice(to + 1); + after = str.slice(to + 1); var args = [i, 1]; - + if (before) { args.push(before); } - + var wrapped = new Token(token, inside? _.tokenize(match, inside) : match); - + args.push(wrapped); - + if (after) { args.push(after); } - + Array.prototype.splice.apply(strarr, args); } } @@ -216,25 +216,25 @@ var _ = self.Prism = { return strarr; }, - + hooks: { all: {}, - + add: function (name, callback) { var hooks = _.hooks.all; - + hooks[name] = hooks[name] || []; - + hooks[name].push(callback); }, - + run: function (name, env) { var callbacks = _.hooks.all[name]; - + if (!callbacks || !callbacks.length) { return; } - + for (var i=0, callback; callback = callbacks[i++];) { callback(env); } @@ -251,15 +251,15 @@ Token.stringify = function(o) { if (typeof o == 'string') { return o; } - + if (Object.prototype.toString.call(o) == '[object Array]') { for (var i=0; i' + env.content + ''; - + }; if (!self.document) { @@ -290,11 +290,11 @@ if (!self.document) { var message = JSON.parse(evt.data), lang = message.language, code = message.code; - + self.postMessage(JSON.stringify(_.tokenize(code, _.languages[lang]))); self.close(); }, false); - + return; } @@ -305,7 +305,7 @@ script = script[script.length - 1]; if (script) { _.filename = script.src; - + if (document.addEventListener && !script.hasAttribute('data-manual')) { document.addEventListener('DOMContentLoaded', _.highlightAll); } @@ -313,9 +313,9 @@ if (script) { })(); -/*********************************************** - Begin prism-markup.js -***********************************************/ +/*********************************************** + Begin prism-markup.js +***********************************************/ Prism.languages.markup = { 'comment': /<!--[\w\W]*?--(>|>)/g, @@ -345,7 +345,7 @@ Prism.languages.markup = { 'namespace': /^[\w-]+?:/ } } - + } }, 'entity': /&#?[\da-z]{1,8};/gi @@ -359,9 +359,9 @@ Prism.hooks.add('wrap', function(env) { } }); -/*********************************************** - Begin prism-css.js -***********************************************/ +/*********************************************** + Begin prism-css.js +***********************************************/ Prism.languages.css = { 'comment': /\/\*[\w\W]*?\*\//g, @@ -390,9 +390,9 @@ if (Prism.languages.markup) { }); } -/*********************************************** - Begin prism-javascript.js -***********************************************/ +/*********************************************** + Begin prism-javascript.js +***********************************************/ Prism.languages.javascript = { 'comment': { @@ -412,35 +412,6 @@ Prism.languages.javascript = { 'punctuation': /[{}[\];(),.:]/g }; -Prism.languages.ruby = { - 'comment': /#[^\r\n]*(\r?\n|$)/g, - 'string': /("|')(\\?.)*?\1/g, - 'regex': { - pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g, - lookbehind: true - }, - 'keyword': /\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/g, - 'builtin': /\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/, - 'boolean': /\b(true|false)\b/g, - 'number': /\b-?(0x)?\d*\.?\d+\b/g, - 'operator': /[-+]{1,2}|!|=?<|=?>|={1,2}|(&){1,2}|\|?\||\?|\*|\//g, - 'inst-var': /[@&]\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/g, - 'symbol': /:\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/g, - 'const': /\b[A-Z][a-zA-Z_0-9]*[?!]?\b/g, - 'ignore': /&(lt|gt|amp);/gi, - 'punctuation': /[{}[\];(),.:]/g -}; - -Prism.languages.vim = { - 'string': /("|')(\\?.)*?\1/g, - 'comment': /("+[^"\r\n]*|^".*)(\r?\n|$)/g, - 'keyword': /\b(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)\b/g, - 'builtin': /\b(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)\b/, - 'number': /\b-?(0x)?\d*\.?\d+\b/g, - 'operator': /[-+]{1,2}|!|=?<|=?>|={1,2}|(&){1,2}|\|?\||\?|\*|\//g, - 'punctuation': /[{}[\];(),.:]/g -}; - if (Prism.languages.markup) { Prism.languages.insertBefore('markup', 'tag', { 'script': { @@ -454,4 +425,4 @@ if (Prism.languages.markup) { } } }); -} +} \ No newline at end of file From 710273cfc69c6698408836fd962d0676252bb972 Mon Sep 17 00:00:00 2001 From: Samuel Flores Date: Wed, 22 Aug 2012 22:52:34 -0300 Subject: [PATCH 4/5] prevent < being interpreted as lt keyword --- plugins/vim-language/prism-vim-language.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/plugins/vim-language/prism-vim-language.js b/plugins/vim-language/prism-vim-language.js index 94e297daf4..0505916ce8 100644 --- a/plugins/vim-language/prism-vim-language.js +++ b/plugins/vim-language/prism-vim-language.js @@ -1,17 +1,20 @@ (function(){ - -if(!window.Prism) { - return; + +if(!window.Prism) { + return; } Prism.languages.vim = { 'string': /("|')(\\?.)*?\1/g, 'comment': /("+[^"\r\n]*|^".*)(\r?\n|$)/g, - 'keyword': /\b(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)\b/g, + 'keyword': { + pattern: /([^&])\b(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)\b/g, + lookbehind: true + }, 'builtin': /\b(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)\b/, 'number': /\b-?(0x)?\d*\.?\d+\b/g, 'operator': /[-+]{1,2}|!|=?<|=?>|={1,2}|(&){1,2}|\|?\||\?|\*|\//g, 'punctuation': /[{}[\];(),.:]/g }; -})(); \ No newline at end of file +})(); From 147a7dccd795ecdcdada24cd033fe991861c07b6 Mon Sep 17 00:00:00 2001 From: Samuel Flores Date: Wed, 22 Aug 2012 23:10:09 -0300 Subject: [PATCH 5/5] Added support for Clojure language --- .../prism-clojure-language.js | 41 +++++++++++++++++++ .../prism-clojure-language.min.js | 1 + prism-dark.css | 18 +++++--- prism-funky.css | 18 +++++--- prism.css | 17 +++++--- 5 files changed, 78 insertions(+), 17 deletions(-) create mode 100644 plugins/clojure-language/prism-clojure-language.js create mode 100644 plugins/clojure-language/prism-clojure-language.min.js diff --git a/plugins/clojure-language/prism-clojure-language.js b/plugins/clojure-language/prism-clojure-language.js new file mode 100644 index 0000000000..20e2ac3e1b --- /dev/null +++ b/plugins/clojure-language/prism-clojure-language.js @@ -0,0 +1,41 @@ +(function(){ + +if(!window.Prism) { + return; +} + +Prism.languages.clojure = { + 'string': /"(\\?.)*?/g, + 'comment': /;[^\r\n]*(\r?\n|$)/g, + 'const': /\bnil\b/g, + 'boolean': /\b(true|false)\b/g, + 'symbol': /:\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/g, + 'number': /\b-?(0x)?\d*\.?\d+\b/g, + 'variable': /(\*warn-on-reflection\*|this|\*assert\*|\*agent\*|\*ns\*|\*in\*|\*out\*|\*err\*|\*command-line-args\*|\*print-meta\*|\*print-readably\*|\*print-length\*|\*allow-unresolved-args\*|\*compile-files\*|\*compile-path\*|\*file\*|\*flush-on-newline\*|\*math-context\*|\*unchecked-math\*|\*print-dup\*|\*print-level\*|\*use-context-classloader\*|\*source-path\*|\*clojure-version\*|\*read-eval\*|\*fn-loader\*|\*1|\*2|\*3|\*e)\b/g, + 'repeat': { + pattern: /(\()(recur|map|mapcat|reduce|filter|for|doseq|dorun|doall|dotimes|map-indexed|keep|keep-indexed)\b/, + lookbehind: true + }, + 'exception':{ + pattern: /(\()(try|catch|finally|throw)\b/, + lookbehind: true + }, + 'function': { + pattern: /(\()(=|not=|not|nil\?|false\?|true\?|complement|identical\?|string\?|symbol\?|map\?|seq\?|vector\?|keyword\?|var\?|special-symbol\?|apply|partial|comp|constantly|identity|comparator|fn\?|re-matcher|re-find|re-matches|re-groups|re-seq|re-pattern|str|pr|prn|print|println|pr-str|prn-str|print-str|println-str|newline|macroexpand|macroexpand-1|monitor-enter|monitor-exit|eval|find-doc|file-seq|flush|hash|load|load-file|read|read-line|scan|slurp|subs|sync|test|format|printf|loaded-libs|use|require|load-reader|load-string|\+|-|\*|\/|\+'|-'|\*'|\/'|<|<=|==|>=|>|dec|dec'|inc|inc'|min|max|neg\?|pos\?|quot|rem|zero\?|rand|rand-int|decimal\?|even\?|odd\?|float\?|integer\?|number\?|ratio\?|rational\?|bit-and|bit-or|bit-xor|bit-not|bit-shift-left|bit-shift-right|symbol|keyword|gensym|count|conj|seq|first|rest|ffirst|fnext|nfirst|nnext|second|every\?|not-every\?|some|not-any\?|concat|reverse|cycle|interleave|interpose|split-at|split-with|take|take-nth|take-while|drop|drop-while|repeat|replicate|iterate|range|into|distinct|sort|sort-by|zipmap|line-seq|butlast|last|nth|nthnext|next|repeatedly|tree-seq|enumeration-seq|iterator-seq|coll\?|associative\?|empty\?|list\?|reversible\?|sequential\?|sorted\?|list|list\*|cons|peek|pop|vec|vector|peek|pop|rseq|subvec|array-map|hash-map|sorted-map|sorted-map-by|assoc|assoc-in|dissoc|get|get-in|contains\?|find|select-keys|update-in|key|val|keys|vals|merge|merge-with|max-key|min-key|create-struct|struct-map|struct|accessor|remove-method|meta|with-meta|in-ns|refer|create-ns|find-ns|all-ns|remove-ns|import|ns-name|ns-map|ns-interns|ns-publics|ns-imports|ns-refers|ns-resolve|resolve|ns-unmap|name|namespace|require|use|set\!|find-var|var-get|var-set|ref|deref|ensure|alter|ref-set|commute|agent|send|send-off|agent-errors|clear-agent-errors|await|await-for|instance\?|bean|alength|aget|aset|aset-boolean|aset-byte|aset-char|aset-double|aset-float|aset-int|aset-long|aset-short|make-array|to-array|to-array-2d|into-array|int|long|float|double|char|boolean|short|byte|parse|add-classpath|cast|class|get-proxy-class|proxy-mappings|update-proxy|hash-set|sorted-set|set|disj|set\?|aclone|add-watch|alias|alter-var-root|ancestors|await1|bases|bigdec|bigint|bit-and-not|bit-clear|bit-flip|bit-set|bit-test|counted\?char-escape-string|char-name-string|class\?|compare|compile|construct-proxy|delay\?|derive|descendants|distinct\?|double-array|doubles|drop-last|empty|float-array|floats|force|gen-class|get-validator|int-array|ints|isa\?|long-array|longs|make-hierarchy|method-sig|not-empty|ns-aliases|ns-unalias|num|partition|parents|pmap|prefer-method|primitives-classnames|print-ctor|print-dup|print-method|print-simple|proxy-call-with-super|proxy-super|rationalize|read-string|remove|remove-watch|replace|resultset-seq|rsubseq|seque|set-validator\!|shutdown-agents|subseq|supers|unchecked-add|unchecked-dec|unchecked-divide|unchecked-inc|unchecked-multiply|unchecked-negate|unchecked-subtract|underive|xml-seq|trampoline|atom|compare-and-set\!|ifn\?|gen-interface|intern|init-proxy|io\!|memoize|proxy-name|swap\!|release-pending-sends|the-ns|unquote|while|unchecked-remainder|alter-meta\!|future-call|methods|mod|pcalls|prefers|pvalues|reset\!|realized\?|some-fn|reset-meta\!|type|vary-meta|unquote-splicing|sequence|clojure-version|counted\?|chunk-buffer|chunk-append|chunk|chunk-first|chunk-rest|chunk-next|chunk-cons|chunked-seq\?|deliver|future\?|future-done\?|future-cancel|future-cancelled\?|get-method|promise|ref-history-count|ref-min-history|ref-max-history|agent-error|assoc\!|boolean-array|booleans|bound-fn\*|bound\?|byte-array|bytes|char-array|char\?|chars|conj\!|denominator|disj\!|dissoc\!|error-handler|error-mode|extenders|extends\?|find-protocol-impl|find-protocol-method|flatten|frequencies|get-thread-bindings|group-by|hash-combine|juxt|munge|namespace-munge|numerator|object-array|partition-all|partition-by|persistent\!|pop\!|pop-thread-bindings|push-thread-bindings|rand-nth|reductions|remove-all-methods|restart-agent|satisfies\?|set-error-handler\!|set-error-mode\!|short-array|shorts|shuffle|sorted-set-by|take-last|thread-bound\?|transient|vector-of|with-bindings\*|fnil|spit|biginteger|every-pred|find-keyword|unchecked-add-int|unchecked-byte|unchecked-char|unchecked-dec-int|unchecked-divide-int|unchecked-double|unchecked-float|unchecked-inc-int|unchecked-int|unchecked-long|unchecked-multiply-int|unchecked-negate-int|unchecked-remainder-int|unchecked-short|unchecked-subtract-int|with-redefs|with-redefs-fn)/g, + lookbehind: true + }, + 'special': { + pattern: /(\()(\.|def|do|fn|if|let|new|quote|var|loop)\b/g, + lookbehind: true + }, + 'define': { + pattern: /(\()(def-|defn|defn-|defmacro|deftest|defmulti|defmethod|defstruct|defonce|declare|definline|definterface|defprotocol|defrecord|deftype)\b/g, + lookbehind: true + }, + 'macro': { + pattern: /(\()(and|or|->|assert|with-out-str|with-in-str|with-open|locking|destructure|ns|dosync|binding|delay|lazy-cons|lazy-cat|time|assert|with-precision|with-local-vars|..|doto|memfn|proxy|amap|areduce|refer-clojure|future|lazy-seq|letfn|with-loading-context|bound-fn|extend|extend-protocol|extend-type|reify|with-bindings|->>)\b/g, + lookbehind: true + } +}; + +})(); \ No newline at end of file diff --git a/plugins/clojure-language/prism-clojure-language.min.js b/plugins/clojure-language/prism-clojure-language.min.js new file mode 100644 index 0000000000..6361dc8d4c --- /dev/null +++ b/plugins/clojure-language/prism-clojure-language.min.js @@ -0,0 +1 @@ +(function(){if(!window.Prism){return}Prism.languages.clojure={'string':/"(\\?.)*?/g,'comment':/;[^\r\n]*(\r?\n|$)/g,'const':/\bnil\b/g,'boolean':/\b(true|false)\b/g,'symbol':/:\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/g,'number':/\b-?(0x)?\d*\.?\d+\b/g,'variable':/(\*warn-on-reflection\*|this|\*assert\*|\*agent\*|\*ns\*|\*in\*|\*out\*|\*err\*|\*command-line-args\*|\*print-meta\*|\*print-readably\*|\*print-length\*|\*allow-unresolved-args\*|\*compile-files\*|\*compile-path\*|\*file\*|\*flush-on-newline\*|\*math-context\*|\*unchecked-math\*|\*print-dup\*|\*print-level\*|\*use-context-classloader\*|\*source-path\*|\*clojure-version\*|\*read-eval\*|\*fn-loader\*|\*1|\*2|\*3|\*e)\b/g,'repeat':{pattern:/(\()(recur|map|mapcat|reduce|filter|for|doseq|dorun|doall|dotimes|map-indexed|keep|keep-indexed)\b/,lookbehind:true},'exception':{pattern:/(\()(try|catch|finally|throw)\b/,lookbehind:true},'function':{pattern:/(\()(=|not=|not|nil\?|false\?|true\?|complement|identical\?|string\?|symbol\?|map\?|seq\?|vector\?|keyword\?|var\?|special-symbol\?|apply|partial|comp|constantly|identity|comparator|fn\?|re-matcher|re-find|re-matches|re-groups|re-seq|re-pattern|str|pr|prn|print|println|pr-str|prn-str|print-str|println-str|newline|macroexpand|macroexpand-1|monitor-enter|monitor-exit|eval|find-doc|file-seq|flush|hash|load|load-file|read|read-line|scan|slurp|subs|sync|test|format|printf|loaded-libs|use|require|load-reader|load-string|\+|-|\*|\/|\+'|-'|\*'|\/'|<|<=|==|>=|>|dec|dec'|inc|inc'|min|max|neg\?|pos\?|quot|rem|zero\?|rand|rand-int|decimal\?|even\?|odd\?|float\?|integer\?|number\?|ratio\?|rational\?|bit-and|bit-or|bit-xor|bit-not|bit-shift-left|bit-shift-right|symbol|keyword|gensym|count|conj|seq|first|rest|ffirst|fnext|nfirst|nnext|second|every\?|not-every\?|some|not-any\?|concat|reverse|cycle|interleave|interpose|split-at|split-with|take|take-nth|take-while|drop|drop-while|repeat|replicate|iterate|range|into|distinct|sort|sort-by|zipmap|line-seq|butlast|last|nth|nthnext|next|repeatedly|tree-seq|enumeration-seq|iterator-seq|coll\?|associative\?|empty\?|list\?|reversible\?|sequential\?|sorted\?|list|list\*|cons|peek|pop|vec|vector|peek|pop|rseq|subvec|array-map|hash-map|sorted-map|sorted-map-by|assoc|assoc-in|dissoc|get|get-in|contains\?|find|select-keys|update-in|key|val|keys|vals|merge|merge-with|max-key|min-key|create-struct|struct-map|struct|accessor|remove-method|meta|with-meta|in-ns|refer|create-ns|find-ns|all-ns|remove-ns|import|ns-name|ns-map|ns-interns|ns-publics|ns-imports|ns-refers|ns-resolve|resolve|ns-unmap|name|namespace|require|use|set\!|find-var|var-get|var-set|ref|deref|ensure|alter|ref-set|commute|agent|send|send-off|agent-errors|clear-agent-errors|await|await-for|instance\?|bean|alength|aget|aset|aset-boolean|aset-byte|aset-char|aset-double|aset-float|aset-int|aset-long|aset-short|make-array|to-array|to-array-2d|into-array|int|long|float|double|char|boolean|short|byte|parse|add-classpath|cast|class|get-proxy-class|proxy-mappings|update-proxy|hash-set|sorted-set|set|disj|set\?|aclone|add-watch|alias|alter-var-root|ancestors|await1|bases|bigdec|bigint|bit-and-not|bit-clear|bit-flip|bit-set|bit-test|counted\?char-escape-string|char-name-string|class\?|compare|compile|construct-proxy|delay\?|derive|descendants|distinct\?|double-array|doubles|drop-last|empty|float-array|floats|force|gen-class|get-validator|int-array|ints|isa\?|long-array|longs|make-hierarchy|method-sig|not-empty|ns-aliases|ns-unalias|num|partition|parents|pmap|prefer-method|primitives-classnames|print-ctor|print-dup|print-method|print-simple|proxy-call-with-super|proxy-super|rationalize|read-string|remove|remove-watch|replace|resultset-seq|rsubseq|seque|set-validator\!|shutdown-agents|subseq|supers|unchecked-add|unchecked-dec|unchecked-divide|unchecked-inc|unchecked-multiply|unchecked-negate|unchecked-subtract|underive|xml-seq|trampoline|atom|compare-and-set\!|ifn\?|gen-interface|intern|init-proxy|io\!|memoize|proxy-name|swap\!|release-pending-sends|the-ns|unquote|while|unchecked-remainder|alter-meta\!|future-call|methods|mod|pcalls|prefers|pvalues|reset\!|realized\?|some-fn|reset-meta\!|type|vary-meta|unquote-splicing|sequence|clojure-version|counted\?|chunk-buffer|chunk-append|chunk|chunk-first|chunk-rest|chunk-next|chunk-cons|chunked-seq\?|deliver|future\?|future-done\?|future-cancel|future-cancelled\?|get-method|promise|ref-history-count|ref-min-history|ref-max-history|agent-error|assoc\!|boolean-array|booleans|bound-fn\*|bound\?|byte-array|bytes|char-array|char\?|chars|conj\!|denominator|disj\!|dissoc\!|error-handler|error-mode|extenders|extends\?|find-protocol-impl|find-protocol-method|flatten|frequencies|get-thread-bindings|group-by|hash-combine|juxt|munge|namespace-munge|numerator|object-array|partition-all|partition-by|persistent\!|pop\!|pop-thread-bindings|push-thread-bindings|rand-nth|reductions|remove-all-methods|restart-agent|satisfies\?|set-error-handler\!|set-error-mode\!|short-array|shorts|shuffle|sorted-set-by|take-last|thread-bound\?|transient|vector-of|with-bindings\*|fnil|spit|biginteger|every-pred|find-keyword|unchecked-add-int|unchecked-byte|unchecked-char|unchecked-dec-int|unchecked-divide-int|unchecked-double|unchecked-float|unchecked-inc-int|unchecked-int|unchecked-long|unchecked-multiply-int|unchecked-negate-int|unchecked-remainder-int|unchecked-short|unchecked-subtract-int|with-redefs|with-redefs-fn)/g,lookbehind:true},'special':{pattern:/(\()(\.|def|do|fn|if|let|new|quote|var|loop)\b/g,lookbehind:true},'define':{pattern:/(\()(def-|defn|defn-|defmacro|deftest|defmulti|defmethod|defstruct|defonce|declare|definline|definterface|defprotocol|defrecord|deftype)\b/g,lookbehind:true},'macro':{pattern:/(\()(and|or|->|assert|with-out-str|with-in-str|with-open|locking|destructure|ns|dosync|binding|delay|lazy-cons|lazy-cat|time|assert|with-precision|with-local-vars|..|doto|memfn|proxy|amap|areduce|refer-clojure|future|lazy-seq|letfn|with-loading-context|bound-fn|extend|extend-protocol|extend-type|reify|with-bindings|->>)\b/g,lookbehind:true}}})(); \ No newline at end of file diff --git a/prism-dark.css b/prism-dark.css index 082555f107..7862c9f45a 100644 --- a/prism-dark.css +++ b/prism-dark.css @@ -74,7 +74,8 @@ pre[class*="language-"] { .token.selector, .token.attr-name, .token.string, -.token.builtin { +.token.builtin, +.token.special { color: hsl(75, 70%, 60%); } @@ -83,23 +84,28 @@ pre[class*="language-"] { .token.url, .language-css .token.string, .style .token.string, -.token.inst-var { +.token.inst-var, +.token.define, +.token.variable { color: hsl(40, 90%, 60%); } .token.atrule, .token.attr-value, -.token.keyword { +.token.keyword, +.token.function, +.token.macro { color: hsl(350, 40%, 70%); } - .token.regex, -.token.important { +.token.important, +.token.exception { color: #e90; } -.token.important { +.token.important, +.token.function { font-weight: bold; } diff --git a/prism-funky.css b/prism-funky.css index 4d9f23bd47..7da739ddf3 100644 --- a/prism-funky.css +++ b/prism-funky.css @@ -71,7 +71,8 @@ code[class*="language-"] { .token.selector, .token.attr-name, .token.string, -.token.builtin { +.token.builtin, +.token.special { color: yellow; } @@ -79,23 +80,28 @@ code[class*="language-"] { .token.entity, .token.url, .language-css .token.string, -.token.inst-var { +.token.inst-var, +.token.define, +.token.variable { color: yellowgreen; } .token.atrule, .token.attr-value, -.token.keyword { +.token.keyword, +.token.function, +.token.macro { color: deeppink; } - .token.regex, -.token.important { +.token.important, +.token.exception { color: orange; } -.token.important { +.token.important, +.token.function { font-weight: bold; } diff --git a/prism.css b/prism.css index fdbc85a029..0802ade2f4 100644 --- a/prism.css +++ b/prism.css @@ -69,7 +69,8 @@ pre[class*="language-"] { .token.selector, .token.attr-name, .token.string, -.token.builtin { +.token.builtin, +.token.special { color: #690; } @@ -78,24 +79,30 @@ pre[class*="language-"] { .token.url, .language-css .token.string, .style .token.string, -.token.inst-var { +.token.inst-var, +.token.define, +.token.variable { color: #a67f59; background: hsla(0,0%,100%,.5); } .token.atrule, .token.attr-value, -.token.keyword { +.token.keyword, +.token.function, +.token.macro { color: #07a; } .token.regex, -.token.important { +.token.important, +.token.exception { color: #e90; } -.token.important { +.token.important, +.token.function { font-weight: bold; }