Skip to content

Commit 19d33e0

Browse files
committed
some cleanup.
1 parent 89d8921 commit 19d33e0

File tree

1 file changed

+81
-82
lines changed

1 file changed

+81
-82
lines changed

syntax/pandoc.vim

Lines changed: 81 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
" vi: fdm=marker
1+
" vim: set fdm=marker foldlevel=0:
2+
"
23
" Vim syntax file
4+
"
35
" Language: Pandoc (superset of Markdown)
46
" Maintainer: Felipe Morales <[email protected]>
57
" Contributor: David Sanson <[email protected]>
@@ -9,7 +11,7 @@
911

1012
" Configuration: {{{1
1113
"
12-
" use conceal {{{2
14+
" use conceal? {{{2
1315
if !exists("g:pandoc#syntax#conceal#use")
1416
if v:version < 703
1517
let g:pandoc#syntax#conceal#use = 0
@@ -113,7 +115,12 @@ if !exists("g:pandoc#syntax#colorcolumn")
113115
let g:pandoc#syntax#colorcolumn = 0
114116
endif
115117
" }}}2
118+
" highlight new lines? {{{2
119+
if !exists("g:pandoc#syntax#newlines")
120+
let g:pandoc#syntax#newlines = 1
121+
endif
116122
" }}}
123+
"}}}1
117124

118125
" Functions: {{{1
119126
" EnableEmbedsforCodeblocksWithLang {{{2
@@ -163,16 +170,23 @@ command! -buffer -nargs=1 -complete=syntax PandocHighlight call EnableEmbedsforC
163170
command! -buffer -nargs=1 -complete=syntax PandocUnhighlight call DisableEmbedsforCodeblocksWithLang(<f-args>)
164171
" }}}
165172

166-
" BASE: {{{1
173+
" BASE:
167174
syntax clear
175+
syntax spell toplevel
176+
" apply extra settings: {{{1
177+
if g:pandoc#syntax#colorcolumn == 1
178+
exe "setlocal colorcolumn=".string(&textwidth+5)
179+
elseif g:pandoc#syntax#colorcolumn == 2
180+
exe "setlocal colorcolumn=".join(range(&textwidth+5, 2*&columns), ',')
181+
endif
168182
if g:pandoc#syntax#conceal#use != 0
169183
setlocal conceallevel=2
170184
endif
171-
syntax spell toplevel
172-
"}}}
185+
"}}}1
173186

174-
" Embeds: {{{1
175-
" HTML: {{{2
187+
" Syntax Rules: {{{1
188+
" Embeds: {{{2
189+
" HTML: {{{3
176190
" Set embedded HTML highlighting
177191
syn include @HTML syntax/html.vim
178192
syn match pandocHTML /<\/\?\a[^>]\+>/ contains=@HTML
@@ -181,7 +195,7 @@ syn region pandocHTMLComment start=/<!--\s\=/ end=/\s\=-->/ keepend contains=pan
181195
call s:WithConceal('html_c_s', 'syn match pandocHTMLCommentStart /<!--/ contained', 'conceal cchar='.s:cchars['html_c_s'])
182196
call s:WithConceal('html_c_e', 'syn match pandocHTMLCommentEnd /-->/ contained', 'conceal cchar='.s:cchars['html_c_e'])
183197
" }}}
184-
" LaTeX: {{{2
198+
" LaTeX: {{{3
185199
" Set embedded LaTex (pandoc extension) highlighting
186200
" Unset current_syntax so the 2nd include will work
187201
unlet b:current_syntax
@@ -196,34 +210,28 @@ syn region pandocLaTeXRegion start=/\\begin{\z(.\{-}\)}/ end=/\\end{\z1}/ keepen
196210
syn region pandocLaTexSection start=/\\\(part\|chapter\|\(sub\)\{,2}section\|\(sub\)\=paragraph\)\*\=\(\[.*\]\)\={/ end=/\}/ keepend
197211
syn match pandocLaTexSectionCmd /\\\(part\|chapter\|\(sub\)\{,2}section\|\(sub\)\=paragraph\)/ contained containedin=pandocLaTexSection
198212
syn match pandocLaTeXDelimiter /[[\]{}]/ contained containedin=pandocLaTexSection
199-
hi link pandocLaTexSectionCmd texSection
200-
hi link pandocLaTeXDelimiter texDelimiter
201213
" }}}}
202-
" }}}
203-
204-
" Titleblock: {{{1
214+
" }}}2
215+
" Titleblock: {{{2
205216
"
206217
syn region pandocTitleBlock start=/\%^%/ end=/\n\n/ contains=pandocReferenceLabel,pandocReferenceURL,pandocNewLine
207218
call s:WithConceal("titleblock", 'syn match pandocTitleBlockMark /%\ / contained containedin=pandocTitleBlock,pandocTitleBlockTitle', 'conceal')
208219
syn match pandocTitleBlockTitle /\%^%.*\n/ contained containedin=pandocTitleBlock
209220
"}}}
210-
211-
" Blockquotes: {{{1
221+
" Blockquotes: {{{2
212222
"
213223
syn match pandocBlockQuote /^\s\{,3}>.*\n\(.*\n\@1<!\n\)*/ contains=@Spell,pandocEmphasis,pandocStrong,pandocPCite,pandocSuperscript,pandocSubscript,pandocStrikeout,pandocUListItem,pandocNoFormatted skipnl
214224

