Add support for vim. Closes #777

This commit is contained in:
Golmote 2015-09-24 09:03:36 +02:00
parent e62c88ed01
commit 69ea994eb5
13 changed files with 4092 additions and 2 deletions

View File

@ -455,6 +455,10 @@ var components = {
"title": "VHDL",
"owner": "a-rey"
},
"vim": {
"title": "vim",
"owner": "westonganger"
},
"wiki": {
"title": "Wiki markup",
"require": "markup",

10
components/prism-vim.js Normal file

File diff suppressed because one or more lines are too long

1
components/prism-vim.min.js vendored Normal file

File diff suppressed because one or more lines are too long

28
examples/prism-vim.html Normal file
View File

@ -0,0 +1,28 @@
<h1>vim</h1>
<p>To use this language, use the class "language-vim".</p>
<h2>Comments</h2>
<pre><code>" This is a comment</code></pre>
<h2>Variables</h2>
<pre><code>
set softab = 2
map &lt;leader>tn :tabnew
</code></pre>
<h2>Map</h2>
<pre><code>mystring = :steveT;</code></pre>
<h2>Functions</h2>
<pre><code>
func! DeleteTrailingWS()
exe "normal mz"
%s/\s\+$//ge
exe "normal `z"
endfunc</code></pre>
<h2>Logic</h2>
<pre><code>
if has("mac")
nmap &lt;D-j> &lt;M-j>
endif</code></pre>

View File

@ -5,7 +5,7 @@ if (typeof self === 'undefined' || !self.Prism || !self.document) {
}
// The languages map is built automatically with gulp
var Languages = /*languages_placeholder[*/{"css":"CSS","clike":"C-like","javascript":"JavaScript","abap":"ABAP","actionscript":"ActionScript","apacheconf":"Apache Configuration","apl":"APL","applescript":"AppleScript","aspnet":"ASP.NET (C#)","autoit":"AutoIt","autohotkey":"AutoHotkey","basic":"BASIC","csharp":"C#","cpp":"C++","coffeescript":"CoffeeScript","css-extras":"CSS Extras","fsharp":"F#","glsl":"GLSL","http":"HTTP","inform7":"Inform 7","latex":"LaTeX","lolcode":"LOLCODE","matlab":"MATLAB","mel":"MEL","nasm":"NASM","nginx":"nginx","nsis":"NSIS","objectivec":"Objective-C","ocaml":"OCaml","php":"PHP","php-extras":"PHP Extras","powershell":"PowerShell","jsx":"React JSX","rest":"reST (reStructuredText)","sas":"SAS","sass":"Sass (Sass)","scss":"Sass (Scss)","sql":"SQL","typescript":"TypeScript","vhdl":"VHDL","wiki":"Wiki markup","yaml":"YAML"}/*]*/;
var Languages = /*languages_placeholder[*/{"css":"CSS","clike":"C-like","javascript":"JavaScript","abap":"ABAP","actionscript":"ActionScript","apacheconf":"Apache Configuration","apl":"APL","applescript":"AppleScript","aspnet":"ASP.NET (C#)","autoit":"AutoIt","autohotkey":"AutoHotkey","basic":"BASIC","csharp":"C#","cpp":"C++","coffeescript":"CoffeeScript","css-extras":"CSS Extras","fsharp":"F#","glsl":"GLSL","http":"HTTP","inform7":"Inform 7","latex":"LaTeX","lolcode":"LOLCODE","matlab":"MATLAB","mel":"MEL","nasm":"NASM","nginx":"nginx","nsis":"NSIS","objectivec":"Objective-C","ocaml":"OCaml","php":"PHP","php-extras":"PHP Extras","powershell":"PowerShell","jsx":"React JSX","rest":"reST (reStructuredText)","sas":"SAS","sass":"Sass (Sass)","scss":"Sass (Scss)","sql":"SQL","typescript":"TypeScript","vhdl":"VHDL","vim":"vim","wiki":"Wiki markup","yaml":"YAML"}/*]*/;
Prism.hooks.add('before-highlight', function(env) {
var pre = env.element.parentNode;
if (!pre || !/pre/i.test(pre.nodeName)) {

View File

@ -1 +1 @@
!function(){if("undefined"!=typeof self&&self.Prism&&self.document){var e={css:"CSS",clike:"C-like",javascript:"JavaScript",abap:"ABAP",actionscript:"ActionScript",apacheconf:"Apache Configuration",apl:"APL",applescript:"AppleScript",aspnet:"ASP.NET (C#)",autoit:"AutoIt",autohotkey:"AutoHotkey",basic:"BASIC",csharp:"C#",cpp:"C++",coffeescript:"CoffeeScript","css-extras":"CSS Extras",fsharp:"F#",glsl:"GLSL",http:"HTTP",inform7:"Inform 7",latex:"LaTeX",lolcode:"LOLCODE",matlab:"MATLAB",mel:"MEL",nasm:"NASM",nginx:"nginx",nsis:"NSIS",objectivec:"Objective-C",ocaml:"OCaml",php:"PHP","php-extras":"PHP Extras",powershell:"PowerShell",jsx:"React JSX",rest:"reST (reStructuredText)",sas:"SAS",sass:"Sass (Sass)",scss:"Sass (Scss)",sql:"SQL",typescript:"TypeScript",vhdl:"VHDL",wiki:"Wiki markup",yaml:"YAML"};Prism.hooks.add("before-highlight",function(a){var t=a.element.parentNode;if(t&&/pre/i.test(t.nodeName)){var s=e[a.language]||a.language.substring(0,1).toUpperCase()+a.language.substring(1);t.setAttribute("data-language",s)}})}}();
!function(){if("undefined"!=typeof self&&self.Prism&&self.document){var e={css:"CSS",clike:"C-like",javascript:"JavaScript",abap:"ABAP",actionscript:"ActionScript",apacheconf:"Apache Configuration",apl:"APL",applescript:"AppleScript",aspnet:"ASP.NET (C#)",autoit:"AutoIt",autohotkey:"AutoHotkey",basic:"BASIC",csharp:"C#",cpp:"C++",coffeescript:"CoffeeScript","css-extras":"CSS Extras",fsharp:"F#",glsl:"GLSL",http:"HTTP",inform7:"Inform 7",latex:"LaTeX",lolcode:"LOLCODE",matlab:"MATLAB",mel:"MEL",nasm:"NASM",nginx:"nginx",nsis:"NSIS",objectivec:"Objective-C",ocaml:"OCaml",php:"PHP","php-extras":"PHP Extras",powershell:"PowerShell",jsx:"React JSX",rest:"reST (reStructuredText)",sas:"SAS",sass:"Sass (Sass)",scss:"Sass (Scss)",sql:"SQL",typescript:"TypeScript",vhdl:"VHDL",vim:"vim",wiki:"Wiki markup",yaml:"YAML"};Prism.hooks.add("before-highlight",function(a){var t=a.element.parentNode;if(t&&/pre/i.test(t.nodeName)){var s=e[a.language]||a.language.substring(0,1).toUpperCase()+a.language.substring(1);t.setAttribute("data-language",s)}})}}();

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
"
" Foobar
----------------------------------------------------
[
["comment", "\""],
["comment", "\" Foobar"]
]
----------------------------------------------------
Checks for comments.

View File

@ -0,0 +1,13 @@
has("mac")
exists("s:call_count")
----------------------------------------------------
[
["function", "has"], ["punctuation", "("], ["string", "\"mac\""], ["punctuation", ")"],
["function", "exists"], ["punctuation", "("], ["string", "\"s:call_count\""], ["punctuation", ")"]
]
----------------------------------------------------
Checks for functions.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,15 @@
0xBadFace
42
3.14159
----------------------------------------------------
[
["number", "0xBadFace"],
["number", "42"],
["number", "3.14159"]
]
----------------------------------------------------
Checks for numbers.

View File

@ -0,0 +1,37 @@
|| &&
? * / %
+ +=
- -=
. .=
= == =~
==# =~# ==? =~?
! != !~
!=# !~# !=? !~?
< <=
<# <=# <? <=?
> >=
># >=# >? >=?
is isnot
----------------------------------------------------
[
["operator", "||"], ["operator", "&&"],
["operator", "?"], ["operator", "*"], ["operator", "/"], ["operator", "%"],
["operator", "+"], ["operator", "+="],
["operator", "-"], ["operator", "-="],
["operator", "."], ["operator", ".="],
["operator", "="], ["operator", "=="], ["operator", "=~"],
["operator", "==#"], ["operator", "=~#"], ["operator", "==?"], ["operator", "=~?"],
["operator", "!"], ["operator", "!="], ["operator", "!~"],
["operator", "!=#"], ["operator", "!~#"], ["operator", "!=?"], ["operator", "!~?"],
["operator", "<"], ["operator", "<="],
["operator", "<#"], ["operator", "<=#"], ["operator", "<?"], ["operator", "<=?"],
["operator", ">"], ["operator", ">="],
["operator", ">#"], ["operator", ">=#"], ["operator", ">?"], ["operator", ">=?"],
["operator", "is"], ["operator", "isnot"]
]
----------------------------------------------------
Checks for all operators.

View File

@ -0,0 +1,19 @@
""
"Fo\"ob'ar"
''
'\'
'Foo''bar'
----------------------------------------------------
[
["string", "\"\""],
["string", "\"Fo\\\"ob'ar\""],
["string", "''"],
["string", "'\\'"],
["string", "'Foo''bar'"]
]
----------------------------------------------------
Checks for strings.