From: Ciro Santilli Date: Sat, 6 Sep 2014 14:02:30 +0000 (+0200) Subject: Add LateX $ and $$ math support. X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/d34f4d8edf7e93f54a0e1c6d41c85e557db71ee7?ds=sidebyside Add LateX $ and $$ math support. --- diff --git a/README.md b/README.md index 8ff3b59..6755e94 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,15 @@ Add the following line to your `.vimrc` to disable default key mappings. You can let g:vim_markdown_no_default_key_mappings=1 ``` +**Syntax extensions** + +The following options control which syntax extensions will be turned on. + +LaTeX math: `$ $`, `$$ $$`, escapable as `\$ \$` and `\$\$ \$\$`: + +```vim +let g:vim_markdown_math=1 +``` ## Mappings The following work on normal and visual modes: diff --git a/syntax/mkd.vim b/syntax/mkd.vim index 38c3502..19d59d5 100644 --- a/syntax/mkd.vim +++ b/syntax/mkd.vim @@ -94,7 +94,12 @@ syn region htmlH6 start="^\s*######" end="\($\|#\+\)" contain syn match htmlH1 /^.\+\n=\+$/ contains=@Spell syn match htmlH2 /^.\+\n-\+$/ contains=@Spell -syn cluster mkdNonListItem contains=htmlItalic,htmlBold,htmlBoldItalic,mkdFootnotes,mkdLink,mkdLinkDef,mkdLineBreak,mkdBlockquote,mkdCode,mkdIndentCode,mkdListItem,mkdRule,htmlH1,htmlH2,htmlH3,htmlH4,htmlH5,htmlH6 +if get(g:, 'vim_markdown_math', 0) + syn region mkdMath matchgroup=mkdDelimiter start="\\\@