robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
c752016976
master
1scriptencoding utf-8 2" Vim syntax file 3" Language: Pandoc (superset of Markdown) 4" Maintainer: Felipe Morales <hel.sheep@gmail.com> 5" Maintainer: Caleb Maclennan <caleb@alerque.com> 6" Upstream: https://github.com/vim-pandoc/vim-pandoc-syntax/tree/ea3fc415784bdcbae7f0093b80070ca4ff9e44c8 7" Contributor: David Sanson <dsanson@gmail.com> 8" Jorge Israel Peña <jorge.israel.p@gmail.com> 9" Christian Brabandt @chrisbra 10" Original Author: Jeremy Schultz <taozhyn@gmail.com> 11" Version: 5.0 12" Last Change: 2024 Apr 08 13" 2025 Jun 27 by Vim project: sync with upstream (#17598) 14 15if exists ( 'b:current_syntax' ) 16finish 17endif 18 19let s: cpo_save = & cpoptions 20set cpoptions & vim 21 22" Configuration: {{{1 23" 24" use conceal? {{{2 25if ! exists ( 'g:pandoc#syntax#conceal#use' ) 26let g: pandoc#syntax#conceal#use = 1 27endif 28"}}}2 29 30" what groups not to use conceal in. works as a blacklist {{{2 31if ! exists ( 'g:pandoc#syntax#conceal#blacklist' ) 32let g: pandoc#syntax#conceal#blacklist = [] 33endif 34" }}}2 35 36" cchars used in conceal rules {{{2 37" utf-8 defaults (preferred) 38if & encoding ==# 'utf-8' 39let s: cchars = { 40 \'newline' : '↵' , 41 \'image' : '▨' , 42 \'super' : 'ⁿ' , 43 \'sub' : 'ₙ' , 44 \'strike' : 'x̶' , 45 \'atx' : '§' , 46 \'codelang' : 'λ' , 47 \'codeend' : '—' , 48 \'abbrev' : '→' , 49 \'footnote' : '†' , 50 \'definition' : ' ' , 51 \'li' : '•' , 52 \'html_c_s' : '‹' , 53 \'html_c_e' : '›' , 54 \'quote_s' : '“' , 55 \'quote_e' : '”' } 56else 57" ascii defaults 58let s: cchars = { 59 \'newline' : ' ' , 60 \'image' : 'i' , 61 \'super' : '^' , 62 \'sub' : '_' , 63 \'strike' : '~' , 64 \'atx' : '#' , 65 \'codelang' : 'l' , 66 \'codeend' : '-' , 67 \'abbrev' : 'a' , 68 \'footnote' : 'f' , 69 \'definition' : ' ' , 70 \'li' : '*' , 71 \'html_c_s' : '+' , 72 \'html_c_e' : '+' } 73endif 74" }}}2 75 76" if the user has a dictionary with replacements for the default cchars, use those {{{2 77if exists ( 'g:pandoc#syntax#conceal#cchar_overrides' ) 78let s: cchars = extend ( s: cchars , g: pandoc#syntax#conceal#cchar_overrides ) 79endif 80" }}}2 81 82"should the urls in links be concealed? {{{2 83if ! exists ( 'g:pandoc#syntax#conceal#urls' ) 84let g: pandoc#syntax#conceal#urls = 0 85endif 86" should backslashes in escapes be concealed? {{{2 87if ! exists ( 'g:pandoc#syntax#conceal#backslash' ) 88let g: pandoc#syntax#conceal#backslash = 0 89endif 90" }}}2 91 92" leave specified codeblocks as Normal (i.e. 'unhighlighted') {{{2 93if ! exists ( 'g:pandoc#syntax#codeblocks#ignore' ) 94let g: pandoc#syntax#codeblocks#ignore = [] 95endif 96" }}}2 97 98" use embedded highlighting for delimited codeblocks where a language is specifed. {{{2 99if ! exists ( 'g:pandoc#syntax#codeblocks#embeds#use' ) 100let g: pandoc#syntax#codeblocks#embeds#use = 1 101endif 102" }}}2 103 104" for what languages and using what vim syntax files highlight those embeds. {{{2 105" defaults to None. 106if ! exists ( 'g:pandoc#syntax#codeblocks#embeds#langs' ) 107let g: pandoc#syntax#codeblocks#embeds#langs = [] 108endif 109" }}}2 110 111" use italics ? {{{2 112if ! exists ( 'g:pandoc#syntax#style#emphases' ) 113let g: pandoc#syntax#style#emphases = 1 114endif 115" if 0, we don't conceal the emphasis marks, otherwise there wouldn't be a way 116" to tell where the styles apply. 117if g: pandoc#syntax#style#emphases == 0 118call add ( g: pandoc#syntax#conceal#blacklist , 'block' ) 119endif 120" }}}2 121 122" underline subscript, superscript and strikeout? {{{2 123if ! exists ( 'g:pandoc#syntax#style#underline_special' ) 124let g: pandoc#syntax#style#underline_special = 1 125endif 126" }}}2 127 128" protect code blocks? {{{2 129if ! exists ( 'g:pandoc#syntax#protect#codeblocks' ) 130let g: pandoc#syntax#protect#codeblocks = 1 131endif 132" }}}2 133 134" use color column? {{{2 135if ! exists ( 'g:pandoc#syntax#colorcolumn' ) 136let g: pandoc#syntax#colorcolumn = 0 137endif 138" }}}2 139 140" highlight new lines? {{{2 141if ! exists ( 'g:pandoc#syntax#newlines' ) 142let g: pandoc#syntax#newlines = 1 143endif 144" }}} 145 146" detect roman-numeral list items? {{{2 147if ! exists ( 'g:pandoc#syntax#roman_lists' ) 148let g: pandoc#syntax#roman_lists = 0 149endif 150" }}}2 151 152" disable syntax highlighting for definition lists? (better performances) {{{2 153if ! exists ( 'g:pandoc#syntax#use_definition_lists' ) 154let g: pandoc#syntax#use_definition_lists = 1 155endif 156" }}}2 157 158" }}}1 159 160" Functions: {{{1 161" EnableEmbedsforCodeblocksWithLang {{{2 162function ! EnableEmbedsforCodeblocksWithLang ( entry ) 163" prevent embedded language syntaxes from changing 'foldmethod' 164if has ( 'folding' ) 165let s: foldmethod = & l: foldmethod 166let s: foldtext = & l: foldtext 167endif 168 169try 170let s: langname = matchstr ( a: entry , '^[^=]*' ) 171let s: langsyntaxfile = matchstr ( a: entry , '[^=]*$' ) 172unlet ! b: current_syntax 173exe 'syn include @' . toupper ( s: langname ) . ' syntax/' . s: langsyntaxfile . '.vim' 174" We might have just turned off spellchecking by including the file, 175" so we turn it back on here. 176exe 'syntax spell toplevel' 177exe 'syn region pandocDelimitedCodeBlock_' . s: langname . ' start=/\(\_^\( \+\|\t\)\=\(`\{3,}`*\|\~\{3,}\~*\)\s*\%({[^.]*[.=]\)\=' . s: langname . '\>.*\n\)\@<=\_^/' . 178 \' end=/\_$\n\(\( \+\|\t\)\=\(`\{3,}`*\|\~\{3,}\~*\)\_$\n\_$\)\@=/ contained containedin=pandocDelimitedCodeBlock' . 179 \' contains=@' . toupper ( s: langname ) 180exe 'syn region pandocDelimitedCodeBlockinBlockQuote_' . s: langname . ' start=/>\s\(`\{3,}`*\|\~\{3,}\~*\)\s*\%({[^.]*\.\)\=' . s: langname . '\>/' . 181 \' end=/\(`\{3,}`*\|\~\{3,}\~*\)/ contained containedin=pandocDelimitedCodeBlock' . 182 \' contains=@' . toupper ( s: langname ) . 183 \',pandocDelimitedCodeBlockStart,pandocDelimitedCodeBlockEnd,pandodDelimitedCodeblockLang,pandocBlockQuoteinDelimitedCodeBlock' 184catch /E484/ 185echo "No syntax file found for '" . s: langsyntaxfile . "'" 186endtry 187 188if exists ( 's:foldmethod' ) && s: foldmethod !=# & l: foldmethod 189let & l: foldmethod = s: foldmethod 190endif 191if exists ( 's:foldtext' ) && s: foldtext !=# & l: foldtext 192let & l: foldtext = s: foldtext 193endif 194endfunction 195" }}}2 196 197" DisableEmbedsforCodeblocksWithLang {{{2 198function ! DisableEmbedsforCodeblocksWithLang ( langname ) 199try 200exe 'syn clear pandocDelimitedCodeBlock_' . a: langname 201exe 'syn clear pandocDelimitedCodeBlockinBlockQuote_' . a: langname 202catch /E28/ 203echo "No existing highlight definitions found for '" . a: langname . "'" 204endtry 205endfunction 206" }}}2 207 208" WithConceal {{{2 209function ! s: WithConceal ( rule_group , rule , conceal_rule ) 210let l: rule_tail = '' 211if g: pandoc#syntax#conceal#use != 0 212if index ( g: pandoc#syntax#conceal#blacklist , a: rule_group ) == -1 213let l: rule_tail = ' ' . a: conceal_rule 214endif 215endif 216execute a: rule . l: rule_tail 217endfunction 218" }}}2 219 220" }}}1 221 222" Commands: {{{1 223command ! -buffer -nargs = 1 -complete = syntax PandocHighlight call EnableEmbedsforCodeblocksWithLang(<f-args>) 224command ! -buffer -nargs = 1 -complete = syntax PandocUnhighlight call DisableEmbedsforCodeblocksWithLang(<f-args>) 225" }}}1 226 227" BASE: 228syntax clear 229syntax spell toplevel 230" }}}1 231 232" Syntax Rules: {{{1 233 234" Embeds: {{{2 235 236" prevent embedded language syntaxes from changing 'foldmethod' 237if has ( 'folding' ) 238let s: foldmethod = & l: foldmethod 239endif 240 241" HTML: {{{3 242" Set embedded HTML highlighting 243syn include @HTML syntax/html.vim 244syn match pandocHTML /<\/\?\a\_.\{-}> /contains = @HTML 245" Support HTML multi line comments 246syn region pandocHTMLComment start = /<!--\s\= /end = /\s\=--> /keepend contains = pandocHTMLCommentStart , pandocHTMLCommentEnd 247call s: WithConceal ( 'html_c_s' , 'syn match pandocHTMLCommentStart /<!--/ contained' , 'conceal cchar=' . s: cchars [ 'html_c_s' ]) 248call s: WithConceal ( 'html_c_e' , 'syn match pandocHTMLCommentEnd /-->/ contained' , 'conceal cchar=' . s: cchars [ 'html_c_e' ]) 249" }}}3 250 251" LaTeX: {{{3 252" Set embedded LaTex (pandoc extension) highlighting 253" Unset current_syntax so the 2nd include will work 254unlet b: current_syntax 255syn include @LATEX syntax/tex.vim 256if index ( g: pandoc#syntax#conceal#blacklist , 'inlinemath' ) == -1 257" Can't use WithConceal here because it will mess up all other conceals 258" when dollar signs are used normally. It must be skipped entirely if 259" inlinemath is blacklisted 260syn region pandocLaTeXInlineMath start = /\v\\@<!\$\S@= /end = /\v\\@<!\$\d@! /keepend contains = @LATEX 261syn region pandocLaTeXInlineMath start = /\\\@<!\\( /end = /\\\@<!\\) /keepend contains = @LATEX 262endif 263syn match pandocEscapedDollar /\\\$ /conceal cchar = $ 264syn match pandocProtectedFromInlineLaTeX /\\\@<!\${. * }\(\(\s\| [ [:punct: ] ]\)\( [ ^$ ] * \|. * \(\\\$. * \)\{2}\)\n\n\|$\)\@= /display 265" contains=@LATEX 266syn region pandocLaTeXMathBlock start = /\$\$ /end = /\$\$ /keepend contains = @LATEX 267syn region pandocLaTeXMathBlock start = /\\\@<!\\\[ /end = /\\\@<!\\\] /keepend contains = @LATEX 268syn match pandocLaTeXCommand /\\ [ [:alpha: ] ]\+\(\({.\{-}}\)\=\(\[.\{-}\]\)\=\) * /contains = @LATEX 269syn region pandocLaTeXRegion start = /\\begin{\z(.\{-}\)} /end = /\\end{\z1} /keepend contains = @LATEX 270" we rehighlight sectioning commands, because otherwise tex.vim captures all text until EOF or a new sectioning command 271syn region pandocLaTexSection start = /\\\(part\|chapter\|\(sub\)\{,2}section\|\(sub\)\=paragraph\)\*\=\(\[. * \]\)\={ /end = /\} /keepend 272syn match pandocLaTexSectionCmd /\\\(part\|chapter\|\(sub\)\{,2}section\|\(sub\)\=paragraph\) /contained containedin = pandocLaTexSection 273syn match pandocLaTeXDelimiter /[ [\]{} ] /contained containedin = pandocLaTexSection 274" }}}3 275 276if exists ( 's:foldmethod' ) && s: foldmethod !=# & l: foldmethod 277let & l: foldmethod = s: foldmethod 278endif 279 280" }}}2 281 282" Titleblock: {{{2 283syn region pandocTitleBlock start = /\%^% /end = /\n\n /contains = pandocReferenceLabel , pandocReferenceURL , pandocNewLine 284call s: WithConceal ( 'titleblock' , 'syn match pandocTitleBlockMark /%\ / contained containedin=pandocTitleBlock,pandocTitleBlockTitle' , 'conceal' ) 285syn match pandocTitleBlockTitle /\%^%. * \n /contained containedin = pandocTitleBlock 286" }}}2 287 288" Blockquotes: {{{2 289syn match pandocBlockQuote /^\s\{,3}>. * \n\(. * \n\@1<!\n\) * /contains = @Spell , pandocEmphasis , pandocStrong , pandocPCite , pandocSuperscript , pandocSubscript , pandocStrikeout , pandocUListItem , pandocNoFormatted , pandocAmpersandEscape , pandocLaTeXInlineMath , pandocEscapedDollar , pandocLaTeXCommand , pandocLaTeXMathBlock , pandocLaTeXRegion skipnl 290syn match pandocBlockQuoteMark /\_^\s\{,3}> /contained containedin = pandocEmphasis , pandocStrong , pandocPCite , pandocSuperscript , pandocSubscript , pandocStrikeout , pandocUListItem , pandocNoFormatted 291" }}}2 292 293" Code Blocks: {{{2 294if g: pandoc#syntax#protect#codeblocks == 1 295syn match pandocCodeblock /\( [ ] \{4}\|\t\). * $ / 296endif 297syn region pandocCodeBlockInsideIndent start = /\(\(\d\|\a\|*\). * \n\)\@<!\(^\(\s\{8,}\|\t\+\)\). * \n /end = /.\(\n^\s * \n\)\@= /contained 298" }}}2 299 300" Links: {{{2 301 302" Base: {{{3 303syn region pandocReferenceLabel matchgroup = pandocOperator start = /!\{,1}\\\@<!\^\@<!\[ /skip = /\(\\\@<!\]\]\@=\|` [ ^` ] * `\) /end = /\\\@<!\] /keepend display 304if g: pandoc#syntax#conceal#urls == 1 305syn region pandocReferenceURL matchgroup = pandocOperator start = /\]\@1<=( /end = /) /keepend conceal 306else 307syn region pandocReferenceURL matchgroup = pandocOperator start = /\]\@1<=( /end = /) /keepend 308endif 309" let's not consider "a [label] a" as a label, remove formatting - Note: breaks implicit links 310syn match pandocNoLabel /\]\@1<!\(\s\{,3}\|^\)\[ [ ^\[\] ] \{-}\]\(\s\+\|$\) [ \[( ] \@! /contains = pandocPCite 311syn match pandocLinkTip /\s * ".\{-}" /contained containedin = pandocReferenceURL contains = @Spell , pandocAmpersandEscape display 312call s: WithConceal ( 'image' , 'syn match pandocImageIcon /!\[\@=/ display' , 'conceal cchar=' . s: cchars [ 'image' ]) 313" }}}3 314 315" Definitions: {{{3 316syn region pandocReferenceDefinition start = /\[.\{-}\]: /end = /\(\n\s * ". * "$\|$\) /keepend 317syn match pandocReferenceDefinitionLabel /\[\zs.\{-}\ze\]: /contained containedin = pandocReferenceDefinition display 318syn match pandocReferenceDefinitionAddress /:\s * \zs. * /contained containedin = pandocReferenceDefinition 319syn match pandocReferenceDefinitionTip /\s * ".\{-}" /contained containedin = pandocReferenceDefinition , pandocReferenceDefinitionAddress contains = @Spell , pandocAmpersandEscape 320" }}}3 321 322" Automatic_links: {{{3 323syn match pandocAutomaticLink /<\(https\{0,1}.\{-}\| [ A-Za-z0-9!#$%&'*+\-/=?^_`{|}~. ] \{-}@ [ A-Za-z0-9\- ] \{-}\.\w\{-}\)> /contains = NONE 324" }}}3 325 326" }}}2 327 328" Citations: {{{2 329" parenthetical citations 330syn match pandocPCite "\^\@<!\[ [ ^\[\] ] \{-}-\{0,1}@ [ [:alnum: ] _] [ [:digit: ][ :lower: ][ :upper: ] _:.#$%&\-+?<>~/] * .\{-}\] "contains = pandocEmphasis , pandocStrong , pandocLatex , pandocCiteKey , @Spell , pandocAmpersandEscape display 331" in-text citations with location 332syn match pandocICite "@ [ [:alnum: ] _] [ [:digit: ][ :lower: ][ :upper: ] _:.#$%&\-+?<>~/] * \s\[.\{-1,}\] "contains = pandocCiteKey , @Spell display 333" cite keys 334syn match pandocCiteKey /\(-\=@ [ [:alnum: ] _] [ [:digit: ][ :lower: ][ :upper: ] _:.#$%&\-+?<>~/] * \) /containedin = pandocPCite , pandocICite contains = @NoSpell display 335syn match pandocCiteAnchor /[ -@ ] /contained containedin = pandocCiteKey display 336syn match pandocCiteLocator /[ \[\] ] /contained containedin = pandocPCite , pandocICite 337" }}}2 338 339" Text Styles: {{{2 340 341" Emphasis: {{{3 342call s: WithConceal ( 'block' , 'syn region pandocEmphasis matchgroup=pandocOperator start=/\\\@1<!\(\_^\|\s\|[[:punct:]]\)\@<=\*\S\@=/ skip=/\(\*\*\|__\)/ end=/\*\([[:punct:]]\|\a\|\s\|\_$\)\@=/ contains=@Spell,pandocNoFormattedInEmphasis,pandocLatexInlineMath,pandocAmpersandEscape' , 'concealends' ) 343call s: WithConceal ( 'block' , 'syn region pandocEmphasis matchgroup=pandocOperator start=/\\\@1<!\(\_^\|\s\|[[:punct:]]\)\@<=_\S\@=/ skip=/\(\*\*\|__\)/ end=/\S\@1<=_\([[:punct:]]\|\a\|\s\|\_$\)\@=/ contains=@Spell,pandocNoFormattedInEmphasis,pandocLatexInlineMath,pandocAmpersandEscape' , 'concealends' ) 344" }}}3 345 346" Strong: {{{3 347call s: WithConceal ( 'block' , 'syn region pandocStrong matchgroup=pandocOperator start=/\(\\\@<!\*\)\{2}/ end=/\(\\\@<!\*\)\{2}/ contains=@Spell,pandocNoFormattedInStrong,pandocLatexInlineMath,pandocAmpersandEscape' , 'concealends' ) 348call s: WithConceal ( 'block' , 'syn region pandocStrong matchgroup=pandocOperator start=/__/ end=/__/ contains=@Spell,pandocNoFormattedInStrong,pandocLatexInlineMath,pandocAmpersandEscape' , 'concealends' ) 349" }}}3 350 351" Strong Emphasis: {{{3 352call s: WithConceal ( 'block' , 'syn region pandocStrongEmphasis matchgroup=pandocOperator start=/\*\{3}\(\S[^*]*\(\*\S\|\n[^*]*\*\S\)\)\@=/ end=/\S\@<=\*\{3}/ contains=@Spell,pandocAmpersandEscape' , 'concealends' ) 353call s: WithConceal ( 'block' , 'syn region pandocStrongEmphasis matchgroup=pandocOperator start=/\(___\)\S\@=/ end=/\S\@<=___/ contains=@Spell,pandocAmpersandEscape' , 'concealends' ) 354" }}}3 355 356" Mixed: {{{3 357call s: WithConceal ( 'block' , 'syn region pandocStrongInEmphasis matchgroup=pandocOperator start=/\*\*/ end=/\*\*/ contained containedin=pandocEmphasis contains=@Spell,pandocAmpersandEscape' , 'concealends' ) 358call s: WithConceal ( 'block' , 'syn region pandocStrongInEmphasis matchgroup=pandocOperator start=/__/ end=/__/ contained containedin=pandocEmphasis contains=@Spell,pandocAmpersandEscape' , 'concealends' ) 359call s: WithConceal ( 'block' , 'syn region pandocEmphasisInStrong matchgroup=pandocOperator start=/\\\@1<!\(\_^\|\s\|[[:punct:]]\)\@<=\*\S\@=/ skip=/\(\*\*\|__\)/ end=/\S\@<=\*\([[:punct:]]\|\s\|\_$\)\@=/ contained containedin=pandocStrong contains=@Spell,pandocAmpersandEscape' , 'concealends' ) 360call s: WithConceal ( 'block' , 'syn region pandocEmphasisInStrong matchgroup=pandocOperator start=/\\\@<!\(\_^\|\s\|[[:punct:]]\)\@<=_\S\@=/ skip=/\(\*\*\|__\)/ end=/\S\@<=_\([[:punct:]]\|\s\|\_$\)\@=/ contained containedin=pandocStrong contains=@Spell,pandocAmpersandEscape' , 'concealends' ) 361" }}}3 362 363" Inline Code: {{{3 364" Using single back ticks 365call s: WithConceal ( 'inlinecode' , 'syn region pandocNoFormatted matchgroup=pandocOperator start=/\\\@<!`/ end=/\\\@<!`/ nextgroup=pandocNoFormattedAttrs' , 'concealends' ) 366call s: WithConceal ( 'inlinecode' , 'syn region pandocNoFormattedInEmphasis matchgroup=pandocOperator start=/\\\@<!`/ end=/\\\@<!`/ nextgroup=pandocNoFormattedAttrs contained' , 'concealends' ) 367call s: WithConceal ( 'inlinecode' , 'syn region pandocNoFormattedInStrong matchgroup=pandocOperator start=/\\\@<!`/ end=/\\\@<!`/ nextgroup=pandocNoFormattedAttrs contained' , 'concealends' ) 368" Using double back ticks 369call s: WithConceal ( 'inlinecode' , 'syn region pandocNoFormatted matchgroup=pandocOperator start=/\\\@<!``/ end=/\\\@<!``/ nextgroup=pandocNoFormattedAttrs' , 'concealends' ) 370call s: WithConceal ( 'inlinecode' , 'syn region pandocNoFormattedInEmphasis matchgroup=pandocOperator start=/\\\@<!``/ end=/\\\@<!``/ nextgroup=pandocNoFormattedAttrs contained' , 'concealends' ) 371call s: WithConceal ( 'inlinecode' , 'syn region pandocNoFormattedInStrong matchgroup=pandocOperator start=/\\\@<!``/ end=/\\\@<!``/ nextgroup=pandocNoFormattedAttrs contained' , 'concealends' ) 372syn match pandocNoFormattedAttrs /{.\{-}} /contained 373" }}}3 374 375" Subscripts: {{{3 376syn region pandocSubscript start = /\~\(\( [ [:graph: ] ]\(\\ \)\=\)\{-}\~\)\@= /end = /\~ /keepend 377call s: WithConceal ( 'subscript' , 'syn match pandocSubscriptMark /\~/ contained containedin=pandocSubscript' , 'conceal cchar=' . s: cchars [ 'sub' ]) 378" }}}3 379 380" Superscript: {{{3 381syn region pandocSuperscript start = /\^\(\( [ [:graph: ] ]\(\\ \)\=\)\{-}\^\)\@= /skip = /\\ /end = /\^ /keepend 382call s: WithConceal ( 'superscript' , 'syn match pandocSuperscriptMark /\^/ contained containedin=pandocSuperscript' , 'conceal cchar=' . s: cchars [ 'super' ]) 383" }}}3 384 385" Strikeout: {{{3 386syn region pandocStrikeout start = /\~\~ /end = /\~\~ /contains = @Spell , pandocAmpersandEscape keepend 387call s: WithConceal ( 'strikeout' , 'syn match pandocStrikeoutMark /\~\~/ contained containedin=pandocStrikeout' , 'conceal cchar=' . s: cchars [ 'strike' ]) 388" }}}3 389 390" }}}2 391 392" Headers: {{{2 393syn match pandocAtxHeader /\(\%^\|<.\+>. * \n\|^\s * \n\)\@<=#\{1,6}. * \n /contains = pandocEmphasis , pandocStrong , pandocNoFormatted , pandocLaTeXInlineMath , pandocEscapedDollar , @Spell , pandocAmpersandEscape , pandocReferenceLabel , pandocReferenceURL display 394syn match pandocAtxHeaderMark /\(^#\{1,6}\|\\\@<!#\+\(\s * . * $\)\@=\) /contained containedin = pandocAtxHeader 395call s: WithConceal ( 'atx' , 'syn match pandocAtxStart /#/ contained containedin=pandocAtxHeaderMark' , 'conceal cchar=' . s: cchars [ 'atx' ]) 396syn match pandocSetexHeader /^.\+\n [ = ] \+$ /contains = pandocEmphasis , pandocStrong , pandocNoFormatted , pandocLaTeXInlineMath , pandocEscapedDollar , @Spell , pandocAmpersandEscape 397syn match pandocSetexHeader /^.\+\n [ - ] \+$ /contains = pandocEmphasis , pandocStrong , pandocNoFormatted , pandocLaTeXInlineMath , pandocEscapedDollar , @Spell , pandocAmpersandEscape 398syn match pandocHeaderAttr /{. * } /contained containedin = pandocAtxHeader , pandocSetexHeader 399syn match pandocHeaderID /# [ -_:.[:lower: ][ :upper: ] ] * /contained containedin = pandocHeaderAttr 400" }}}2 401 402" Line Blocks: {{{2 403syn region pandocLineBlock start = /^| /end = /\(^|\(. * \n|\@!\)\@=. * \)\@<=\n /transparent 404syn match pandocLineBlockDelimiter /^| /contained containedin = pandocLineBlock 405" }}}2 406 407" Tables: {{{2 408 409" Simple: {{{3 410syn region pandocSimpleTable start = /\%#=2\(^. * [ [:graph: ] ]. * \n\)\@<!\(^. * [ [:graph: ] ]. * \n\)\(-\{2,}\s * \)\+\n\n\@! /end = /\n\n /containedin = ALLBUT , pandocDelimitedCodeBlock , pandocDelimitedCodeBlockStart , pandocYAMLHeader keepend 411syn match pandocSimpleTableDelims /\- /contained containedin = pandocSimpleTable 412syn match pandocSimpleTableHeader /\%#=2\(^. * [ [:graph: ] ]. * \n\)\@<!\(^. * [ [:graph: ] ]. * \n\) /contained containedin = pandocSimpleTable 413 414syn region pandocTable start = /\%#=2^\(-\{2,}\s * \)\+\n\n\@! /end = /\%#=2^\(-\{2,}\s * \)\+\n\n /containedin = ALLBUT , pandocDelimitedCodeBlock , pandocYAMLHeader keepend 415syn match pandocTableDelims /\- /contained containedin = pandocTable 416syn region pandocTableMultilineHeader start = /\%#=2\(^-\{2,}\n\)\@<=. /end = /\%#=2\n-\@= /contained containedin = pandocTable 417" }}}3 418 419" Grid: {{{3 420syn region pandocGridTable start = /\%#=2\n\@1<=+- /end = /+\n\n /containedin = ALLBUT , pandocDelimitedCodeBlock , pandocYAMLHeader keepend 421syn match pandocGridTableDelims /[ \|= ] /contained containedin = pandocGridTable 422syn match pandocGridTableDelims /\%#=2\( [ \-+ ][ \-+= ] \@=\| [ \-+= ] \@1<= [ \-+ ] \) /contained containedin = pandocGridTable 423syn match pandocGridTableHeader /\%#=2\(^. * \n\)\(+=. * \)\@= /contained containedin = pandocGridTable 424" }}}3 425 426" Pipe: {{{3 427" with beginning and end pipes 428syn region pandocPipeTable start = /\%#=2\( [ +| ] \n\)\@<!\n\@1<=|\(. * |\)\@= /end = /|. * \n\(\n\|{\) /containedin = ALLBUT , pandocDelimitedCodeBlock , pandocYAMLHeader keepend 429" without beginning and end pipes 430syn region pandocPipeTable start = /\%#=2^. * \n-.\{-}| /end = /|. * \n\n /keepend 431syn match pandocPipeTableDelims /[ \|\-:+ ] /contained containedin = pandocPipeTable 432syn match pandocPipeTableHeader /\(^. * \n\)\(|-\)\@= /contained containedin = pandocPipeTable 433syn match pandocPipeTableHeader /\(^. * \n\)\(-\)\@= /contained containedin = pandocPipeTable 434" }}}3 435 436syn match pandocTableHeaderWord /\<.\{-}\> /contained containedin = pandocGridTableHeader , pandocPipeTableHeader contains = @Spell 437" }}}2 438 439" Delimited Code Blocks: {{{2 440" this is here because we can override strikeouts and subscripts 441syn region pandocDelimitedCodeBlock start = /^\(>\s\)\?\z(\( [ ] \+\|\t\)\=\~\{3,}\~ * \) /end = /^\z1\~ * /skipnl contains = pandocDelimitedCodeBlockStart , pandocDelimitedCodeBlockEnd keepend 442syn region pandocDelimitedCodeBlock start = /^\(>\s\)\?\z(\( [ ] \+\|\t\)\=`\{3,}` * \) /end = /^\z1` * /skipnl contains = pandocDelimitedCodeBlockStart , pandocDelimitedCodeBlockEnd keepend 443call s: WithConceal ( 'codeblock_start' , 'syn match pandocDelimitedCodeBlockStart /\(\(\_^\n\_^\|\%^\)\(>\s\)\?\( \+\|\t\)\=\)\@<=\(\~\{3,}\~*\|`\{3,}`*\)/ contained containedin=pandocDelimitedCodeBlock nextgroup=pandocDelimitedCodeBlockLanguage' , 'conceal cchar=' . s: cchars [ 'codelang' ]) 444syn match pandocDelimitedCodeBlockLanguage /\(\s\?\)\@<=.\+\(\_$\)\@= /contained 445call s: WithConceal ( 'codeblock_delim' , 'syn match pandocDelimitedCodeBlockEnd /\(`\{3,}`*\|\~\{3,}\~*\)\(\_$\n\(>\s\)\?\_$\)\@=/ contained containedin=pandocDelimitedCodeBlock' , 'conceal cchar=' . s: cchars [ 'codeend' ]) 446syn match pandocBlockQuoteinDelimitedCodeBlock '^> 'contained containedin = pandocDelimitedCodeBlock 447syn match pandocCodePre /<pre>.\{-}<\/pre> /skipnl 448syn match pandocCodePre /<code>.\{-}<\/code> /skipnl 449 450" enable highlighting for embedded region in codeblocks if there exists a 451" g:pandoc#syntax#codeblocks#embeds#langs *list*. 452" 453" entries in this list are the language code interpreted by pandoc, 454" if this differs from the name of the vim syntax file, append =vimname 455" e.g. let g:pandoc#syntax#codeblocks#embeds#langs = ["haskell", "literatehaskell=lhaskell"] 456" 457if g: pandoc#syntax#codeblocks#embeds#use != 0 458for l in g: pandoc#syntax#codeblocks#embeds#langs 459call EnableEmbedsforCodeblocksWithLang ( l ) 460endfor 461endif 462" }}}2 463 464" Abbreviations: {{{2 465syn region pandocAbbreviationDefinition start = /^\*\[.\{-}\]:\s * /end = '$ 'contains = pandocNoFormatted , @Spell , pandocAmpersandEscape 466call s: WithConceal ( 'abbrev' , 'syn match pandocAbbreviationSeparator /:/ contained containedin=pandocAbbreviationDefinition' , 'conceal cchar=' . s: cchars [ 'abbrev' ]) 467syn match pandocAbbreviation /\*\[.\{-}\] /contained containedin = pandocAbbreviationDefinition 468call s: WithConceal ( 'abbrev' , 'syn match pandocAbbreviationHead /\*\[/ contained containedin=pandocAbbreviation' , 'conceal' ) 469call s: WithConceal ( 'abbrev' , 'syn match pandocAbbreviationTail /\]/ contained containedin=pandocAbbreviation' , 'conceal' ) 470" }}}2 471 472" Footnotes: {{{2 473" we put these here not to interfere with superscripts. 474syn match pandocFootnoteID /\[\^ [ ^\] ] \+\] /nextgroup = pandocFootnoteDef 475 476" Inline footnotes 477syn 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 478call s: WithConceal ( 'footnote' , 'syn match pandocFootnoteDefHead /\^\[/ contained containedin=pandocFootnoteDef' , 'conceal cchar=' . s: cchars [ 'footnote' ]) 479call s: WithConceal ( 'footnote' , 'syn match pandocFootnoteDefTail /\]/ contained containedin=pandocFootnoteDef' , 'conceal' ) 480 481" regular footnotes 482syn region pandocFootnoteBlock start = /\[\^.\{-}\]:\s * \n * /end = /^\n^\s\@! /contains = pandocReferenceLabel , pandocReferenceURL , pandocLatex , pandocPCite , pandocCiteKey , pandocStrong , pandocEmphasis , pandocNoFormatted , pandocSuperscript , pandocSubscript , pandocStrikeout , pandocEnDash , pandocEmDash , pandocNewLine , pandocStrongEmphasis , pandocEllipses , pandocBeginQuote , pandocEndQuote , pandocLaTeXInlineMath , pandocEscapedDollar , pandocLaTeXCommand , pandocLaTeXMathBlock , pandocLaTeXRegion , pandocAmpersandEscape , @Spell skipnl 483syn match pandocFootnoteBlockSeparator /: /contained containedin = pandocFootnoteBlock 484syn match pandocFootnoteID /\[\^.\{-}\] /contained containedin = pandocFootnoteBlock 485call s: WithConceal ( 'footnote' , 'syn match pandocFootnoteIDHead /\[\^/ contained containedin=pandocFootnoteID' , 'conceal cchar=' . s: cchars [ 'footnote' ]) 486call s: WithConceal ( 'footnote' , 'syn match pandocFootnoteIDTail /\]/ contained containedin=pandocFootnoteID' , 'conceal' ) 487" }}}2 488 489" List Items: {{{2 490" Unordered lists 491syn match pandocUListItem /^>\=\s * [ *+- ] \s\+-\@!. * $ /nextgroup = pandocUListItem , pandocLaTeXMathBlock , pandocLaTeXInlineMath , pandocEscapedDollar , pandocDelimitedCodeBlock , pandocListItemContinuation contains = @Spell , pandocEmphasis , pandocStrong , pandocNoFormatted , pandocStrikeout , pandocSubscript , pandocSuperscript , pandocStrongEmphasis , pandocStrongEmphasis , pandocPCite , pandocICite , pandocCiteKey , pandocReferenceLabel , pandocLaTeXCommand , pandocLaTeXMathBlock , pandocLaTeXInlineMath , pandocEscapedDollar , pandocReferenceURL , pandocAutomaticLink , pandocFootnoteDef , pandocFootnoteBlock , pandocFootnoteID , pandocAmpersandEscape skipempty display 492call s: WithConceal ( 'list' , 'syn match pandocUListItemBullet /^>\=\s*\zs[*+-]/ contained containedin=pandocUListItem' , 'conceal cchar=' . s: cchars [ 'li' ]) 493 494" Ordered lists 495syn match pandocListItem /^\s * (\?\(\d\+\|\l\|\#\|@\) [ .) ] . * $ /nextgroup = pandocListItem , pandocLaTeXMathBlock , pandocLaTeXInlineMath , pandocEscapedDollar , pandocDelimitedCodeBlock , pandocListItemContinuation contains = @Spell , pandocEmphasis , pandocStrong , pandocReferenceURL , pandocNoFormatted , pandocStrikeout , pandocSubscript , pandocSuperscript , pandocStrongEmphasis , pandocStrongEmphasis , pandocPCite , pandocICite , pandocCiteKey , pandocReferenceLabel , pandocLaTeXCommand , pandocLaTeXMathBlock , pandocLaTeXInlineMath , pandocEscapedDollar , pandocAutomaticLink , pandocFootnoteDef , pandocFootnoteBlock , pandocFootnoteID , pandocAmpersandEscape skipempty display 496 497" support for roman numerals up to 'c' 498if g: pandoc#syntax#roman_lists != 0 499syn match pandocListItem /^\s * (\?x\=l\=\(i\{,3} [ vx ] \=\)\{,3}c\{,3} [ .) ] . * $ /nextgroup = pandocListItem , pandocMathBlock , pandocLaTeXInlineMath , pandocEscapedDollar , pandocDelimitedCodeBlock , pandocListItemContinuation , pandocAutomaticLink skipempty display 500endif 501syn match pandocListItemBullet /^(\?.\{-} [ .) ] /contained containedin = pandocListItem 502syn match pandocListItemBulletId /\(\d\+\|\l\|\#\|@.\{-}\|x\=l\=\(i\{,3} [ vx ] \=\)\{,3}c\{,3}\) /contained containedin = pandocListItemBullet 503 504syn match pandocListItemContinuation /^\s\+\( [ -+* ] \s\+\|(\?.\+ [ ). ] \)\@<!\( [ [:upper: ][ :lower: ] _" [] \|\*\S\)\@=. * $ /nextgroup = pandocLaTeXMathBlock , pandocLaTeXInlineMath , pandocEscapedDollar , pandocDelimitedCodeBlock , pandocListItemContinuation , pandocListItem contains = @Spell , pandocEmphasis , pandocStrong , pandocNoFormatted , pandocStrikeout , pandocSubscript , pandocSuperscript , pandocStrongEmphasis , pandocStrongEmphasis , pandocPCite , pandocICite , pandocCiteKey , pandocReferenceLabel , pandocReferenceURL , pandocLaTeXCommand , pandocLaTeXMathBlock , pandocLaTeXInlineMath , pandocEscapedDollar , pandocAutomaticLink , pandocFootnoteDef , pandocFootnoteBlock , pandocFootnoteID , pandocAmpersandEscape contained skipempty display 505" }}}2 506 507" Definitions: {{{2 508if g: pandoc#syntax#use_definition_lists == 1 509syn region pandocDefinitionBlock start = /^\%(\_^\s * \( [ `~ ] \)\1\{2,}\)\@!. * \n\(^\s * \n\)\=\s\{0,2}\( [ :~ ] \)\(\3\{2,}\3 * \)\@! /skip = /\n\n\zs\s /end = /\n\n /contains = @Spell , pandocDefinitionBlockMark , pandocDefinitionBlockTerm , pandocCodeBlockInsideIndent , pandocEmphasis , pandocStrong , pandocStrongEmphasis , pandocNoFormatted , pandocStrikeout , pandocSubscript , pandocSuperscript , pandocFootnoteID , pandocReferenceURL , pandocReferenceLabel , pandocLaTeXMathBlock , pandocLaTeXInlineMath , pandocEscapedDollar , pandocAutomaticLink , pandocEmDash , pandocEnDash , pandocFootnoteDef , pandocFootnoteBlock , pandocFootnoteID 510syn match pandocDefinitionBlockTerm /^. * \n\(^\s * \n\)\=\(\s * [ :~ ] \)\@= /contained contains = @Spell , pandocNoFormatted , pandocEmphasis , pandocStrong , pandocLaTeXInlineMath , pandocEscapedDollar , pandocFootnoteDef , pandocFootnoteBlock , pandocFootnoteID nextgroup = pandocDefinitionBlockMark 511call s: WithConceal ( 'definition' , 'syn match pandocDefinitionBlockMark /^\s*[:~]/ contained' , 'conceal cchar=' . s: cchars [ 'definition' ]) 512endif 513" }}}2 514 515" Special: {{{2 516 517" New_lines: {{{3 518if g: pandoc#syntax#newlines == 1 519call s: WithConceal ( 'newline' , 'syn match pandocNewLine /\%(\%(\S\)\@<= \{2,}\|\\\)$/ display containedin=pandocEmphasis,pandocStrong,pandocStrongEmphasis,pandocStrongInEmphasis,pandocEmphasisInStrong' , 'conceal cchar=' . s: cchars [ 'newline' ]) 520endif 521" }}}3 522 523" Emdashes: {{{3 524if & encoding ==# 'utf-8' 525call s: WithConceal ( 'emdashes' , 'syn match pandocEllipses /\([^-]\)\@<=---\([^-]\)\@=/ display' , 'conceal cchar=—' ) 526endif 527" }}}3 528 529" Endashes: {{{3 530if & encoding ==# 'utf-8' 531call s: WithConceal ( 'endashes' , 'syn match pandocEllipses /\([^-]\)\@<=--\([^-]\)\@=/ display' , 'conceal cchar=–' ) 532endif 533" }}}3 534 535" Ellipses: {{{3 536if & encoding ==# 'utf-8' 537call s: WithConceal ( 'ellipses' , 'syn match pandocEllipses /\.\.\./ display' , 'conceal cchar=…' ) 538endif 539" }}}3 540 541" Quotes: {{{3 542if & encoding ==# 'utf-8' 543call s: WithConceal ( 'quotes' , 'syn match pandocBeginQuote /"\</ containedin=pandocEmphasis,pandocStrong,pandocListItem,pandocListItemContinuation,pandocUListItem display' , 'conceal cchar=' . s: cchars [ 'quote_s' ]) 544call s: WithConceal ( 'quotes' , 'syn match pandocEndQuote /\(\>[[:punct:]]*\)\@<="[[:blank:][:punct:]\n]\@=/ containedin=pandocEmphasis,pandocStrong,pandocUListItem,pandocListItem,pandocListItemContinuation display' , 'conceal cchar=' . s: cchars [ 'quote_e' ]) 545endif 546" }}}3 547 548" Hrule: {{{3 549syn match pandocHRule /^\s * \( [ *\-_ ] \)\s * \%(\1\s * \)\{2,}$ /display 550" }}}3 551 552" Backslashes: {{{3 553if g: pandoc#syntax#conceal#backslash == 1 554syn match pandocBackslash /\v\\@<!\\((re)?newcommand)@! /containedin = ALLBUT , pandocCodeblock , pandocCodeBlockInsideIndent , pandocNoFormatted , pandocNoFormattedInEmphasis , pandocNoFormattedInStrong , pandocDelimitedCodeBlock , pandocLineBlock , pandocYAMLHeader conceal 555endif 556" }}}3 557 558" &-escaped Special Characters: {{{3 559syn match pandocAmpersandEscape /\v\&(#\d+|#x\x+| [ [:alnum: ] ]+)\; /contains = @NoSpell 560" }}}3 561 562" YAML: {{{2 563try 564unlet ! b: current_syntax 565syn include @YAML syntax/yaml.vim 566catch /E484/ 567endtry 568syn region pandocYAMLHeader start = /\%(\%^\|\_^\s * \n\)\@<=\_^-\{3}\ze\n.\+ /end = /^\( [ -. ] \)\1\{2}$ /keepend contains = @YAML containedin = TOP 569" }}}2 570 571" }}}1 572 573" Styling: {{{1 574function ! s: SetupPandocHighlights () 575 576hi def link pandocOperator Operator 577 578" override this for consistency 579hi pandocTitleBlock term = italic gui = italic 580hi def link pandocTitleBlockTitle Directory 581hi def link pandocAtxHeader Title 582hi def link pandocAtxStart Operator 583hi def link pandocSetexHeader Title 584hi def link pandocHeaderAttr Comment 585hi def link pandocHeaderID Identifier 586 587hi def link pandocLaTexSectionCmd texSection 588hi def link pandocLaTeXDelimiter texDelimiter 589 590hi def link pandocHTMLComment Comment 591hi def link pandocHTMLCommentStart Delimiter 592hi def link pandocHTMLCommentEnd Delimiter 593hi def link pandocBlockQuote Comment 594hi def link pandocBlockQuoteMark Comment 595hi def link pandocAmpersandEscape Special 596 597" if the user sets g:pandoc#syntax#codeblocks#ignore to contain 598" a codeblock type, don't highlight it so that it remains Normal 599if index ( g: pandoc#syntax#codeblocks#ignore , 'definition' ) == -1 600hi def link pandocCodeBlockInsideIndent String 601endif 602 603if index ( g: pandoc#syntax#codeblocks#ignore , 'delimited' ) == -1 604hi def link pandocDelimitedCodeBlock Special 605endif 606 607hi def link pandocDelimitedCodeBlockStart Delimiter 608hi def link pandocDelimitedCodeBlockEnd Delimiter 609hi def link pandocDelimitedCodeBlockLanguage Comment 610hi def link pandocBlockQuoteinDelimitedCodeBlock pandocBlockQuote 611hi def link pandocCodePre String 612 613hi def link pandocLineBlockDelimiter Delimiter 614 615hi def link pandocListItemBullet Operator 616hi def link pandocUListItemBullet Operator 617hi def link pandocListItemBulletId Identifier 618 619hi def link pandocReferenceLabel Label 620hi def link pandocReferenceURL Underlined 621hi def link pandocLinkTip Identifier 622hi def link pandocImageIcon Operator 623 624hi def link pandocReferenceDefinition Operator 625hi def link pandocReferenceDefinitionLabel Label 626hi def link pandocReferenceDefinitionAddress Underlined 627hi def link pandocReferenceDefinitionTip Identifier 628 629hi def link pandocAutomaticLink Underlined 630 631hi def link pandocDefinitionBlockTerm Identifier 632hi def link pandocDefinitionBlockMark Operator 633 634hi def link pandocSimpleTableDelims Delimiter 635hi def link pandocSimpleTableHeader pandocStrong 636hi def link pandocTableMultilineHeader pandocStrong 637hi def link pandocTableDelims Delimiter 638hi def link pandocGridTableDelims Delimiter 639hi def link pandocGridTableHeader Delimiter 640hi def link pandocPipeTableDelims Delimiter 641hi def link pandocPipeTableHeader Delimiter 642hi def link pandocTableHeaderWord pandocStrong 643 644hi def link pandocAbbreviationHead Type 645hi def link pandocAbbreviation Label 646hi def link pandocAbbreviationTail Type 647hi def link pandocAbbreviationSeparator Identifier 648hi def link pandocAbbreviationDefinition Comment 649 650hi def link pandocFootnoteID Label 651hi def link pandocFootnoteIDHead Type 652hi def link pandocFootnoteIDTail Type 653hi def link pandocFootnoteDef Comment 654hi def link pandocFootnoteDefHead Type 655hi def link pandocFootnoteDefTail Type 656hi def link pandocFootnoteBlock Comment 657hi def link pandocFootnoteBlockSeparator Operator 658 659hi def link pandocPCite Operator 660hi def link pandocICite Operator 661hi def link pandocCiteKey Label 662hi def link pandocCiteAnchor Operator 663hi def link pandocCiteLocator Operator 664 665if g: pandoc#syntax#style#emphases == 1 666hi pandocEmphasis gui = italic cterm = italic 667hi pandocStrong gui = bold cterm = bold 668hi pandocStrongEmphasis gui = bold , italiccterm = bold , italic 669hi pandocStrongInEmphasis gui = bold , italiccterm = bold , italic 670hi pandocEmphasisInStrong gui = bold , italiccterm = bold , italic 671if ! exists ( 's:hi_tail' ) 672let s: fg = '' " Vint can't figure ou these get set dynamically 673let s: bg = '' " so initialize them manually first 674for s: i in [ 'fg' , 'bg' ] 675let s: tmp_val = synIDattr ( synIDtrans ( hlID ( 'String' )), s: i ) 676let s: tmp_ui = has ( 'gui_running' ) || ( has ( 'termguicolors' ) && & termguicolors ) ? 'gui' : 'cterm' 677if ! empty ( s: tmp_val ) && s: tmp_val != -1 678exe 'let s:' . s: i . ' = "' . s: tmp_ui . s: i . '=' . s: tmp_val . '"' 679else 680exe 'let s:' . s: i . ' = ""' 681endif 682endfor 683let s: hi_tail = ' ' . s: fg . ' ' . s: bg 684endif 685exe 'hi pandocNoFormattedInEmphasis gui=italic cterm=italic' . s: hi_tail 686exe 'hi pandocNoFormattedInStrong gui=bold cterm=bold' . s: hi_tail 687endif 688hi def link pandocNoFormatted String 689hi def link pandocNoFormattedAttrs Comment 690hi def link pandocSubscriptMark Operator 691hi def link pandocSuperscriptMark Operator 692hi def link pandocStrikeoutMark Operator 693if g: pandoc#syntax#style#underline_special == 1 694hi pandocSubscript gui = underline cterm = underline 695hi pandocSuperscript gui = underline cterm = underline 696hi pandocStrikeout gui = underline cterm = underline 697endif 698hi def link pandocNewLine Error 699hi def link pandocHRule Delimiter 700endfunction 701 702call s: SetupPandocHighlights () 703 704" }}}1 705 706let b: current_syntax = 'pandoc' 707 708syntax syncclear 709syntax sync minlines= 1000 710 711let & cpoptions = s: cpo_save 712unlet s: cpo_save 713 714" vim: set fdm=marker foldlevel=0: