diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2016-06-26 18:13:30 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2016-06-26 18:13:30 +0200 |
commit | 7a32eec6d17ec6de269753b8ef7b11d27b562853 (patch) | |
tree | afb61bd1dee3485ee5c6e6e1f4a97f1dafba05bf | |
parent | c69562f864cb0ee973142a45091f6cb46ce0b1df (diff) | |
download | vim-polyglot-7a32eec6d17ec6de269753b8ef7b11d27b562853.tar.gz vim-polyglot-7a32eec6d17ec6de269753b8ef7b11d27b562853.zip |
Change markdown provider to plasticboyv2.11.0
-rw-r--r-- | README.md | 2 | ||||
-rwxr-xr-x | build | 3 | ||||
-rw-r--r-- | ftdetect/polyglot.vim | 8 | ||||
-rw-r--r-- | ftplugin/markdown.vim | 54 | ||||
-rw-r--r-- | syntax/markdown.vim | 298 |
5 files changed, 160 insertions, 205 deletions
@@ -66,7 +66,7 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo - [less](https://github.com/groenewege/vim-less) (syntax, indent, ftplugin, ftdetect) - [liquid](https://github.com/tpope/vim-liquid) (syntax, indent, ftplugin, ftdetect) - [mako](https://github.com/sophacles/vim-bundle-mako) (syntax, indent, ftplugin, ftdetect) -- [markdown](https://github.com/tpope/vim-markdown) (syntax, ftplugin, ftdetect) +- [markdown](https://github.com/plasticboy/vim-markdown) (syntax, ftdetect) - [nginx](https://github.com/othree/nginx-contrib-vim) (syntax, indent, ftdetect) - [nim](https://github.com/zah/nim.vim) (syntax, compiler, indent, ftdetect) - [nix](https://github.com/spwhitt/vim-nix) (syntax, ftplugin, ftdetect) @@ -5,6 +5,7 @@ set -E DIRS="syntax indent compiler autoload ftplugin ftdetect after/syntax after/indent after/ftplugin after/ftdetect" DIRS_BASIC="syntax compiler indent ftdetect after/syntax after/indent after/ftdetect" DIRS_ALL="syntax indent compiler autoload ftplugin ftdetect after" +DIRS_SYNTAX="syntax ftdetect after/syntax after/ftdetect" OUTPUT="" @@ -137,7 +138,7 @@ PACKS=" less:groenewege/vim-less liquid:tpope/vim-liquid mako:sophacles/vim-bundle-mako - markdown:tpope/vim-markdown + markdown:plasticboy/vim-markdown:_SYNTAX nginx:othree/nginx-contrib-vim nim:zah/nim.vim:_BASIC nix:spwhitt/vim-nix diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index 4659caaf..b380b925 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -276,12 +276,8 @@ au BufRead,BufNewFile *.mako set filetype=mako endif if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'markdown') == -1 -autocmd BufNewFile,BufRead *.markdown,*.md,*.mdown,*.mkd,*.mkdn - \ if &ft =~# '^\%(conf\|modula2\)$' | - \ set ft=markdown | - \ else | - \ setf markdown | - \ endif +au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn} set filetype=markdown +au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn}.{des3,des,bf,bfa,aes,idea,cast,rc2,rc4,rc5,desx} set filetype=markdown endif if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'perl') == -1 diff --git a/ftplugin/markdown.vim b/ftplugin/markdown.vim deleted file mode 100644 index 2f0f3974..00000000 --- a/ftplugin/markdown.vim +++ /dev/null @@ -1,54 +0,0 @@ -if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'markdown') == -1 - -" Vim filetype plugin -" Language: Markdown -" Maintainer: Tim Pope <vimNOSPAM@tpope.org> -" Last Change: 2013 May 30 - -if exists("b:did_ftplugin") - finish -endif - -runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim - -setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=<!--%s--> -setlocal formatoptions+=tcqln formatoptions-=r formatoptions-=o -setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]: - -if exists('b:undo_ftplugin') - let b:undo_ftplugin .= "|setl cms< com< fo< flp<" -else - let b:undo_ftplugin = "setl cms< com< fo< flp<" -endif - -function! MarkdownFold() - let line = getline(v:lnum) - - " Regular headers - let depth = match(line, '\(^#\+\)\@<=\( .*$\)\@=') - if depth > 0 - return ">" . depth - endif - - " Setext style headings - let nextline = getline(v:lnum + 1) - if (line =~ '^.\+$') && (nextline =~ '^=\+$') - return ">1" - endif - - if (line =~ '^.\+$') && (nextline =~ '^-\+$') - return ">2" - endif - - return "=" -endfunction - -if has("folding") && exists("g:markdown_folding") - setlocal foldexpr=MarkdownFold() - setlocal foldmethod=expr - let b:undo_ftplugin .= " foldexpr< foldmethod<" -endif - -" vim:set sw=2: - -endif diff --git a/syntax/markdown.vim b/syntax/markdown.vim index ab08deb9..e7317642 100644 --- a/syntax/markdown.vim +++ b/syntax/markdown.vim @@ -1,164 +1,176 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'markdown') == -1 " Vim syntax file -" Language: Markdown -" Maintainer: Tim Pope <vimNOSPAM@tpope.org> -" Filenames: *.markdown -" Last Change: 2013 May 30 +" Language: Markdown +" Maintainer: Ben Williams <benw@plasticboy.com> +" URL: http://plasticboy.com/markdown-vim-mode/ +" Remark: Uses HTML syntax file +" TODO: Handle stuff contained within stuff (e.g. headings within blockquotes) -if exists("b:current_syntax") - finish -endif -if !exists('main_syntax') - let main_syntax = 'markdown' +" Read the HTML syntax to start with +if version < 600 + so <sfile>:p:h/html.vim +else + runtime! syntax/html.vim + + if exists('b:current_syntax') + unlet b:current_syntax + endif endif -runtime! syntax/html.vim -unlet! b:current_syntax +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif -if !exists('g:markdown_fenced_languages') - let g:markdown_fenced_languages = [] +" don't use standard HiLink, it will not work with included syntax files +if version < 508 + command! -nargs=+ HtmlHiLink hi link <args> +else + command! -nargs=+ HtmlHiLink hi def link <args> endif -let s:done_include = {} -for s:type in map(copy(g:markdown_fenced_languages),'matchstr(v:val,"[^=]*$")') - if has_key(s:done_include, matchstr(s:type,'[^.]*')) - continue - endif - if s:type =~ '\.' - let b:{matchstr(s:type,'[^.]*')}_subtype = matchstr(s:type,'\.\zs.*') - endif - exe 'syn include @markdownHighlight'.substitute(s:type,'\.','','g').' syntax/'.matchstr(s:type,'[^.]*').'.vim' - unlet! b:current_syntax - let s:done_include[matchstr(s:type,'[^.]*')] = 1 -endfor -unlet! s:type -unlet! s:done_include -syn sync minlines=10 +syn spell toplevel syn case ignore +syn sync linebreaks=1 -syn match markdownValid '[<>]\c[a-z/$!]\@!' -syn match markdownValid '&\%(#\=\w*;\)\@!' - -syn match markdownLineStart "^[<@]\@!" nextgroup=@markdownBlock,htmlSpecialChar - -syn cluster markdownBlock contains=markdownH1,markdownH2,markdownH3,markdownH4,markdownH5,markdownH6,markdownBlockquote,markdownListMarker,markdownOrderedListMarker,markdownCodeBlock,markdownRule -syn cluster markdownInline contains=markdownLineBreak,markdownLinkText,markdownItalic,markdownBold,markdownCode,markdownEscape,@htmlTop,markdownError - -syn match markdownH1 "^.\+\n=\+$" contained contains=@markdownInline,markdownHeadingRule,markdownAutomaticLink -syn match markdownH2 "^.\+\n-\+$" contained contains=@markdownInline,markdownHeadingRule,markdownAutomaticLink - -syn match markdownHeadingRule "^[=-]\+$" contained - -syn region markdownH1 matchgroup=markdownHeadingDelimiter start="##\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained -syn region markdownH2 matchgroup=markdownHeadingDelimiter start="###\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained -syn region markdownH3 matchgroup=markdownHeadingDelimiter start="####\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained -syn region markdownH4 matchgroup=markdownHeadingDelimiter start="#####\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained -syn region markdownH5 matchgroup=markdownHeadingDelimiter start="######\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained -syn region markdownH6 matchgroup=markdownHeadingDelimiter start="#######\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained - -syn match markdownBlockquote ">\%(\s\|$\)" contained nextgroup=@markdownBlock - -syn region markdownCodeBlock start=" \|\t" end="$" contained - -" TODO: real nesting -syn match markdownListMarker "\%(\t\| \{0,4\}\)[-*+]\%(\s\+\S\)\@=" contained -syn match markdownOrderedListMarker "\%(\t\| \{0,4}\)\<\d\+\.\%(\s\+\S\)\@=" contained - -syn match markdownRule "\* *\* *\*[ *]*$" contained -syn match markdownRule "- *- *-[ -]*$" contained - -syn match markdownLineBreak " \{2,\}$" - -syn region markdownIdDeclaration matchgroup=markdownLinkDelimiter start="^ \{0,3\}!\=\[" end="\]:" oneline keepend nextgroup=markdownUrl skipwhite -syn match markdownUrl "\S\+" nextgroup=markdownUrlTitle skipwhite contained -syn region markdownUrl matchgroup=markdownUrlDelimiter start="<" end=">" oneline keepend nextgroup=markdownUrlTitle skipwhite contained -syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+"+ end=+"+ keepend contained -syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+'+ end=+'+ keepend contained -syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+(+ end=+)+ keepend contained - -syn region markdownLinkText matchgroup=markdownLinkTextDelimiter start="!\=\[\%(\_[^]]*]\%( \=[[(]\)\)\@=" end="\]\%( \=[[(]\)\@=" nextgroup=markdownLink,markdownId skipwhite contains=@markdownInline,markdownLineStart -syn region markdownLink matchgroup=markdownLinkDelimiter start="(" end=")" contains=markdownUrl keepend contained -syn region markdownId matchgroup=markdownIdDelimiter start="\[" end="\]" keepend contained -syn region markdownAutomaticLink matchgroup=markdownUrlDelimiter start="<\%(\w\+:\|[[:alnum:]_+-]\+@\)\@=" end=">" keepend oneline - +let s:conceal = '' let s:concealends = '' -if has('conceal') && get(g:, 'markdown_syntax_conceal', 1) == 1 +if has('conceal') && get(g:, 'vim_markdown_conceal', 1) + let s:conceal = ' conceal' let s:concealends = ' concealends' endif -exe 'syn region markdownItalic matchgroup=markdownItalicDelimiter start="\S\@<=\*\|\*\S\@=" end="\S\@<=\*\|\*\S\@=" keepend contains=markdownLineStart' . s:concealends -exe 'syn region markdownItalic matchgroup=markdownItalicDelimiter start="\S\@<=_\|_\S\@=" end="\S\@<=_\|_\S\@=" keepend contains=markdownLineStart' . s:concealends -exe 'syn region markdownBold matchgroup=markdownBoldDelimiter start="\S\@<=\*\*\|\*\*\S\@=" end="\S\@<=\*\*\|\*\*\S\@=" keepend contains=markdownLineStart,markdownItalic' . s:concealends -exe 'syn region markdownBold matchgroup=markdownBoldDelimiter start="\S\@<=__\|__\S\@=" end="\S\@<=__\|__\S\@=" keepend contains=markdownLineStart,markdownItalic' . s:concealends -exe 'syn region markdownBoldItalic matchgroup=markdownBoldItalicDelimiter start="\S\@<=\*\*\*\|\*\*\*\S\@=" end="\S\@<=\*\*\*\|\*\*\*\S\@=" keepend contains=markdownLineStart' . s:concealends -exe 'syn region markdownBoldItalic matchgroup=markdownBoldItalicDelimiter start="\S\@<=___\|___\S\@=" end="\S\@<=___\|___\S\@=" keepend contains=markdownLineStart' . s:concealends - -syn region markdownCode matchgroup=markdownCodeDelimiter start="`" end="`" keepend contains=markdownLineStart -syn region markdownCode matchgroup=markdownCodeDelimiter start="`` \=" end=" \=``" keepend contains=markdownLineStart -syn region markdownCode matchgroup=markdownCodeDelimiter start="^\s*```*.*$" end="^\s*```*\ze\s*$" keepend - -syn match markdownFootnote "\[^[^\]]\+\]" -syn match markdownFootnoteDefinition "^\[^[^\]]\+\]:" - -if main_syntax ==# 'markdown' - let s:done_include = {} - for s:type in g:markdown_fenced_languages - if has_key(s:done_include, matchstr(s:type,'[^.]*')) - continue - endif - exe 'syn region markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*```*\s*'.matchstr(s:type,'[^=]*').'\>.*$" end="^\s*```*\ze\s*$" keepend contains=@markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g') - let s:done_include[matchstr(s:type,'[^.]*')] = 1 - endfor - unlet! s:type - unlet! s:done_include + +" additions to HTML groups +if get(g:, 'vim_markdown_emphasis_multiline', 1) + let s:oneline = '' +else + let s:oneline = ' oneline' +endif +execute 'syn region htmlItalic start="\%(^\|\s\)\zs\*\ze[^\\\*\t ]\%(\%([^*]\|\\\*\|\n\)*[^\\\*\t ]\)\?\*\_W" end="[^\\\*\t ]\zs\*\ze\_W" keepend' . s:oneline +execute 'syn region htmlItalic start="\%(^\|\s\)\zs_\ze[^\\_\t ]" end="[^\\_\t ]\zs_\ze\_W" keepend' . s:oneline +execute 'syn region htmlBold start="\%(^\|\s\)\*\*\ze\S" end="\S\zs\*\*" keepend' . s:oneline +execute 'syn region htmlBold start="\%(^\|\s\)\zs__\ze\S" end="\S\zs__" keepend' . s:oneline +execute 'syn region htmlBoldItalic start="\%(^\|\s\)\zs\*\*\*\ze\S" end="\S\zs\*\*\*" keepend' . s:oneline +execute 'syn region htmlBoldItalic start="\%(^\|\s\)\zs___\ze\S" end="\S\zs___" keepend' . s:oneline + +" [link](URL) | [link][id] | [link][] |  +syn region mkdFootnotes matchgroup=mkdDelimiter start="\[^" end="\]" +execute 'syn region mkdID matchgroup=mkdDelimiter start="\[" end="\]" contained oneline' . s:conceal +execute 'syn region mkdURL matchgroup=mkdDelimiter start="(" end=")" contained oneline' . s:conceal +execute 'syn region mkdLink matchgroup=mkdDelimiter start="\\\@<!!\?\[" end="\n\{-,1}[^]]\{-}\zs\]\ze[[(]" contains=@mkdNonListItem,@Spell nextgroup=mkdURL,mkdID skipwhite oneline' . s:concealends + +" Autolink without angle brackets. +" mkd inline links: protocol optional user:pass@ sub/domain .com, .co.uk, etc optional port path/querystring/hash fragment +" ------------ _____________________ ----------------------------- _________________________ ----------------- __ +syn match mkdInlineURL /https\?:\/\/\(\w\+\(:\w\+\)\?@\)\?\([A-Za-z0-9][-_0-9A-Za-z]*\.\)\{1,}\(\w\{2,}\.\?\)\{1,}\(:[0-9]\{1,5}\)\?\S*/ + +" Autolink with parenthesis. +syn region mkdInlineURL matchgroup=mkdDelimiter start="(\(https\?:\/\/\(\w\+\(:\w\+\)\?@\)\?\([A-Za-z0-9][-_0-9A-Za-z]*\.\)\{1,}\(\w\{2,}\.\?\)\{1,}\(:[0-9]\{1,5}\)\?\S*)\)\@=" end=")" + +" Autolink with angle brackets. +syn region mkdInlineURL matchgroup=mkdDelimiter start="\\\@<!<\ze[a-z][a-z0-9,.-]\{1,22}:\/\/[^> ]*>" end=">" + +" Link definitions: [id]: URL (Optional Title) +syn region mkdLinkDef matchgroup=mkdDelimiter start="^ \{,3}\zs\[" end="]:" oneline nextgroup=mkdLinkDefTarget skipwhite +syn region mkdLinkDefTarget start="<\?\zs\S" excludenl end="\ze[>[:space:]\n]" contained nextgroup=mkdLinkTitle,mkdLinkDef skipwhite skipnl oneline +syn region mkdLinkTitle matchgroup=mkdDelimiter start=+"+ end=+"+ contained +syn region mkdLinkTitle matchgroup=mkdDelimiter start=+'+ end=+'+ contained +syn region mkdLinkTitle matchgroup=mkdDelimiter start=+(+ end=+)+ contained + +"HTML headings +syn region htmlH1 start="^\s*#" end="$" contains=mkdLink,mkdInlineURL,@Spell +syn region htmlH2 start="^\s*##" end="$" contains=mkdLink,mkdInlineURL,@Spell +syn region htmlH3 start="^\s*###" end="$" contains=mkdLink,mkdInlineURL,@Spell +syn region htmlH4 start="^\s*####" end="$" contains=mkdLink,mkdInlineURL,@Spell +syn region htmlH5 start="^\s*#####" end="$" contains=mkdLink,mkdInlineURL,@Spell +syn region htmlH6 start="^\s*######" end="$" contains=mkdLink,mkdInlineURL,@Spell +syn match htmlH1 /^.\+\n=\+$/ contains=mkdLink,mkdInlineURL,@Spell +syn match htmlH2 /^.\+\n-\+$/ contains=mkdLink,mkdInlineURL,@Spell + +"define Markdown groups +syn match mkdLineBreak / \+$/ +syn region mkdBlockquote start=/^\s*>/ end=/$/ contains=mkdLink,mkdInlineURL,mkdLineBreak,@Spell +syn region mkdCode start=/\(\([^\\]\|^\)\\\)\@<!`/ end=/\(\([^\\]\|^\)\\\)\@<!`/ +syn region mkdCode start=/\s*``[^`]*/ end=/[^`]*``\s*/ +syn region mkdCode start=/^\s*\z(`\{3,}\)[^`]*$/ end=/^\s*\z1`*\s*$/ +syn region mkdCode start=/\s*\~\~[^\~]*/ end=/[^\~]*\~\~\s*/ +syn region mkdCode start=/^\s*\z(\~\{3,}\)\s*[0-9A-Za-z_+-]*\s*$/ end=/^\s*\z1\~*\s*$/ +syn region mkdCode start="<pre[^>]*\\\@<!>" end="</pre>" +syn region mkdCode start="<code[^>]*\\\@<!>" end="</code>" +syn region mkdFootnote start="\[^" end="\]" +syn match mkdCode /^\s*\n\(\(\s\{8,}[^ ]\|\t\t\+[^\t]\).*\n\)\+/ +syn match mkdCode /\%^\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/ +syn match mkdCode /^\s*\n\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/ contained +syn match mkdListItem /^\s*\%([-*+]\|\d\+\.\)\s\+/ contained +syn region mkdListItemLine start="^\s*\%([-*+]\|\d\+\.\)\s\+" end="$" oneline contains=@mkdNonListItem,mkdListItem,@Spell +syn region mkdNonListItemBlock start="\(\%^\(\s*\([-*+]\|\d\+\.\)\s\+\)\@!\|\n\(\_^\_$\|\s\{4,}[^ ]\|\t+[^\t]\)\@!\)" end="^\(\s*\([-*+]\|\d\+\.\)\s\+\)\@=" contains=@mkdNonListItem,@Spell +syn match mkdRule /^\s*\*\s\{0,1}\*\s\{0,1}\*$/ +syn match mkdRule /^\s*-\s\{0,1}-\s\{0,1}-$/ +syn match mkdRule /^\s*_\s\{0,1}_\s\{0,1}_$/ +syn match mkdRule /^\s*-\{3,}$/ +syn match mkdRule /^\s*\*\{3,5}$/ + +" YAML frontmatter +if get(g:, 'vim_markdown_frontmatter', 0) + syn include @yamlTop syntax/yaml.vim + syn region Comment matchgroup=mkdDelimiter start="\%^---$" end="^---$" contains=@yamlTop keepend + unlet! b:current_syntax +endif + +if get(g:, 'vim_markdown_toml_frontmatter', 0) + try + syn include @tomlTop syntax/toml.vim + syn region Comment matchgroup=mkdDelimiter start="\%^+++$" end="^+++$" transparent contains=@tomlTop keepend + unlet! b:current_syntax + catch /E484/ + syn region Comment matchgroup=mkdDelimiter start="\%^+++$" end="^+++$" + endtry +endif + +if get(g:, 'vim_markdown_json_frontmatter', 0) + try + syn include @jsonTop syntax/json.vim + syn region Comment matchgroup=mkdDelimiter start="\%^{$" end="^}$" contains=@jsonTop keepend + unlet! b:current_syntax + catch /E484/ + syn region Comment matchgroup=mkdDelimiter start="\%^{$" end="^}$" + endtry endif -syn match markdownEscape "\\[][\\`*_{}()<>#+.!-]" -syn match markdownError "\w\@<=_\w\@=" - -hi def link markdownH1 htmlH1 -hi def link markdownH2 htmlH2 -hi def link markdownH3 htmlH3 -hi def link markdownH4 htmlH4 -hi def link markdownH5 htmlH5 -hi def link markdownH6 htmlH6 -hi def link markdownHeadingRule markdownRule -hi def link markdownHeadingDelimiter Delimiter -hi def link markdownOrderedListMarker markdownListMarker -hi def link markdownListMarker htmlTagName -hi def link markdownBlockquote Comment -hi def link markdownRule PreProc - -hi def link markdownFootnote Typedef -hi def link markdownFootnoteDefinition Typedef - -hi def link markdownLinkText htmlLink -hi def link markdownIdDeclaration Typedef -hi def link markdownId Type -hi def link markdownAutomaticLink markdownUrl -hi def link markdownUrl Float -hi def link markdownUrlTitle String -hi def link markdownIdDelimiter markdownLinkDelimiter -hi def link markdownUrlDelimiter htmlTag -hi def link markdownUrlTitleDelimiter Delimiter - -hi def link markdownItalic htmlItalic -hi def link markdownItalicDelimiter markdownItalic -hi def link markdownBold htmlBold -hi def link markdownBoldDelimiter markdownBold -hi def link markdownBoldItalic htmlBoldItalic -hi def link markdownBoldItalicDelimiter markdownBoldItalic -hi def link markdownCodeDelimiter Delimiter - -hi def link markdownEscape Special -hi def link markdownError Error - -let b:current_syntax = "markdown" -if main_syntax ==# 'markdown' - unlet main_syntax +if get(g:, 'vim_markdown_math', 0) + syn include @tex syntax/tex.vim + syn region mkdMath start="\\\@<!\$" end="\$" contains=@tex keepend + syn region mkdMath start="\\\@<!\$\$" end="\$\$" contains=@tex keepend endif -" vim:set sw=2: +syn cluster mkdNonListItem contains=@htmlTop,htmlItalic,htmlBold,htmlBoldItalic,mkdFootnotes,mkdInlineURL,mkdLink,mkdLinkDef,mkdLineBreak,mkdBlockquote,mkdCode,mkdRule,htmlH1,htmlH2,htmlH3,htmlH4,htmlH5,htmlH6,mkdMath + +"highlighting for Markdown groups +HtmlHiLink mkdString String +HtmlHiLink mkdCode String +HtmlHiLink mkdCodeStart String +HtmlHiLink mkdCodeEnd String +HtmlHiLink mkdFootnote Comment +HtmlHiLink mkdBlockquote Comment +HtmlHiLink mkdListItem Identifier +HtmlHiLink mkdRule Identifier +HtmlHiLink mkdLineBreak Visual +HtmlHiLink mkdFootnotes htmlLink +HtmlHiLink mkdLink htmlLink +HtmlHiLink mkdURL htmlString +HtmlHiLink mkdInlineURL htmlLink +HtmlHiLink mkdID Identifier +HtmlHiLink mkdLinkDef mkdID +HtmlHiLink mkdLinkDefTarget mkdURL +HtmlHiLink mkdLinkTitle htmlString +HtmlHiLink mkdDelimiter Delimiter + +let b:current_syntax = "mkd" + +delcommand HtmlHiLink +" vim: ts=8 endif |