Browse Source

Use upstream Markdown highlighter (as submodule)

Alois Mahdal 10 years ago
parent
commit
c4a64f6ef8

+ 3
- 0
.gitmodules View File

@@ -1,3 +1,6 @@
1 1
 [submodule "dotfiles/vim/bundle/python-syntax"]
2 2
 	path = dotfiles/vim/bundle/python-syntax
3 3
 	url = https://github.com/hdima/python-syntax.git
4
+[submodule "dotfiles/vim/bundle/vim-markdown"]
5
+	path = dotfiles/vim/bundle/vim-markdown
6
+	url = https://github.com/plasticboy/vim-markdown.git

+ 1
- 0
dotfiles/vim/bundle/vim-markdown

@@ -0,0 +1 @@
1
+Subproject commit 55698854abe296deb5b698e9d2d1c2a92549aa77

+ 0
- 39
dotfiles/vim/bundle/vim-markdown/README.md View File

@@ -1,39 +0,0 @@
1
-# Markdown Vim Mode
2
-
3
-Syntax highlighting and matching rules for [Markdown](http://daringfireball.net/projects/markdown/).
4
-
5
-## Installation
6
-
7
-If you use [Pathogen](http://www.vim.org/scripts/script.php?script_id=2332)(and you should), do this:
8
-
9
-    $ cd ~/.vim/bundle
10
-    $ git clone https://github.com/plasticboy/vim-markdown.git
11
-
12
-To install without Pathogen, download the [tarball](https://github.com/plasticboy/vim-markdown/archive/master.tar.gz) and do this:
13
-
14
-    $ cd ~/.vim
15
-    $ tar --strip=1 -zxf vim-markdown-master.tar.gz
16
-
17
-[Homepage](http://plasticboy.com/markdown-vim-mode/)
18
-
19
-## Options
20
-
21
-**Disable Folding**
22
-
23
-Add the following line to your `.vimrc` to disable folding.
24
-
25
-```vim
26
-let g:vim_markdown_folding_disabled=1
27
-```
28
-
29
-## License
30
-
31
-The MIT License (MIT)
32
-
33
-Copyright (c) 2012 Benjamin D. Williams
34
-
35
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
36
-
37
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
38
-
39
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 0
- 51
dotfiles/vim/bundle/vim-markdown/after/ftplugin/mkd.vim View File

@@ -1,51 +0,0 @@
1
-" folding for Markdown headers, both styles (atx- and setex-)
2
-" http://daringfireball.net/projects/markdown/syntax#header
3
-"
4
-" this code can be placed in file
5
-"   $HOME/.vim/after/ftplugin/markdown.vim
6
-"
7
-" original version from Steve Losh's gist: https://gist.github.com/1038710
8
-
9
-func! Foldexpr_markdown(lnum)
10
-    if (a:lnum == 1)
11
-        let l0 = ''
12
-    else
13
-        let l0 = getline(a:lnum-1)
14
-    endif
15
-
16
-    let l1 = getline(a:lnum)
17
-
18
-    let l2 = getline(a:lnum+1)
19
-
20
-    if  l2 =~ '^==\+\s*'
21
-        " next line is underlined (level 1)
22
-        return '>1'
23
-    elseif l2 =~ '^--\+\s*'
24
-        " next line is underlined (level 2)
25
-        return '>2'
26
-    elseif l1 =~ '^#'
27
-        " don't include the section title in the fold
28
-        return '-1'
29
-    elseif l0 =~ '^#'
30
-        " current line starts with hashes
31
-        return '>'.matchend(l0, '^#\+')
32
-    else
33
-        " keep previous foldlevel
34
-        return '='
35
-    endif
36
-endfunc
37
-
38
-
39
-if !exists("g:vim_markdown_folding_disabled")
40
-  setlocal foldexpr=Foldexpr_markdown(v:lnum)
41
-  setlocal foldmethod=expr
42
-
43
-  "---------- everything after this is optional -----------------------
44
-  " change the following fold options to your liking
45
-  " see ':help fold-options' for more
46
-  setlocal foldenable
47
-  setlocal foldlevel=0
48
-  setlocal foldcolumn=0
49
-  set foldmethod=expr
50
-  set foldopen-=search
51
-endif

+ 0
- 3
dotfiles/vim/bundle/vim-markdown/ftdetect/mkd.vim View File

@@ -1,3 +0,0 @@
1
-" markdown filetype file
2
-au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn}   set filetype=mkd
3
-au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn}.{des3,des,bf,bfa,aes,idea,cast,rc2,rc4,rc5,desx} set filetype=mkd

+ 0
- 115
dotfiles/vim/bundle/vim-markdown/syntax/mkd.vim View File

@@ -1,115 +0,0 @@
1
-" Vim syntax file
2
-" Language:	Markdown
3
-" Maintainer:	Ben Williams <benw@plasticboy.com>
4
-" URL:		http://plasticboy.com/markdown-vim-mode/
5
-" Version:	9
6
-" Last Change:  2009 May 18 
7
-" Remark:	Uses HTML syntax file
8
-" Remark:	I don't do anything with angle brackets (<>) because that would too easily
9
-"		easily conflict with HTML syntax
10
-" TODO: 	Handle stuff contained within stuff (e.g. headings within blockquotes)
11
-
12
-
13
-" Read the HTML syntax to start with
14
-if version < 600
15
-  so <sfile>:p:h/html.vim
16
-else
17
-  runtime! syntax/html.vim
18
-  unlet b:current_syntax
19
-endif
20
-
21
-if version < 600
22
-  syntax clear
23
-elseif exists("b:current_syntax")
24
-  finish
25
-endif
26
-
27
-" don't use standard HiLink, it will not work with included syntax files
28
-if version < 508
29
-  command! -nargs=+ HtmlHiLink hi link <args>
30
-else
31
-  command! -nargs=+ HtmlHiLink hi def link <args>
32
-endif
33
-
34
-syn spell toplevel
35
-syn case ignore
36
-syn sync linebreaks=1
37
-
38
-"additions to HTML groups
39
-syn region htmlItalic start="\\\@<!\*\S\@=" end="\S\@<=\\\@<!\*" keepend oneline
40
-syn region htmlItalic start="\(^\|\s\)\@<=_\|\\\@<!_\([^_]\+\s\)\@=" end="\S\@<=_\|_\S\@=" keepend oneline
41
-syn region htmlBold start="\S\@<=\*\*\|\*\*\S\@=" end="\S\@<=\*\*\|\*\*\S\@=" keepend oneline
42
-syn region htmlBold start="\S\@<=__\|__\S\@=" end="\S\@<=__\|__\S\@=" keepend oneline
43
-syn region htmlBoldItalic start="\S\@<=\*\*\*\|\*\*\*\S\@=" end="\S\@<=\*\*\*\|\*\*\*\S\@=" keepend oneline
44
-syn region htmlBoldItalic start="\S\@<=___\|___\S\@=" end="\S\@<=___\|___\S\@=" keepend oneline
45
-
46
-" [link](URL) | [link][id] | [link][]
47
-syn region mkdFootnotes matchgroup=mkdDelimiter start="\[^"    end="\]"
48
-syn region mkdID matchgroup=mkdDelimiter        start="\["    end="\]" contained oneline
49
-syn region mkdURL matchgroup=mkdDelimiter       start="("     end=")"  contained oneline
50
-syn region mkdLink matchgroup=mkdDelimiter      start="\\\@<!\[" end="\]\ze\s*[[(]" contains=@Spell nextgroup=mkdURL,mkdID skipwhite oneline
51
-" mkd  inline links:           protocol   optional  user:pass@       sub/domain                 .com, .co.uk, etc      optional port   path/querystring/hash fragment
52
-"                            ------------ _____________________ --------------------------- ________________________ ----------------- __
53
-syntax match   mkdInlineURL /https\?:\/\/\(\w\+\(:\w\+\)\?@\)\?\([A-Za-z][-_0-9A-Za-z]*\.\)\{1,}\(\w\{2,}\.\?\)\{1,}\(:[0-9]\{1,5}\)\?\S*/
54
-
55
-" Link definitions: [id]: URL (Optional Title)
56
-" TODO handle automatic links without colliding with htmlTag (<URL>)
57
-syn region mkdLinkDef matchgroup=mkdDelimiter   start="^ \{,3}\zs\[" end="]:" oneline nextgroup=mkdLinkDefTarget skipwhite
58
-syn region mkdLinkDefTarget start="<\?\zs\S" excludenl end="\ze[>[:space:]\n]"   contained nextgroup=mkdLinkTitle,mkdLinkDef skipwhite skipnl oneline
59
-syn region mkdLinkTitle matchgroup=mkdDelimiter start=+"+     end=+"+  contained
60
-syn region mkdLinkTitle matchgroup=mkdDelimiter start=+'+     end=+'+  contained
61
-syn region mkdLinkTitle matchgroup=mkdDelimiter start=+(+     end=+)+  contained
62
-
63
-"define Markdown groups
64
-syn match  mkdLineContinue ".$" contained
65
-syn match  mkdLineBreak    /  \+$/
66
-syn region mkdBlockquote   start=/^\s*>/                   end=/$/ contains=mkdLineBreak,mkdLineContinue,@Spell
67
-syn region mkdCode         start=/\(\([^\\]\|^\)\\\)\@<!`/ end=/\(\([^\\]\|^\)\\\)\@<!`/
68
-syn region mkdCode         start=/\s*``[^`]*/              end=/[^`]*``\s*/
69
-syn region mkdCode         start=/^```\s*\w*\s*$/          end=/^```\s*$/
70
-syn region mkdCode         start="<pre[^>]*>"              end="</pre>"
71
-syn region mkdCode         start="<code[^>]*>"             end="</code>"
72
-syn region mkdFootnote     start="\[^"                     end="\]"
73
-syn match  mkdCode         /^\s*\n\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/
74
-syn match  mkdListItem     "^\s*[-*+]\s\+"
75
-syn match  mkdListItem     "^\s*\d\+\.\s\+"
76
-syn match  mkdRule         /^\s*\*\s\{0,1}\*\s\{0,1}\*$/
77
-syn match  mkdRule         /^\s*-\s\{0,1}-\s\{0,1}-$/
78
-syn match  mkdRule         /^\s*_\s\{0,1}_\s\{0,1}_$/
79
-syn match  mkdRule         /^\s*-\{3,}$/
80
-syn match  mkdRule         /^\s*\*\{3,5}$/
81
-
82
-"HTML headings
83
-syn region htmlH1       start="^\s*#"                   end="\($\|#\+\)" contains=@Spell
84
-syn region htmlH2       start="^\s*##"                  end="\($\|#\+\)" contains=@Spell
85
-syn region htmlH3       start="^\s*###"                 end="\($\|#\+\)" contains=@Spell
86
-syn region htmlH4       start="^\s*####"                end="\($\|#\+\)" contains=@Spell
87
-syn region htmlH5       start="^\s*#####"               end="\($\|#\+\)" contains=@Spell
88
-syn region htmlH6       start="^\s*######"              end="\($\|#\+\)" contains=@Spell
89
-syn match  htmlH1       /^.\+\n=\+$/ contains=@Spell
90
-syn match  htmlH2       /^.\+\n-\+$/ contains=@Spell
91
-
92
-"highlighting for Markdown groups
93
-HtmlHiLink mkdString	    String
94
-HtmlHiLink mkdCode          String
95
-HtmlHiLink mkdFootnote    Comment
96
-HtmlHiLink mkdBlockquote    Comment
97
-HtmlHiLink mkdLineContinue  Comment
98
-HtmlHiLink mkdListItem      Identifier
99
-HtmlHiLink mkdRule          Identifier
100
-HtmlHiLink mkdLineBreak     Todo
101
-HtmlHiLink mkdFootnotes     htmlLink
102
-HtmlHiLink mkdLink          htmlLink
103
-HtmlHiLink mkdURL           htmlString
104
-HtmlHiLink mkdInlineURL     htmlLink
105
-HtmlHiLink mkdID            Identifier
106
-HtmlHiLink mkdLinkDef       mkdID
107
-HtmlHiLink mkdLinkDefTarget mkdURL
108
-HtmlHiLink mkdLinkTitle     htmlString
109
-
110
-HtmlHiLink mkdDelimiter     Delimiter
111
-
112
-let b:current_syntax = "mkd"
113
-
114
-delcommand HtmlHiLink
115
-" vim: ts=8