@@ -19,13 +19,13 @@ endif
19
19
" cchars used in conceal rules {{{2
20
20
" utf-8 defaults (preferred)
21
21
if &encoding == " utf-8"
22
- let s: cchars = {
23
- \" newline" : " ↵" ,
24
- \" image" : " ▨" ,
25
- \" super" : " ⁿ" ,
26
- \" sub" : " ₙ" ,
27
- \" strike" : " x ̶" ,
28
- \" atx" : " §" ,
22
+ let s: cchars = {
23
+ \" newline" : " ↵" ,
24
+ \" image" : " ▨" ,
25
+ \" super" : " ⁿ" ,
26
+ \" sub" : " ₙ" ,
27
+ \" strike" : " x ̶" ,
28
+ \" atx" : " §" ,
29
29
\" codelang" : " λ" ,
30
30
\" codeend" : " —" ,
31
31
\" abbrev" : " →" ,
@@ -36,13 +36,13 @@ if &encoding == "utf-8"
36
36
\" html_c_e" : " ›" }
37
37
else
38
38
" ascii defaults
39
- let s: cchars = {
40
- \" newline" : " " ,
41
- \" image" : " i " ,
42
- \" super" : " ^" ,
43
- \" sub" : " _" ,
44
- \" strike" : " ~" ,
45
- \" atx" : " #" ,
39
+ let s: cchars = {
40
+ \" newline" : " " ,
41
+ \" image" : " i " ,
42
+ \" super" : " ^" ,
43
+ \" sub" : " _" ,
44
+ \" strike" : " ~" ,
45
+ \" atx" : " #" ,
46
46
\" codelang" : " l " ,
47
47
\" codelang" : " - " ,
48
48
\" abbrev" : " a " ,
@@ -63,7 +63,7 @@ if !exists("g:pandoc#syntax#conceal#urls")
63
63
let g: pandoc #syntax #conceal#urls = 0
64
64
endif
65
65
" should backslashes in escapes be concealed? {{{2
66
- if ! exists (" g:pandoc#syntax#conceal#backslash" )
66
+ if ! exists (" g:pandoc#syntax#conceal#backslash" )
67
67
let g: pandoc #syntax #conceal#backslash = 0
68
68
endif
69
69
" }}}2
@@ -132,7 +132,7 @@ function! EnableEmbedsforCodeblocksWithLang(entry)
132
132
\' contains= @ ' . toupper (s: langname )
133
133
exe " syn region pandocDelimitedCodeBlockinBlockQuote_" . s: langname . ' start=/>\s\(`\{3,}`*\|\~\{3,}\~*\)\s*\%({[^.]*\.\)\=' . s: langname . ' \>/' .
134
134
\ ' end=/\(`\{3,}`*\|\~\{3,}\~*\)/ contained containedin=pandocDelimitedCodeBlock' .
135
- \' contains= @ ' . toupper (s: langname ) .
135
+ \' contains= @ ' . toupper (s: langname ) .
136
136
\" ,pandocDelimitedCodeBlockStart,pandocDelimitedCodeBlockEnd,pandodDelimitedCodeblockLang,pandocBlockQuoteinDelimitedCodeBlock"
137
137
catch /E484/
138
138
echo " No syntax file found for '" . s: langsyntaxfile . " '"
@@ -197,22 +197,22 @@ call s:WithConceal('html_c_e', 'syn match pandocHTMLCommentEnd /-->/ contained',
197
197
" Unset current_syntax so the 2nd include will work
198
198
unlet b: current_syntax
199
199
syn include @LATEX syntax/tex.vim
200
- syn region pandocLaTeXInlineMath start =/ \\\@ <!\$ [[:graph:]]\@ =/ end =/ \\\@ <!\$ / keepend contains =@LATEX
201
- syn region pandocLaTeXInlineMath start =/ \\\@ <!\\ ([[:graph:]]\@ =/ end =/ \\\@ <!\\ )/ keepend contains =@LATEX
200
+ syn region pandocLaTeXInlineMath start =/ \\\@ <!\$ [[:graph:]]\@ =/ end =/ \\\@ <!\$ / keepend contains =@LATEX
201
+ syn region pandocLaTeXInlineMath start =/ \\\@ <!\\ ([[:graph:]]\@ =/ end =/ \\\@ <!\\ )/ keepend contains =@LATEX
202
202
syn match pandocProtectedFromInlineLaTeX / \\\@ <!\$ {.*}\(\(\s\| [[:punct:]]\)\( [^$]*\| .*\(\\\$ .*\)\{ 2}\)\n\n\| $\)\@ =/ display
203
203
" contains=@LATEX
204
204
syn region pandocLaTeXMathBlock start =/ \$\$ / end =/ \$\$ / keepend contains =@LATEX
205
- syn match pandocLaTeXCommand / \\ [[:alpha:]]\+\(\( {.\{ -}}\)\=\(\[ .\{ -}\]\)\=\) */ contains =@LATEX
205
+ syn match pandocLaTeXCommand / \\ [[:alpha:]]\+\(\( {.\{ -}}\)\=\(\[ .\{ -}\]\)\=\) */ contains =@LATEX
206
206
syn region pandocLaTeXRegion start =/ \\ begin{\z (.\{ -}\) }/ end =/ \\ end{\z 1}/ keepend contains =@LATEX
207
207
" we rehighlight sectioning commands, because otherwise tex.vim captures all text until EOF or a new sectioning command
208
208
syn region pandocLaTexSection start =/ \\\( part\| chapter\|\( sub\)\{ ,2}section\|\( sub\)\= paragraph\)\*\=\(\[ .*\]\)\= {/ end =/ \} / keepend
209
- syn match pandocLaTexSectionCmd / \\\( part\| chapter\|\( sub\)\{ ,2}section\|\( sub\)\= paragraph\) / contained containedin =pandocLaTexSection
209
+ syn match pandocLaTexSectionCmd / \\\( part\| chapter\|\( sub\)\{ ,2}section\|\( sub\)\= paragraph\) / contained containedin =pandocLaTexSection
210
210
syn match pandocLaTeXDelimiter / [[\] {}]/ contained containedin=pandocLaTexSection
211
211
" }}}}
212
212
" }}}2
213
213
" Titleblock: {{{2
214
214
"
215
- syn region pandocTitleBlock start =/ \% ^%/ end =/ \n\n / contains =pandocReferenceLabel,pandocReferenceURL,pandocNewLine
215
+ syn region pandocTitleBlock start =/ \% ^%/ end =/ \n\n / contains =pandocReferenceLabel,pandocReferenceURL,pandocNewLine
216
216
call s: WithConceal (" titleblock" , ' syn match pandocTitleBlockMark /%\ / contained containedin=pandocTitleBlock,pandocTitleBlockTitle' , ' conceal' )
217
217
syn match pandocTitleBlockTitle / \% ^%.*\n / contained containedin =pandocTitleBlock
218
218
" }}}
@@ -235,12 +235,12 @@ syn region pandocReferenceLabel matchgroup=Operator start=/!\{,1}\\\@<!\[/ skip=
235
235
if g: pandoc #syntax #conceal#urls == 1
236
236
syn region pandocReferenceURL matchgroup =Operator start =/ \]\@ 1<=(/ end =/ )/ keepend display conceal
237
237
else
238
- syn region pandocReferenceURL matchgroup =Operator start =/ \]\@ 1<=(/ end =/ )/ keepend display
238
+ syn region pandocReferenceURL matchgroup =Operator start =/ \]\@ 1<=(/ end =/ )/ keepend display
239
239
endif
240
240
" let's not consider "a [label] a" as a label, remove formatting - Note: breaks implicit links
241
241
syn match pandocNoLabel / \]\@ 1<!\(\s\{ ,3}\| ^\)\[ [^\[\] ]\{ -}\]\(\s\+\| $\) [\[ (]\@ !/ contains =pandocPCite
242
242
syn match pandocLinkTip / \s *".\{ -}"/ contained containedin =pandocReferenceURL contains =@Spell display
243
- call s: WithConceal (" image" , ' syn match pandocImageIcon /!\[\@=/ display' , ' conceal cchar=' . s: cchars [" image" ])
243
+ call s: WithConceal (" image" , ' syn match pandocImageIcon /!\[\@=/ display' , ' conceal cchar=' . s: cchars [" image" ])
244
244
" }}}
245
245
" Definitions: {{{3
246
246
syn region pandocReferenceDefinition start =/ \[ .\{ -}\] :/ end =/ \(\n\s *".*"$\| $\) / keepend
@@ -297,7 +297,7 @@ call s:WithConceal("inlinecode", 'syn region pandocNoFormattedInEmphasis matchgr
297
297
call s: WithConceal (" inlinecode" , ' syn region pandocNoFormattedInStrong matchgroup=Operator start=/\\\@<!``/ end=/\\\@<!``/ nextgroup=pandocNoFormattedAttrs contained' , ' concealends' )
298
298
syn match pandocNoFormattedAttrs / {.\{ -}}/ contained
299
299
" }}}
300
- " Subscripts: {{{3
300
+ " Subscripts: {{{3
301
301
syn region pandocSubscript start =/ \~\(\( [[:graph:]]\(\\ \)\=\)\{ -}\~\)\@ =/ end =/ \~ / keepend
302
302
call s: WithConceal (" subscript" , ' syn match pandocSubscriptMark /\~/ contained containedin=pandocSubscript' , ' conceal cchar=' .s: cchars [" sub" ])
303
303
" }}}
@@ -341,11 +341,11 @@ syn region pandocTableMultilineHeader start=/\%#=2\(^-\+\n\)\@<=./ end=/\%#=2\n-
341
341
syn region pandocGridTable start =/ \% #=2\n\@ 1<=+-/ end =/ +\n\n / containedin =ALLBUT,pandocDelimitedCodeBlock,pandocYAMLHeader keepend
342
342
syn match pandocGridTableDelims / [\| =]/ contained containedin =pandocGridTable
343
343
syn match pandocGridTableDelims / \% #=2\( [\- +][\- +=]\@ =\| [\- +=]\@ 1<=[\- +]\) / contained containedin =pandocGridTable
344
- syn match pandocGridTableHeader / \% #=2\( ^.*\n\)\( +=.*\)\@ =/ contained containedin =pandocGridTable
344
+ syn match pandocGridTableHeader / \% #=2\( ^.*\n\)\( +=.*\)\@ =/ contained containedin =pandocGridTable
345
345
" }}}3
346
346
" Pipe: {{{3
347
347
" with beginning and end pipes
348
- syn region pandocPipeTable start =/ \% #=2\( [+|]\n\)\@ <!\n\@ 1<=|\( .*|\)\@ =/ end =/ |.*\n\(\n\| {\) / containedin =ALLBUT,pandocDelimitedCodeBlock,pandocYAMLHeader keepend
348
+ syn region pandocPipeTable start =/ \% #=2\( [+|]\n\)\@ <!\n\@ 1<=|\( .*|\)\@ =/ end =/ |.*\n\(\n\| {\) / containedin =ALLBUT,pandocDelimitedCodeBlock,pandocYAMLHeader keepend
349
349
" without beginning and end pipes
350
350
syn region pandocPipeTable start =/ \% #=2^.*\n -.\{ -}|/ end =/ |.*\n\n / keepend
351
351
syn match pandocPipeTableDelims / [\|\- :+]/ contained containedin =pandocPipeTable
@@ -359,7 +359,7 @@ syn match pandocTableHeaderWord /\<.\{-}\>/ contained containedin=pandocGridTabl
359
359
syn region pandocDelimitedCodeBlock start =/ ^\( >\s\)\?\z (\(\s\{ 4,}\)\=\~\{ 3,}\~ *\) / end =/ ^\z 1\~ */ skipnl contains =pandocDelimitedCodeBlockStart,pandocDelimitedCodeBlockEnd keepend
360
360
syn region pandocDelimitedCodeBlock start =/ ^\( >\s\)\?\z (\(\s\{ 4,}\)\= `\{ 3,}`*\) / end =/ ^\z 1`*/ skipnl contains =pandocDelimitedCodeBlockStart,pandocDelimitedCodeBlockEnd keepend
361
361
call s: WithConceal (" codeblock_start" , ' syn match pandocDelimitedCodeBlockStart /\(\_^\n\_^\(>\s\)\?\(\s\{4,}\)\=\)\@<=\(\~\{3,}\~*\|`\{3,}`*\)/ contained containedin=pandocDelimitedCodeBlock nextgroup=pandocDelimitedCodeBlockLanguage' , ' conceal cchar=' .s: cchars [" codelang" ])
362
- syn match pandocDelimitedCodeBlockLanguage / \(\s\?\)\@ <=.\+\(\_ $\)\@ =/ contained
362
+ syn match pandocDelimitedCodeBlockLanguage / \(\s\?\)\@ <=.\+\(\_ $\)\@ =/ contained
363
363
call s: WithConceal (" codeblock_delim" , ' syn match pandocDelimitedCodeBlockEnd /\(`\{3,}`*\|\~\{3,}\~*\)\(\_$\n\(>\s\)\?\_$\)\@=/ contained containedin=pandocDelimitedCodeBlock' , ' conceal cchar=' .s: cchars [" codeend" ])
364
364
syn match pandocBlockQuoteinDelimitedCodeBlock ' ^>' contained containedin =pandocDelimitedCodeBlock
365
365
syn match pandocCodePre / <pre>.\{ -}<\/ pre>/ skipnl
@@ -390,7 +390,7 @@ call s:WithConceal('abbrev', 'syn match pandocAbbreviationTail /\]/ contained co
390
390
"
391
391
syn match pandocFootnoteID / \[\^ [^\] ]\+\] / nextgroup =pandocFootnoteDef
392
392
" Inline footnotes
393
- syn region pandocFootnoteDef start =/ \^\[ / end =/ \] / contains =pandocReferenceLabel,pandocReferenceURL,pandocLatex,pandocPCite,,pandocEnDash,pandocEmDash,pandocEllipses,pandocBeginQuote,pandocEndQuote,@Spell skipnl keepend
393
+ syn region pandocFootnoteDef start =/ \^\[ / end =/ \] / contains =pandocReferenceLabel,pandocReferenceURL,pandocLatex,pandocPCite,,pandocEnDash,pandocEmDash,pandocEllipses,pandocBeginQuote,pandocEndQuote,@Spell skipnl keepend
394
394
call s: WithConceal (" footnote" , ' syn match pandocFootnoteDefHead /\^\[/ contained containedin=pandocFootnoteDef' , ' conceal cchar=' .s: cchars [" footnote" ])
395
395
call s: WithConceal (" footnote" , ' syn match pandocFootnoteDefTail /\]/ contained containedin=pandocFootnoteDef' , ' conceal' )
396
396
@@ -408,15 +408,15 @@ syn match pandocUListItem /^>\=\s*[*+-]\s\+-\@!.*$/ nextgroup=pandocUListItem,pa
408
408
call s: WithConceal (' list' , ' syn match pandocUListItemBullet /^>\=\s*\zs[*+-]/ contained containedin=pandocUListItem' , ' conceal cchar=' .s: cchars [' li' ])
409
409
410
410
" Ordered lists
411
- 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 skipempty display
411
+ 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 skipempty display
412
412
" support for roman numerals up to 'c'
413
413
if g: pandoc #syntax #roman_lists != 0
414
- syn match pandocListItem / ^\s *(\? x\= l\=\( i\{ ,3}[vx]\=\)\{ ,3}c\{ ,3}[.)].*$/ nextgroup =pandocListItem,pandocMathBlock,pandocLaTeXInlineMath,pandocDelimitedCodeBlock,pandocListItemContinuation,pandocAutomaticLink skipempty display
414
+ syn match pandocListItem / ^\s *(\? x\= l\=\( i\{ ,3}[vx]\=\)\{ ,3}c\{ ,3}[.)].*$/ nextgroup =pandocListItem,pandocMathBlock,pandocLaTeXInlineMath,pandocDelimitedCodeBlock,pandocListItemContinuation,pandocAutomaticLink skipempty display
415
415
endif
416
416
syn match pandocListItemBullet / ^(\? .\{ -}[.)]/ contained containedin =pandocListItem
417
417
syn match pandocListItemBulletId / \(\d\+\|\l\|\#\| @.\{ -}\| x\= l\=\( i\{ ,3}[vx]\=\)\{ ,3}c\{ ,3}\) / contained containedin =pandocListItemBullet
418
418
419
- syn match pandocListItemContinuation / ^\s\+\( [-+*]\s\+\| (\? .\+ [).]\)\@ <!\( [[:alpha:]ñäëïöüáéíóúàèìòùłßÄËÏÖÜÁÉÍÓÚÀÈÌÒÙŁß_"[]\|\*\S\)\@ =.*$/ nextgroup=pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocDelimitedCodeBlock,pandocListItemContinuation,pandocListItem contains=@Spell,pandocEmphasis,pandocStrong,pandocNoFormatted,pandocStrikeout,pandocSubscript,pandocSuperscript,pandocStrongEmphasis,pandocStrongEmphasis,pandocPCite,pandocICite,pandocCiteKey,pandocReferenceLabel,pandocReferenceURL,pandocLaTeXCommand,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocAutomaticLink contained skipempty display
419
+ syn match pandocListItemContinuation / ^\s\+\( [-+*]\s\+\| (\? .\+ [).]\)\@ <!\( [[:alpha:]ñäëïöüáéíóúàèìòùłßÄËÏÖÜÁÉÍÓÚÀÈÌÒÙŁß_"[]\|\*\S\)\@ =.*$/ nextgroup=pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocDelimitedCodeBlock,pandocListItemContinuation,pandocListItem contains=@Spell,pandocEmphasis,pandocStrong,pandocNoFormatted,pandocStrikeout,pandocSubscript,pandocSuperscript,pandocStrongEmphasis,pandocStrongEmphasis,pandocPCite,pandocICite,pandocCiteKey,pandocReferenceLabel,pandocReferenceURL,pandocLaTeXCommand,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocAutomaticLink contained skipempty display
420
420
" }}}
421
421
" Definitions: {{{2
422
422
"
0 commit comments