From 9f0f18b0ff59b0ab3bef56a1f89bb2c513505de9 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sun, 26 Apr 2009 14:49:34 +0200 Subject: [PATCH] mkd: Add syntax file, version 8. --- syntax/mkd.vim | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 syntax/mkd.vim diff --git a/syntax/mkd.vim b/syntax/mkd.vim new file mode 100644 index 0000000..6c23415 --- /dev/null +++ b/syntax/mkd.vim @@ -0,0 +1,86 @@ +" Vim syntax file +" Language: Markdown +" Maintainer: Ben Williams +" URL: http://plasticboy.com/markdown-vim-mode/ +" Version: 8 +" Last Change: 2008 April 29 +" Remark: Uses HTML syntax file +" Remark: I don't do anything with angle brackets (<>) because that would too easily +" easily conflict with HTML syntax +" TODO: Do something appropriate with image syntax +" TODO: Handle stuff contained within stuff (e.g. headings within blockquotes) + + +" Read the HTML syntax to start with +if version < 600 + so :p:h/html.vim +else + runtime! syntax/html.vim + unlet b:current_syntax +endif + +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +" don't use standard HiLink, it will not work with included syntax files +if version < 508 + command! -nargs=+ HtmlHiLink hi link +else + command! -nargs=+ HtmlHiLink hi def link +endif + +syn spell toplevel +syn case ignore +syn sync linebreaks=1 + +"additions to HTML groups +syn region htmlBold start=/\(^\|\s\)\*\@/ end=/$/ contains=mkdLineContinue,@Spell +syn region mkdCode start="]*>" end="" +syn region mkdCode start="]*>" end="" + +"HTML headings +syn region htmlH1 start="^\s*#" end="\($\|#\+\)" contains=@Spell +syn region htmlH2 start="^\s*##" end="\($\|#\+\)" contains=@Spell +syn region htmlH3 start="^\s*###" end="\($\|#\+\)" contains=@Spell +syn region htmlH4 start="^\s*####" end="\($\|#\+\)" contains=@Spell +syn region htmlH5 start="^\s*#####" end="\($\|#\+\)" contains=@Spell +syn region htmlH6 start="^\s*######" end="\($\|#\+\)" contains=@Spell +syn match htmlH1 /^.\+\n=\+$/ contains=@Spell +syn match htmlH2 /^.\+\n-\+$/ contains=@Spell + +"highlighting for Markdown groups +HtmlHiLink mkdString String +HtmlHiLink mkdCode String +HtmlHiLink mkdBlockquote Comment +HtmlHiLink mkdLineContinue Comment +HtmlHiLink mkdListItem Identifier +HtmlHiLink mkdRule Identifier + + +let b:current_syntax = "mkd" + +delcommand HtmlHiLink +" vim: ts=8 -- 2.44.1