From db5c79f7c014821f0b910102490cb4a602e807b3 Mon Sep 17 00:00:00 2001 From: Sencer Selcuk Date: Thu, 19 Jun 2014 17:13:36 -0400 Subject: [PATCH 1/3] Allow multi-char footnote labels. --- syntax/markdown.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syntax/markdown.vim b/syntax/markdown.vim index 8fc4727..c39aaf4 100644 --- a/syntax/markdown.vim +++ b/syntax/markdown.vim @@ -85,8 +85,8 @@ syn region markdownCode matchgroup=markdownCodeDelimiter start="`" end="`" keepe 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 "\[^[^\]]\]\s*$" -syn match markdownFootnoteDefinition "^\[^[^\]]\]:" +syn match markdownFootnote "\[^[^\]]\+\]\s*$" +syn match markdownFootnoteDefinition "^\[^[^\]]\+\]:" if main_syntax ==# 'markdown' for s:type in g:markdown_fenced_languages From cb2b885214a429a8e3cf7867d6d3c724065b044c Mon Sep 17 00:00:00 2001 From: Sencer Selcuk Date: Thu, 19 Jun 2014 17:14:13 -0400 Subject: [PATCH 2/3] Footnote doesn't have to be at the line end. --- syntax/markdown.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax/markdown.vim b/syntax/markdown.vim index c39aaf4..607488d 100644 --- a/syntax/markdown.vim +++ b/syntax/markdown.vim @@ -85,7 +85,7 @@ syn region markdownCode matchgroup=markdownCodeDelimiter start="`" end="`" keepe 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 "\[^[^\]]\+\]\s*$" +syn match markdownFootnote "\[^[^\]]\+\]" syn match markdownFootnoteDefinition "^\[^[^\]]\+\]:" if main_syntax ==# 'markdown' From 14977fb9df2984067780cd452e51909cf567ee9d Mon Sep 17 00:00:00 2001 From: Sencer Selcuk Date: Thu, 19 Jun 2014 18:09:10 -0400 Subject: [PATCH 3/3] Indent the footnotes also. --- ftplugin/markdown.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ftplugin/markdown.vim b/ftplugin/markdown.vim index ae3bd26..e8627cc 100644 --- a/ftplugin/markdown.vim +++ b/ftplugin/markdown.vim @@ -11,7 +11,7 @@ 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\\+ +setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]: if exists('b:undo_ftplugin') let b:undo_ftplugin .= "|setl cms< com< fo< flp<"