215225
" }}}
216-
217-
" Code Blocks: {{{1
226+
" Code Blocks: {{{2
218227
if g:pandoc#syntax#protect#codeblocks == 1
219228
syn match pandocCodeblock /\s\{4}.*$/
220229
endif
221230
syn region pandocCodeBlockInsideIndent start=/\(\(\d\|\a\|*\).*\n\)\@<!\(^\(\s\{8,}\|\t\+\)\).*\n/ end=/.\(\n^\s*\n\)\@=/ contained
222231
"}}}
223-
224-
" Links: {{{1
232+
" Links: {{{2
225233
"
226-
" Base: {{{2
234+
" Base: {{{3
227235
syn region pandocReferenceLabel matchgroup=Operator start=/!\{,1}\[/ skip=/\(\]\]\@=\|`.*].*`\)/ end=/\]/ keepend display
228236
if g:pandoc#syntax#conceal#urls == 1
229237
syn region pandocReferenceURL matchgroup=Operator start=/\]\@1<=(/ end=/)/ keepend display conceal
@@ -235,18 +243,17 @@ syn match pandocNoLabel /\]\@1<!\s\+\[[^\[\]]\{-}\]\s\+[\[(]\@!/ contains=pandoc
235243
syn match pandocLinkTip /\s*".\{-}"/ contained containedin=pandocReferenceURL contains=@Spell display
236244
call s:WithConceal("image", 'syn match pandocImageIcon /!\[\@=/ display', 'conceal cchar='. s:cchars["image"])
237245
" }}}
238-
" Definitions: {{{2
246+
" Definitions: {{{3
239247
syn region pandocReferenceDefinition start=/\[.\{-}\]:/ end=/\(\n\s*".*"$\|$\)/ keepend
240248
syn match pandocReferenceDefinitionLabel /\[\zs.\{-}\ze\]:/ contained containedin=pandocReferenceDefinition display
241249
syn match pandocReferenceDefinitionAddress /:\s*\zs.*/ contained containedin=pandocReferenceDefinition
242250
syn match pandocReferenceDefinitionTip /\s*".\{-}"/ contained containedin=pandocReferenceDefinition,pandocReferenceDefinitionAddress contains=@Spell
243251
"}}}
244-
" Automatic_links: {{{2
252+
" Automatic_links: {{{3
245253
syn match pandocAutomaticLink /<\(https\{0,1}.\{-}\|.\{-}@.\{-}\..\{-}\)>/
246254
" }}}
247255
"}}}
248-
249-
" Citations: {{{1
256+
" Citations: {{{2
250257
" parenthetical citations
251258
syn match pandocPCite /\[.\{-}-\{0,1}@.\{-}\]/ contains=pandocEmphasis,pandocStrong,pandocLatex,pandocCiteKey,@Spell display
252259
" in-text citations with location
@@ -256,31 +263,30 @@ syn match pandocCiteKey /\(-\=@[[:graph:]äëïöüáéíóúàèìòùłßÄË
256263
syn match pandocCiteAnchor /[-@]/ contained containedin=pandocCiteKey display
257264
syn match pandocCiteLocator /[\[\]]/ contained containedin=pandocPCite,pandocICite
258265
" }}}
266+
" Text Styles: {{{2
259267

260-
" Text Styles: {{{1
261-
262-
" Emphasis: {{{2
268+
" Emphasis: {{{3
263269
"
264270
call s:WithConceal("block", 'syn region pandocEmphasis matchgroup=Operator start=/\\\@1<!\(\_^\|\s\|[[:punct:]]\)\@<=\*\S\@=/ skip=/\(\*\*\|__\)/ end=/\*\([[:punct:]]\|\s\|\_$\)\@=/ contains=@Spell,pandocNoFormattedInEmphasis,pandocLatexInlineMath', 'concealends')
265271
call s:WithConceal("block", 'syn region pandocEmphasis matchgroup=Operator start=/\\\@1<!\(\_^\|\s\|[[:punct:]]\)\@<=_\S\@=/ skip=/\(\*\*\|__\)/ end=/\S\@1<=_\([[:punct:]]\|\s\|\_$\)\@=/ contains=@Spell,pandocNoFormattedInEmphasis,pandocLatexInlineMath', 'concealends')
266272
" }}}
267-
" Strong: {{{2
273+
" Strong: {{{3
268274
"
269275
call s:WithConceal("block", 'syn region pandocStrong matchgroup=Operator start=/\(\\\@<!\*\)\{2}/ end=/\(\\\@<!\*\)\{2}/ contains=@Spell,pandocNoFormattedInStrong,pandocLatexInlineMath', 'concealends')
270276
call s:WithConceal("block", 'syn region pandocStrong matchgroup=Operator start=/__/ end=/__/ contains=@Spell,pandocNoFormattedInStrong,pandocLatexInlineMath', 'concealends')
271277
"}}}
272-
" Strong Emphasis: {{{2
278+
" Strong Emphasis: {{{3
273279
"
274280
call s:WithConceal("block", 'syn region pandocStrongEmphasis matchgroup=Operator start=/\*\{3}\(\S[^*]*\(\*\S\|\n[^*]*\*\S\)\)\@=/ end=/\S\@<=\*\{3}/ contains=@Spell', 'concealends')
275281
call s:WithConceal("block", 'syn region pandocStrongEmphasis matchgroup=Operator start=/\(___\)\S\@=/ end=/\S\@<=___/ contains=@Spell', 'concealends')
276282
" }}}
277-
" Mixed: {{{2
283+
" Mixed: {{{3
278284
call s:WithConceal("block", 'syn region pandocStrongInEmphasis matchgroup=Operator start=/\*\*/ end=/\*\*/ contained containedin=pandocEmphasis contains=@Spell', 'concealends')
279285
call s:WithConceal("block", 'syn region pandocStrongInEmphasis matchgroup=Operator start=/__/ end=/__/ contained containedin=pandocEmphasis contains=@Spell', 'concealends')
280286
call s:WithConceal("block", 'syn region pandocEmphasisInStrong matchgroup=Operator start=/\\\@1<!\(\_^\|\s\|[[:punct:]]\)\@<=\*\S\@=/ skip=/\(\*\*\|__\)/ end=/\S\@<=\*\([[:punct:]]\|\s\|\_$\)\@=/ contained containedin=pandocStrong contains=@Spell', 'concealends')
281287
call s:WithConceal("block", 'syn region pandocEmphasisInStrong matchgroup=Operator start=/\\\@<!\(\_^\|\s\|[[:punct:]]\)\@<=_\S\@=/ skip=/\(\*\*\|__\)/ end=/\S\@<=_\([[:punct:]]\|\s\|\_$\)\@=/ contained containedin=pandocStrong contains=@Spell', 'concealends')
282288

283-
" Inline Code: {{{2
289+
" Inline Code: {{{3
284290

285291
" Using single back ticks
286292
call s:WithConceal("inlinecode", 'syn region pandocNoFormatted matchgroup=Operator start=/\\\@<!`/ end=/\\\@<!`/ nextgroup=pandocNoFormattedAttrs', 'concealends')
@@ -292,21 +298,20 @@ call s:WithConceal("inlinecode", 'syn region pandocNoFormattedInEmphasis matchgr
292298
call s:WithConceal("inlinecode", 'syn region pandocNoFormattedInStrong matchgroup=Operator start=/\\\@<!``/ end=/\\\@<!``/ nextgroup=pandocNoFormattedAttrs contained', 'concealends')
293299
syn match pandocNoFormattedAttrs /{.\{-}}/ contained
294300
"}}}
295-
" Subscripts: {{{2
301+
" Subscripts: {{{3
296302
syn region pandocSubscript start=/\~\(\([[:graph:]]\(\\ \)\=\)\{-}\~\)\@=/ end=/\~/ keepend
297303
call s:WithConceal("subscript", 'syn match pandocSubscriptMark /\~/ contained containedin=pandocSubscript', 'conceal cchar='.s:cchars["sub"])
298304
"}}}
299-
" Superscript: {{{2
305+
" Superscript: {{{3
300306
syn region pandocSuperscript start=/\^\(\([[:graph:]]\(\\ \)\=\)\{-}\^\)\@=/ skip=/\\ / end=/\^/ keepend
301307
call s:WithConceal("superscript", 'syn match pandocSuperscriptMark /\^/ contained containedin=pandocSuperscript', 'conceal cchar='.s:cchars["super"])
302308
"}}}
303-
" Strikeout: {{{2
309+
" Strikeout: {{{3
304310
syn region pandocStrikeout start=/\~\~/ end=/\~\~/ contains=@Spell keepend
305311
call s:WithConceal("strikeout", 'syn match pandocStrikeoutMark /\~\~/ contained containedin=pandocStrikeout', 'conceal cchar='.s:cchars["strike"])
306312
" }}}
307313
" }}}
308-
309-
" Headers: {{{1
314+
" Headers: {{{2
310315
"
311316
syn match pandocAtxHeader /\(\%^\|<.\+>.*\n\|^\s*\n\)\@<=#\{1,6}.*\n/ contains=pandocEmphasis,pandocStrong,pandocNoFormatted,pandocLaTeXInlineMath,@Spell, display
312317
syn match pandocAtxHeaderMark /\(^#\{1,6}\|\\\@<!#\+\(\s*.*$\)\@=\)/ contained containedin=pandocAtxHeader
@@ -316,54 +321,41 @@ syn match pandocSetexHeader /^.\+\n[-]\+$/ contains=pandocEmphasis,pandocStrong,
316321
syn match pandocHeaderAttr /{.*}/ contained containedin=pandocAtxHeader,pandocSetexHeader
317322
syn match pandocHeaderID /#[-_:.[:alpha:]]*/ contained containedin=pandocHeaderAttr
318323
"}}}
319-
320-
" Line Blocks: {{{1
324+
" Line Blocks: {{{2
321325
syn region pandocLineBlock start=/^|/ end=/\(^|\(.*\n|\@!\)\@=.*\)\@<=\n/
322326
syn match pandocLineBlockDelimiter /^|/ contained containedin=pandocLineBlock
323-
hi link pandocLineBlockDelimiter Delimiter
324327
"}}}
328+
" Tables: {{{2
325329

326-
" Tables: {{{1
327-
328-
" Simple: {{{2
330+
" Simple: {{{3
329331

330332
syn region pandocSimpleTable start=/\%#=2\(^.*[[:graph:]].*\n\)\@<!\(^.*[[:graph:]].*\n\)\(-\+\s*\)\+\n\n\@!/ end=/\n\n/ containedin=ALLBUT,pandocDelimitedCodeBlock keepend
331333
syn match pandocSimpleTableDelims /\-/ contained containedin=pandocSimpleTable
332334
syn match pandocSimpleTableHeader /\%#=2\(^.*[[:graph:]].*\n\)\@<!\(^.*[[:graph:]].*\n\)/ contained containedin=pandocSimpleTable
333-
hi link pandocSimpleTableDelims Delimiter
334-
hi link pandocSimpleTableHeader pandocStrong
335335

336336
syn region pandocTable start=/\%#=2^\(-\+\s*\)\+\n\n\@!/ end=/\%#=2^\(-\+\s*\)\+\n\n/ containedin=ALLBUT,pandocDelimitedCodeBlock keepend
337337
syn match pandocTableDelims /\-/ contained containedin=pandocTable
338338
syn region pandocTableMultilineHeader start=/\%#=2\(^-\+\n\)\@<=./ end=/\%#=2\n-\@=/ contained containedin=pandocTable
339-
hi link pandocTableMultilineHeader pandocStrong
340-
hi link pandocTableDelims Delimiter
341339

342-
" }}}2
343-
" Grid: {{{2
340+
" }}}3
341+
" Grid: {{{3
344342
syn region pandocGridTable start=/\%#=2\n\@1<=+-/ end=/+\n\n/ containedin=ALLBUT,pandocDelimitedCodeBlock keepend
345343
syn match pandocGridTableDelims /[\|=]/ contained containedin=pandocGridTable
346344
syn match pandocGridTableDelims /\%#=2\([\-+][\-+=]\@=\|[\-+=]\@1<=[\-+]\)/ contained containedin=pandocGridTable
347345
syn match pandocGridTableHeader /\%#=2\(^.*\n\)\(+=.*\)\@=/ contained containedin=pandocGridTable
348-
hi link pandocGridTableDelims Delimiter
349-
hi link pandocGridTableHeader Delimiter
350-
"}}}2
351-
" Pipe: {{{2
346+
"}}}3
347+
" Pipe: {{{3
352348
" with beginning and end pipes
353349
syn region pandocPipeTable start=/\%#=2\([+|]\n\)\@<!\n\@1<=|\(.*|\)\@=/ end=/|.*\n\n/ containedin=ALLBUT,pandocDelimitedCodeBlock keepend
354350
" without beginning and end pipes
355351
syn region pandocPipeTable start=/\%#=2^.*\n-.\{-}|/ end=/|.*\n\n/ keepend
356352
syn match pandocPipeTableDelims /[\|\-:+]/ contained containedin=pandocPipeTable
357353
syn match pandocPipeTableHeader /\(^.*\n\)\(|-\)\@=/ contained containedin=pandocPipeTable
358354
syn match pandocPipeTableHeader /\(^.*\n\)\(-\)\@=/ contained containedin=pandocPipeTable
359-
hi link pandocPipeTableDelims Delimiter
360-
hi link pandocPipeTableHeader Delimiter
361-
" }}}2
355+
" }}}3
362356
syn match pandocTableHeaderWord /\<.\{-}\>/ contained containedin=pandocGridTableHeader,pandocPipeTableHeader
363-
hi link pandocTableHeaderWord pandocStrong
364-
" }}}1
365-
366-
" Delimited Code Blocks: {{{1
357+
" }}}2
358+
" Delimited Code Blocks: {{{2
367359
" this is here because we can override strikeouts and subscripts
368360
syn region pandocDelimitedCodeBlock start=/^\(>\s\)\?\z(\(\s\{4,}\)\=\~\{3,}\~*\)/ end=/\z1\~*/ skipnl contains=pandocDelimitedCodeBlockStart,pandocDelimitedCodeBlockEnd keepend
369361
syn region pandocDelimitedCodeBlock start=/^\(>\s\)\?\z(\(\s\{4,}\)\=`\{3,}`*\)/ end=/\z1`*/ skipnl contains=pandocDelimitedCodeBlockStart,pandocDelimitedCodeBlockEnd keepend
@@ -387,16 +379,14 @@ if g:pandoc#syntax#codeblocks#embeds#use != 0
387379
endfor
388380
endif
389381
" }}}
390-
391-
" Abbreviations: {{{1
382+
" Abbreviations: {{{2
392383
syn region pandocAbbreviationDefinition start=/^\*\[.\{-}\]:\s*/ end="$" contains=pandocNoFormatted,@Spell
393384
call s:WithConceal('abbrev', 'syn match pandocAbbreviationSeparator /:/ contained containedin=pandocAbbreviationDefinition', "conceal cchar=".s:cchars["abbrev"])
394385
syn match pandocAbbreviation /\*\[.\{-}\]/ contained containedin=pandocAbbreviationDefinition
395386
call s:WithConceal('abbrev', 'syn match pandocAbbreviationHead /\*\[/ contained containedin=pandocAbbreviation', "conceal")
396387
call s:WithConceal('abbrev', 'syn match pandocAbbreviationTail /\]/ contained containedin=pandocAbbreviation', "conceal")
397388
" }}}
398-
399-
" Footnotes: {{{1
389+
" Footnotes: {{{2
400390
" we put these here not to interfere with superscripts.
401391
"
402392
syn match pandocFootnoteID /\[\^[^\]]\+\]/ nextgroup=pandocFootnoteDef
@@ -412,15 +402,13 @@ syn match pandocFootnoteID /\[\^.\{-}\]/ contained containedin=pandocFootnoteBlo
412402
call s:WithConceal("footnote", 'syn match pandocFootnoteIDHead /\[\^/ contained containedin=pandocFootnoteID', 'conceal cchar='.s:cchars["footnote"])
413403
call s:WithConceal("footnote", 'syn match pandocFootnoteIDTail /\]/ contained containedin=pandocFootnoteID', 'conceal')
414404
" }}}
415-
416-
" Definitions: {{{1
405+
" Definitions: {{{2
417406
"
418407
syn region pandocDefinitionBlock start=/^\%(\_^\s*\([`~]\)\1\{2,}\)\@!.*\n\(^\s*\n\)*\s\{0,2}[:~]\(\~\{2,}\~*\)\@!/ skip=/\n\n\zs\s/ end=/\n\n/ contains=pandocDefinitionBlockMark,pandocDefinitionBlockTerm,pandocCodeBlockInsideIndent,pandocEmphasis,pandocStrong,pandocStrongEmphasis,pandocNoFormatted,pandocStrikeout,pandocSubscript,pandocSuperscript,pandocFootnoteID,pandocReferenceURL,pandocReferenceLabel,pandocAutomaticLink,pandocEmDash,pandocEnDash keepend
419408
syn match pandocDefinitionBlockTerm /^.*\n\(^\s*\n\)*\(\s*[:~]\)\@=/ contained contains=pandocNoFormatted,pandocEmphasis,pandocStrong
420409
call s:WithConceal("definition", 'syn match pandocDefinitionBlockMark /^\s*[:~]/ contained', 'conceal cchar='.s:cchars["definition"])
421410
" }}}
422-
423-
" List Items: {{{1
411+
" List Items: {{{2
424412
"
425413
" Unordered lists
426414
syn match pandocUListItem /^>\=\s*[*+-]\s\+-\@!.*$/ nextgroup=pandocUListItem,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocDelimitedCodeBlock,pandocListItemContinuation contains=@Spell,pandocEmphasis,pandocStrong,pandocNoFormatted,pandocStrikeout,pandocSubscript,pandocSuperscript,pandocStrongEmphasis,pandocStrongEmphasis,pandocPCite,pandocICite,pandocCiteKey,pandocReferenceLabel,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocReferenceURL skipempty display
@@ -435,28 +423,28 @@ syn match pandocListItemBulletId /\(\d\+\|\l\|\#\|@.\{-}\|x\=l\=\(i\{,3}[vx]\=\)
435423

436424
syn match pandocListItemContinuation /^\s\+\(\([-+*]\|(\?.\+[).]\)\@<![[:alpha:]ñäëïöüáéíóúàèìòùłßÄËÏÖÜÁÉÍÓÚÀÈÌÒÙŁß_"[]\)\@=.*$/ nextgroup=pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocDelimitedCodeBlock,pandocListItemContinuation,pandocListItem contains=@Spell,pandocEmphasis,pandocStrong,pandocNoFormatted,pandocStrikeout,pandocSubscript,pandocSuperscript,pandocStrongEmphasis,pandocStrongEmphasis,pandocPCite,pandocICite,pandocCiteKey,pandocReferenceLabel,pandocReferenceURL,pandocLaTeXMathBlock,pandocLaTeXInlineMath contained skipempty display
437425
" }}}
426+
" Special: {{{2
438427

439-
" Special: {{{1
440-
441-
" New_lines: {{{2
442-
call s:WithConceal("newline", 'syn match pandocNewLine /\( \|\\\)$/ display containedin=pandocEmphasis,pandocStrong,pandocStrongEmphasis,pandocStrongInEmphasis,pandocEmphasisInStrong', 'conceal cchar='.s:cchars["newline"])
428+
" New_lines: {{{3
429+
if g:pandoc#syntax#newlines == 1
430+
call s:WithConceal("newline", 'syn match pandocNewLine /\( \|\\\)$/ display containedin=pandocEmphasis,pandocStrong,pandocStrongEmphasis,pandocStrongInEmphasis,pandocEmphasisInStrong', 'conceal cchar='.s:cchars["newline"])
431+
endif
443432
"}}}
444-
" Ellipses: {{{2
433+
" Ellipses: {{{3
445434
if &encoding == "utf-8"
446435
call s:WithConceal("ellipses", 'syn match pandocEllipses /\.\.\./ display', 'conceal cchar=…')
447436
endif
448437
" }}}
449-
" Quotes: {{{2
438+
" Quotes: {{{3
450439
if &encoding == "utf-8"
451440
call s:WithConceal("quotes", 'syn match pandocBeginQuote /"\</ containedin=pandocEmphasis,pandocStrong,pandocListItem,pandocListItemContinuation,pandocUListItem display', 'conceal cchar=“')
452441
call s:WithConceal("quotes", 'syn match pandocEndQuote /\(\>[[:punct:]]*\)\@<="[[:blank:][:punct:]\n]\@=/ containedin=pandocEmphasis,pandocStrong,pandocUListItem,pandocListItem,pandocListItemContinuation display', 'conceal cchar=”')
453442
endif
454-
" Hrule: {{{2
443+
" Hrule: {{{3
455444
syn match pandocHRule /\*\{3}$/ display
456445
" }}}
457446
" }}}
458-
459-
" YAML: {{{1
447+
" YAML: {{{2
460448

461449
try
462450
unlet! b:current_syntax
@@ -465,6 +453,7 @@ catch /E484/
465453
endtry
466454
syn region pandocYAMLHeader matchgroup=Delimiter start=/\(\%^\|\(\s*.*\n\)\)\@<=\-\{3}\s*$/ end=/[\-|\.]\{3}\s*$/ contains=@YAML containedin=TOP
467455
"}}}
456+
"}}}1
468457

469458
" Styling: {{{1
470459
" override this for consistency
@@ -476,6 +465,9 @@ hi link pandocSetexHeader Title
476465
hi link pandocHeaderAttr Comment
477466
hi link pandocHeaderID Identifier
478467

468+
hi link pandocLaTexSectionCmd texSection
469+
hi link pandocLaTeXDelimiter texDelimiter
470+
479471
hi link pandocHTMLComment Comment
480472
hi link pandocHTMLCommentStart Delimiter
481473
hi link pandocHTMLCommentEnd Delimiter
@@ -497,6 +489,9 @@ hi link pandocDelimitedCodeBlockEnd Delimiter
497489
hi link pandocDelimitedCodeBlockLanguage Comment
498490
hi link pandocBlockQuoteinDelimitedCodeBlock pandocBlockQuote
499491
hi link pandocCodePre String
492+
493+
hi link pandocLineBlockDelimiter Delimiter
494+
500495
hi link pandocListItemBullet Operator
501496
hi link pandocUListItemBullet Operator
502497
hi link pandocListItemBulletId Identifier
@@ -516,6 +511,16 @@ hi link pandocAutomaticLink Underlined
516511
hi link pandocDefinitionBlockTerm Identifier
517512
hi link pandocDefinitionBlockMark Operator
518513

514+
hi link pandocSimpleTableDelims Delimiter
515+
hi link pandocSimpleTableHeader pandocStrong
516+
hi link pandocTableMultilineHeader pandocStrong
517+
hi link pandocTableDelims Delimiter
518+
hi link pandocGridTableDelims Delimiter
519+
hi link pandocGridTableHeader Delimiter
520+
hi link pandocPipeTableDelims Delimiter
521+
hi link pandocPipeTableHeader Delimiter
522+
hi link pandocTableHeaderWord pandocStrong
523+
519524
hi link pandocAbbreviationHead Type
520525
hi link pandocAbbreviation Label
521526
hi link pandocAbbreviationTail Type
@@ -577,9 +582,3 @@ let b:current_syntax = "pandoc"
577582

578583
syntax sync clear
579584
syntax sync minlines=100
580-
581-
if g:pandoc#syntax#colorcolumn == 1
582-
exe "setlocal colorcolumn=".string(&textwidth+5)
583-
elseif g:pandoc#syntax#colorcolumn == 2
584-
exe "setlocal colorcolumn=".join(range(&textwidth+5, 2*&columns), ',')
585-
endif

0 commit comments

Comments
 (0)