11scriptencoding utf- 8
22" vim: set fdm = marker foldlevel = 0 :
3- "
3+ "
44" Vim syntax file
55"
66" Language: Pandoc (superset of Markdown)
@@ -15,14 +15,14 @@ scriptencoding utf-8
1515" use conceal? {{{2
1616if ! exists (" g:pandoc#syntax#conceal#use" )
1717 if v: version < 703
18- let g: pandoc #syntax #conceal#use = 0
18+ let g: pandoc #syntax #conceal#use = 0
1919 else
20- let g: pandoc #syntax #conceal#use = 1
20+ let g: pandoc #syntax #conceal#use = 1
2121 endif
2222else
2323 " exists, but we cannot use it, disable anyway
2424 if v: version < 703
25- let g: pandoc #syntax #conceal#use = 0
25+ let g: pandoc #syntax #conceal#use = 0
2626 endif
2727endif
2828" }}}2
@@ -34,36 +34,36 @@ endif
3434" cchars used in conceal rules {{{2
3535" utf-8 defaults (preferred)
3636if &encoding == " utf-8"
37- let s: cchars = {
38- \" newline" : " ↵" ,
39- \" image" : " ▨" ,
40- \" super" : " ⁿ" ,
41- \" sub" : " ₙ" ,
42- \" strike" : " x ̶" ,
43- \" atx" : " §" ,
44- \" codelang" : " λ" ,
45- \" codeend" : " —" ,
46- \" abbrev" : " →" ,
47- \" footnote" : " †" ,
48- \" definition" : " " ,
49- \" li " : " •" ,
37+ let s: cchars = {
38+ \" newline" : " ↵" ,
39+ \" image" : " ▨" ,
40+ \" super" : " ⁿ" ,
41+ \" sub" : " ₙ" ,
42+ \" strike" : " x ̶" ,
43+ \" atx" : " §" ,
44+ \" codelang" : " λ" ,
45+ \" codeend" : " —" ,
46+ \" abbrev" : " →" ,
47+ \" footnote" : " †" ,
48+ \" definition" : " " ,
49+ \" li " : " •" ,
5050 \" html_c_s" : " ‹" ,
5151 \" html_c_e" : " ›" }
5252else
5353 " ascii defaults
54- let s: cchars = {
55- \" newline" : " " ,
56- \" image" : " i " ,
57- \" super" : " ^" ,
58- \" sub" : " _" ,
59- \" strike" : " ~" ,
60- \" atx" : " #" ,
61- \" codelang" : " l " ,
62- \" codeend" : " - " ,
63- \" abbrev" : " a " ,
64- \" footnote" : " f " ,
65- \" definition" : " " ,
66- \" li " : " * " ,
54+ let s: cchars = {
55+ \" newline" : " " ,
56+ \" image" : " i " ,
57+ \" super" : " ^" ,
58+ \" sub" : " _" ,
59+ \" strike" : " ~" ,
60+ \" atx" : " #" ,
61+ \" codelang" : " l " ,
62+ \" codeend" : " - " ,
63+ \" abbrev" : " a " ,
64+ \" footnote" : " f " ,
65+ \" definition" : " " ,
66+ \" li " : " * " ,
6767 \" html_c_s" : " + " ,
6868 \" html_c_e" : " + " }
6969endif
@@ -78,7 +78,7 @@ if !exists("g:pandoc#syntax#conceal#urls")
7878 let g: pandoc #syntax #conceal#urls = 0
7979endif
8080" should backslashes in escapes be concealed? {{{2
81- if ! exists (" g:pandoc#syntax#conceal#backslash" )
81+ if ! exists (" g:pandoc#syntax#conceal#backslash" )
8282 let g: pandoc #syntax #conceal#backslash = 0
8383endif
8484" }}}2
@@ -148,12 +148,12 @@ function! EnableEmbedsforCodeblocksWithLang(entry)
148148 unlet ! b: current_syntax
149149 exe ' syn include @' .toupper (s: langname ).' syntax/' .s: langsyntaxfile .' .vim'
150150 exe " syn region pandocDelimitedCodeBlock_" . s: langname . ' start=/\(\_^\([ ]\{4,}\|\t\)\=\(`\{3,}`*\|\~\{3,}\~*\)\s*\%({[^.]*\.\)\=' . s: langname . ' \>.*\n\)\@<=\_^/' .
151- \' end = /\_$\n\(\([ ]\{4,}\|\t\)\=\(`\{3,}`*\|\~\{3,}\~*\)\_$\n\_$\)\@=/ contained containedin= pandocDelimitedCodeBlock' .
152- \' contains= @ ' . toupper (s: langname )
153- exe " syn region pandocDelimitedCodeBlockinBlockQuote_" . s: langname . ' start=/>\s\(`\{3,}`*\|\~\{3,}\~*\)\s*\%({[^.]*\.\)\=' . s: langname . ' \>/' .
154- \ ' end=/\(`\{3,}`*\|\~\{3,}\~*\)/ contained containedin=pandocDelimitedCodeBlock' .
155- \' contains= @ ' . toupper (s: langname ) .
156- \" ,pandocDelimitedCodeBlockStart,pandocDelimitedCodeBlockEnd,pandodDelimitedCodeblockLang,pandocBlockQuoteinDelimitedCodeBlock"
151+ \' end = /\_$\n\(\([ ]\{4,}\|\t\)\=\(`\{3,}`*\|\~\{3,}\~*\)\_$\n\_$\)\@=/ contained containedin= pandocDelimitedCodeBlock' .
152+ \' contains= @ ' . toupper (s: langname )
153+ exe " syn region pandocDelimitedCodeBlockinBlockQuote_" . s: langname . ' start=/>\s\(`\{3,}`*\|\~\{3,}\~*\)\s*\%({[^.]*\.\)\=' . s: langname . ' \>/' .
154+ \ ' end=/\(`\{3,}`*\|\~\{3,}\~*\)/ contained containedin=pandocDelimitedCodeBlock' .
155+ \' contains= @ ' . toupper (s: langname ) .
156+ \" ,pandocDelimitedCodeBlockStart,pandocDelimitedCodeBlockEnd,pandodDelimitedCodeblockLang,pandocBlockQuoteinDelimitedCodeBlock"
157157 catch /E484/
158158 echo " No syntax file found for '" . s: langsyntaxfile . " '"
159159 endtry
@@ -173,9 +173,9 @@ endfunction
173173function ! s: WithConceal (rule_group, rule, conceal_rule)
174174 let l: rule_tail = " "
175175 if g: pandoc #syntax #conceal#use != 0
176- if index (g: pandoc #syntax #conceal#blacklist, a: rule_group ) == -1
177- let l: rule_tail = " " . a: conceal_rule
178- endif
176+ if index (g: pandoc #syntax #conceal#blacklist, a: rule_group ) == -1
177+ let l: rule_tail = " " . a: conceal_rule
178+ endif
179179 endif
180180 execute a: rule . l: rule_tail
181181endfunction
@@ -223,17 +223,17 @@ syn match pandocProtectedFromInlineLaTeX /\\\@<!\${.*}\(\(\s\|[[:punct:]]\)\([^$
223223" contains=@LATEX
224224syn region pandocLaTeXMathBlock start =/ \$\$ / end =/ \$\$ / keepend contains =@LATEX
225225syn region pandocLaTeXMathBlock start =/ \\\@ <!\\\[ / end =/ \\\@ <!\\\] / keepend contains =@LATEX
226- syn match pandocLaTeXCommand / \\ [[:alpha:]]\+\(\( {.\{ -}}\)\=\(\[ .\{ -}\]\)\=\) */ contains =@LATEX
226+ syn match pandocLaTeXCommand / \\ [[:alpha:]]\+\(\( {.\{ -}}\)\=\(\[ .\{ -}\]\)\=\) */ contains =@LATEX
227227syn region pandocLaTeXRegion start =/ \\ begin{\z (.\{ -}\) }/ end =/ \\ end{\z 1}/ keepend contains =@LATEX
228228" we rehighlight sectioning commands, because otherwise tex.vim captures all text until EOF or a new sectioning command
229229syn region pandocLaTexSection start =/ \\\( part\| chapter\|\( sub\)\{ ,2}section\|\( sub\)\= paragraph\)\*\=\(\[ .*\]\)\= {/ end =/ \} / keepend
230- syn match pandocLaTexSectionCmd / \\\( part\| chapter\|\( sub\)\{ ,2}section\|\( sub\)\= paragraph\) / contained containedin =pandocLaTexSection
230+ syn match pandocLaTexSectionCmd / \\\( part\| chapter\|\( sub\)\{ ,2}section\|\( sub\)\= paragraph\) / contained containedin =pandocLaTexSection
231231syn match pandocLaTeXDelimiter / [[\] {}]/ contained containedin=pandocLaTexSection
232232" }}}}
233233" }}}2
234234" Titleblock: {{{2
235235"
236- syn region pandocTitleBlock start =/ \% ^%/ end =/ \n\n / contains =pandocReferenceLabel,pandocReferenceURL,pandocNewLine
236+ syn region pandocTitleBlock start =/ \% ^%/ end =/ \n\n / contains =pandocReferenceLabel,pandocReferenceURL,pandocNewLine
237237call s: WithConceal (" titleblock" , ' syn match pandocTitleBlockMark /%\ / contained containedin=pandocTitleBlock,pandocTitleBlockTitle' , ' conceal' )
238238syn match pandocTitleBlockTitle / \% ^%.*\n / contained containedin =pandocTitleBlock
239239" }}}
@@ -261,7 +261,7 @@ endif
261261" let's not consider "a [label] a" as a label, remove formatting - Note: breaks implicit links
262262syn match pandocNoLabel / \]\@ 1<!\(\s\{ ,3}\| ^\)\[ [^\[\] ]\{ -}\]\(\s\+\| $\) [\[ (]\@ !/ contains =pandocPCite
263263syn match pandocLinkTip / \s *".\{ -}"/ contained containedin =pandocReferenceURL contains =@Spell,pandocAmpersandEscape display
264- call s: WithConceal (" image" , ' syn match pandocImageIcon /!\[\@=/ display' , ' conceal cchar=' . s: cchars [" image" ])
264+ call s: WithConceal (" image" , ' syn match pandocImageIcon /!\[\@=/ display' , ' conceal cchar=' . s: cchars [" image" ])
265265" }}}
266266" Definitions: {{{3
267267syn region pandocReferenceDefinition start =" !\=\[\% (\_ [^]]*]\% ( \= [[(]\)\)\@ =" end="\]\% ( \= [[(]\)\@ =" keepend
@@ -318,7 +318,7 @@ call s:WithConceal("inlinecode", 'syn region pandocNoFormattedInEmphasis matchgr
318318call s: WithConceal (" inlinecode" , ' syn region pandocNoFormattedInStrong matchgroup=pandocOperator start=/\\\@<!``/ end=/\\\@<!``/ nextgroup=pandocNoFormattedAttrs contained' , ' concealends' )
319319syn match pandocNoFormattedAttrs / {.\{ -}}/ contained
320320" }}}
321- " Subscripts: {{{3
321+ " Subscripts: {{{3
322322syn region pandocSubscript start =/ \~\(\( [[:graph:]]\(\\ \)\=\)\{ -}\~\)\@ =/ end =/ \~ / keepend
323323call s: WithConceal (" subscript" , ' syn match pandocSubscriptMark /\~/ contained containedin=pandocSubscript' , ' conceal cchar=' .s: cchars [" sub" ])
324324" }}}
@@ -362,11 +362,11 @@ syn region pandocTableMultilineHeader start=/\%#=2\(^-\{2,}\n\)\@<=./ end=/\%#=2
362362syn region pandocGridTable start =/ \% #=2\n\@ 1<=+-/ end =/ +\n\n / containedin =ALLBUT,pandocDelimitedCodeBlock,pandocYAMLHeader keepend
363363syn match pandocGridTableDelims / [\| =]/ contained containedin =pandocGridTable
364364syn match pandocGridTableDelims / \% #=2\( [\- +][\- +=]\@ =\| [\- +=]\@ 1<=[\- +]\) / contained containedin =pandocGridTable
365- syn match pandocGridTableHeader / \% #=2\( ^.*\n\)\( +=.*\)\@ =/ contained containedin =pandocGridTable
365+ syn match pandocGridTableHeader / \% #=2\( ^.*\n\)\( +=.*\)\@ =/ contained containedin =pandocGridTable
366366" }}}3
367367" Pipe: {{{3
368368" with beginning and end pipes
369- syn region pandocPipeTable start =/ \% #=2\( [+|]\n\)\@ <!\n\@ 1<=|\( .*|\)\@ =/ end =/ |.*\n\(\n\| {\) / containedin =ALLBUT,pandocDelimitedCodeBlock,pandocYAMLHeader keepend
369+ syn region pandocPipeTable start =/ \% #=2\( [+|]\n\)\@ <!\n\@ 1<=|\( .*|\)\@ =/ end =/ |.*\n\(\n\| {\) / containedin =ALLBUT,pandocDelimitedCodeBlock,pandocYAMLHeader keepend
370370" without beginning and end pipes
371371syn region pandocPipeTable start =/ \% #=2^.*\n -.\{ -}|/ end =/ |.*\n\n / keepend
372372syn match pandocPipeTableDelims / [\|\- :+]/ contained containedin =pandocPipeTable
@@ -380,7 +380,7 @@ syn match pandocTableHeaderWord /\<.\{-}\>/ contained containedin=pandocGridTabl
380380syn region pandocDelimitedCodeBlock start =/ ^\( >\s\)\?\z (\( [ ]\{ 4,}\|\t\)\=\~\{ 3,}\~ *\) / end =/ ^\z 1\~ */ skipnl contains =pandocDelimitedCodeBlockStart,pandocDelimitedCodeBlockEnd keepend
381381syn region pandocDelimitedCodeBlock start =/ ^\( >\s\)\?\z (\( [ ]\{ 4,}\|\t\)\= `\{ 3,}`*\) / end =/ ^\z 1`*/ skipnl contains =pandocDelimitedCodeBlockStart,pandocDelimitedCodeBlockEnd keepend
382382call s: WithConceal (" codeblock_start" , ' syn match pandocDelimitedCodeBlockStart /\(\_^\n\_^\(>\s\)\?\([ ]\{4,}\|\t\)\=\)\@<=\(\~\{3,}\~*\|`\{3,}`*\)/ contained containedin=pandocDelimitedCodeBlock nextgroup=pandocDelimitedCodeBlockLanguage' , ' conceal cchar=' .s: cchars [" codelang" ])
383- syn match pandocDelimitedCodeBlockLanguage / \(\s\?\)\@ <=.\+\(\_ $\)\@ =/ contained
383+ syn match pandocDelimitedCodeBlockLanguage / \(\s\?\)\@ <=.\+\(\_ $\)\@ =/ contained
384384call s: WithConceal (" codeblock_delim" , ' syn match pandocDelimitedCodeBlockEnd /\(`\{3,}`*\|\~\{3,}\~*\)\(\_$\n\(>\s\)\?\_$\)\@=/ contained containedin=pandocDelimitedCodeBlock' , ' conceal cchar=' .s: cchars [" codeend" ])
385385syn match pandocBlockQuoteinDelimitedCodeBlock ' ^>' contained containedin =pandocDelimitedCodeBlock
386386syn match pandocCodePre / <pre>.\{ -}<\/ pre>/ skipnl
@@ -411,7 +411,7 @@ call s:WithConceal('abbrev', 'syn match pandocAbbreviationTail /\]/ contained co
411411"
412412syn match pandocFootnoteID / \[\^ [^\] ]\+\] / nextgroup =pandocFootnoteDef
413413" Inline footnotes
414- syn region pandocFootnoteDef start =/ \^\[ / skip =/ \[ .\{ -}]/ end =/ \] / contains =pandocReferenceLabel,pandocReferenceURL,pandocLatex,pandocPCite,pandocCiteKey,pandocStrong,pandocEmphasis,pandocStrongEmphasis,pandocNoFormatted,pandocSuperscript,pandocSubscript,pandocStrikeout,pandocEnDash,pandocEmDash,pandocEllipses,pandocBeginQuote,pandocEndQuote,@Spell,pandocAmpersandEscape skipnl keepend
414+ syn region pandocFootnoteDef start =/ \^\[ / skip =/ \[ .\{ -}]/ end =/ \] / contains =pandocReferenceLabel,pandocReferenceURL,pandocLatex,pandocPCite,pandocCiteKey,pandocStrong,pandocEmphasis,pandocStrongEmphasis,pandocNoFormatted,pandocSuperscript,pandocSubscript,pandocStrikeout,pandocEnDash,pandocEmDash,pandocEllipses,pandocBeginQuote,pandocEndQuote,@Spell,pandocAmpersandEscape skipnl keepend
415415call s: WithConceal (" footnote" , ' syn match pandocFootnoteDefHead /\^\[/ contained containedin=pandocFootnoteDef' , ' conceal cchar=' .s: cchars [" footnote" ])
416416call s: WithConceal (" footnote" , ' syn match pandocFootnoteDefTail /\]/ contained containedin=pandocFootnoteDef' , ' conceal' )
417417
@@ -429,10 +429,10 @@ syn match pandocUListItem /^>\=\s*[*+-]\s\+-\@!.*$/ nextgroup=pandocUListItem,pa
429429call s: WithConceal (' list' , ' syn match pandocUListItemBullet /^>\=\s*\zs[*+-]/ contained containedin=pandocUListItem' , ' conceal cchar=' .s: cchars [' li' ])
430430
431431" Ordered lists
432- syn match pandocListItem / ^\s *(\?\(\d\+\|\l\|\#\| @\) [.)].*$/ nextgroup =pandocListItem,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocDelimitedCodeBlock,pandocListItemContinuation contains =@Spell,pandocEmphasis,pandocStrong,pandocNoFormatted,pandocStrikeout,pandocSubscript,pandocSuperscript,pandocStrongEmphasis,pandocStrongEmphasis,pandocPCite,pandocICite,pandocCiteKey,pandocReferenceLabel,pandocLaTeXCommand,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocAutomaticLink,pandocFootnoteDef,pandocFootnoteBlock,pandocFootnoteID,pandocAmpersandEscape skipempty display
432+ syn match pandocListItem / ^\s *(\?\(\d\+\|\l\|\#\| @\) [.)].*$/ nextgroup =pandocListItem,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocDelimitedCodeBlock,pandocListItemContinuation contains =@Spell,pandocEmphasis,pandocStrong,pandocNoFormatted,pandocStrikeout,pandocSubscript,pandocSuperscript,pandocStrongEmphasis,pandocStrongEmphasis,pandocPCite,pandocICite,pandocCiteKey,pandocReferenceLabel,pandocLaTeXCommand,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocAutomaticLink,pandocFootnoteDef,pandocFootnoteBlock,pandocFootnoteID,pandocAmpersandEscape skipempty display
433433" support for roman numerals up to 'c'
434434if g: pandoc #syntax #roman_lists != 0
435- syn match pandocListItem / ^\s *(\? x\= l\=\( i\{ ,3}[vx]\=\)\{ ,3}c\{ ,3}[.)].*$/ nextgroup =pandocListItem,pandocMathBlock,pandocLaTeXInlineMath,pandocDelimitedCodeBlock,pandocListItemContinuation,pandocAutomaticLink skipempty display
435+ syn match pandocListItem / ^\s *(\? x\= l\=\( i\{ ,3}[vx]\=\)\{ ,3}c\{ ,3}[.)].*$/ nextgroup =pandocListItem,pandocMathBlock,pandocLaTeXInlineMath,pandocDelimitedCodeBlock,pandocListItemContinuation,pandocAutomaticLink skipempty display
436436endif
437437syn match pandocListItemBullet / ^(\? .\{ -}[.)]/ contained containedin =pandocListItem
438438syn match pandocListItemBulletId / \(\d\+\|\l\|\#\| @.\{ -}\| x\= l\=\( i\{ ,3}[vx]\=\)\{ ,3}c\{ ,3}\) / contained containedin =pandocListItemBullet
0 commit comments