From 68532f7f874aa4cfa79fb8e25c1f2ca9409b33c1 Mon Sep 17 00:00:00 2001 From: Daven Quinn Date: Mon, 1 May 2017 01:27:40 -0700 Subject: [PATCH 1/3] Added pandoc crossref highlighting --- syntax/pandoc.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/syntax/pandoc.vim b/syntax/pandoc.vim index 2b2e7b0..1c227e1 100644 --- a/syntax/pandoc.vim +++ b/syntax/pandoc.vim @@ -462,6 +462,13 @@ endtry syn region pandocYAMLHeader matchgroup=Delimiter start=/\(\%^\|\(%.*\n\)\)\@<=\-\{3}\s*$/ end=/[\-|\.]\{3}\s*$/ contains=@YAML containedin=TOP "}}} +" Pandoc-Crossref: {{{1 + +syn match pandocCrossrefAttr /{.*}$/ +syn match pandocCrossrefID /#eq:\w*/ contained containedin=pandocCrossrefAttr + +" }}} + " Styling: {{{1 " override this for consistency hi pandocTitleBlock term=italic gui=italic @@ -472,6 +479,9 @@ hi link pandocSetexHeader Title hi link pandocHeaderAttr Comment hi link pandocHeaderID Identifier +hi link pandocCrossrefAttr pandocHeaderAttr +hi link pandocCrossrefID pandocHeaderID + hi link pandocHTMLComment Comment hi link pandocHTMLCommentStart Delimiter hi link pandocHTMLCommentEnd Delimiter From d57e260f7c24ecd62818c949969cbc6fe7496015 Mon Sep 17 00:00:00 2001 From: Daven Quinn Date: Fri, 8 Dec 2017 01:53:56 -0800 Subject: [PATCH 2/3] Allow dashes in references --- syntax/pandoc.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax/pandoc.vim b/syntax/pandoc.vim index b4918d7..484f5c0 100644 --- a/syntax/pandoc.vim +++ b/syntax/pandoc.vim @@ -280,7 +280,7 @@ syn match pandocPCite /\^\@~\/]*\s\[.\{-1,}\]/ contains=pandocCiteKey,@Spell display " cite keys syn match pandocCiteKey /\(-\=@[[:alnum:]_][[:alnum:]äëïöüáéíóúàèìòùłßÄËÏÖÜÁÉÍÓÚÀÈÌÒÙŁß_:.#$%&\-+?<>~\/]*\)/ containedin=pandocPCite,pandocICite contains=@NoSpell display -syn match pandocCiteAnchor /[-@]/ contained containedin=pandocCiteKey display +syn match pandocCiteAnchor /-*@/ contained containedin=pandocCiteKey display syn match pandocCiteLocator /[\[\]]/ contained containedin=pandocPCite,pandocICite " }}} " Text Styles: {{{2 From 01f1f3d90f587e6f3624c180e9833c5dd923ed4f Mon Sep 17 00:00:00 2001 From: Daven Quinn Date: Fri, 8 Dec 2017 02:02:19 -0800 Subject: [PATCH 3/3] Allow multiline reference definitions --- syntax/pandoc.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax/pandoc.vim b/syntax/pandoc.vim index 484f5c0..65c2072 100644 --- a/syntax/pandoc.vim +++ b/syntax/pandoc.vim @@ -275,7 +275,7 @@ syn match pandocAutomaticLink /<\(https\{0,1}.\{-}\|[A-Za-z0-9!#$%&'*+\-/=?^_`{| "}}} " Citations: {{{2 " parenthetical citations -syn match pandocPCite /\^\@~\/]*.\{-}\]/ contains=pandocEmphasis,pandocStrong,pandocLatex,pandocCiteKey,@Spell,pandocAmpersandEscape display +syn match pandocPCite /\^\@~\/]*\_.\{-}\]/ contains=pandocEmphasis,pandocStrong,pandocLatex,pandocCiteKey,@Spell,pandocAmpersandEscape display " in-text citations with location syn match pandocICite /@[[:alnum:]_][[:alnum:]äëïöüáéíóúàèìòùłßÄËÏÖÜÁÉÍÓÚÀÈÌÒÙŁß_:.#$%&\-+?<>~\/]*\s\[.\{-1,}\]/ contains=pandocCiteKey,@Spell display " cite keys