1
1
scriptencoding utf- 8
2
- " vim: set fdm = marker foldlevel = 0 :
3
- "
2
+
4
3
" Vim syntax file
4
+ " Language: Pandoc (superset of Markdown)
5
+ " Maintainer: Felipe Morales <hel.sheep@gmail.com>
6
+ " Maintainer: Caleb Maclennan <caleb@alerque.com>
5
7
"
6
- " Language: Pandoc (superset of Markdown)
7
- " Maintainer: Felipe Morales <hel.sheep@gmail.com>
8
- " Maintainer: Caleb Maclennan <caleb@alerque.com>
9
- " Contributor: David Sanson <dsanson@gmail.com>
10
- " Contributor: Jorge Israel Peña <jorge.israel.p@gmail.com>
11
- " OriginalAuthor: Jeremy Schultz <taozhyn@gmail.com>
8
+ " Contributor: David Sanson <dsanson@gmail.com>
9
+ " Jorge Israel Peña <jorge.israel.p@gmail.com>
10
+ " Christian Brabandt @chrisbra
11
+ " Original Author: Jeremy Schultz <taozhyn@gmail.com>
12
12
" Version: 5.0
13
+ " Last Change: 2024 Apr 08
14
+
15
+ let s: cpo_save = &cpo
16
+ set cpo &vim
13
17
14
18
if exists (' b:current_syntax' )
15
19
finish
19
23
"
20
24
" use conceal? {{{2
21
25
if ! exists (' g:pandoc#syntax#conceal#use' )
22
- if v: version < 703
23
- let g: pandoc #syntax #conceal#use = 0
24
- else
25
- let g: pandoc #syntax #conceal#use = 1
26
- endif
27
- else
28
- " exists, but we cannot use it, disable anyway
29
- if v: version < 703
30
- let g: pandoc #syntax #conceal#use = 0
31
- endif
26
+ let g: pandoc #syntax #conceal#use = 1
32
27
endif
33
28
" }}}2
34
29
@@ -232,6 +227,7 @@ command! -buffer -nargs=1 -complete=syntax PandocUnhighlight call DisableEmbedsf
232
227
" BASE:
233
228
syntax clear
234
229
syntax spell toplevel
230
+
235
231
" apply extra settings: {{{1
236
232
if g: pandoc #syntax #colorcolumn == 1
237
233
exe ' setlocal colorcolumn=' .string (&textwidth + 5 )
@@ -587,94 +583,94 @@ syn region pandocYAMLHeader start=/\%(\%^\|\_^\s*\n\)\@<=\_^-\{3}\ze\n.\+/ end=/
587
583
" Styling: {{{1
588
584
function ! s: SetupPandocHighlights ()
589
585
590
- hi link pandocOperator Operator
586
+ hi def link pandocOperator Operator
591
587
592
588
" override this for consistency
593
589
hi pandocTitleBlock term = italic gui = italic
594
- hi link pandocTitleBlockTitle Directory
595
- hi link pandocAtxHeader Title
596
- hi link pandocAtxStart Operator
597
- hi link pandocSetexHeader Title
598
- hi link pandocHeaderAttr Comment
599
- hi link pandocHeaderID Identifier
600
-
601
- hi link pandocLaTexSectionCmd texSection
602
- hi link pandocLaTeXDelimiter texDelimiter
603
-
604
- hi link pandocHTMLComment Comment
605
- hi link pandocHTMLCommentStart Delimiter
606
- hi link pandocHTMLCommentEnd Delimiter
607
- hi link pandocBlockQuote Comment
608
- hi link pandocBlockQuoteMark Comment
609
- hi link pandocAmpersandEscape Special
590
+ hi def link pandocTitleBlockTitle Directory
591
+ hi def link pandocAtxHeader Title
592
+ hi def link pandocAtxStart Operator
593
+ hi def link pandocSetexHeader Title
594
+ hi def link pandocHeaderAttr Comment
595
+ hi def link pandocHeaderID Identifier
596
+
597
+ hi def link pandocLaTexSectionCmd texSection
598
+ hi def link pandocLaTeXDelimiter texDelimiter
599
+
600
+ hi def link pandocHTMLComment Comment
601
+ hi def link pandocHTMLCommentStart Delimiter
602
+ hi def link pandocHTMLCommentEnd Delimiter
603
+ hi def link pandocBlockQuote Comment
604
+ hi def link pandocBlockQuoteMark Comment
605
+ hi def link pandocAmpersandEscape Special
610
606
611
607
" if the user sets g:pandoc#syntax#codeblocks#ignore to contain
612
608
" a codeblock type, don't highlight it so that it remains Normal
613
609
if index (g: pandoc #syntax #codeblocks#ignore , ' definition' ) == -1
614
- hi link pandocCodeBlockInsideIndent String
610
+ hi def link pandocCodeBlockInsideIndent String
615
611
endif
616
612
617
613
if index (g: pandoc #syntax #codeblocks#ignore , ' delimited' ) == -1
618
- hi link pandocDelimitedCodeBlock Special
614
+ hi def link pandocDelimitedCodeBlock Special
619
615
endif
620
616
621
- hi link pandocDelimitedCodeBlockStart Delimiter
622
- hi link pandocDelimitedCodeBlockEnd Delimiter
623
- hi link pandocDelimitedCodeBlockLanguage Comment
624
- hi link pandocBlockQuoteinDelimitedCodeBlock pandocBlockQuote
625
- hi link pandocCodePre String
626
-
627
- hi link pandocLineBlockDelimiter Delimiter
628
-
629
- hi link pandocListItemBullet Operator
630
- hi link pandocUListItemBullet Operator
631
- hi link pandocListItemBulletId Identifier
632
-
633
- hi link pandocReferenceLabel Label
634
- hi link pandocReferenceURL Underlined
635
- hi link pandocLinkTip Identifier
636
- hi link pandocImageIcon Operator
637
-
638
- hi link pandocReferenceDefinition Operator
639
- hi link pandocReferenceDefinitionLabel Label
640
- hi link pandocReferenceDefinitionAddress Underlined
641
- hi link pandocReferenceDefinitionTip Identifier
642
-
643
- hi link pandocAutomaticLink Underlined
644
-
645
- hi link pandocDefinitionBlockTerm Identifier
646
- hi link pandocDefinitionBlockMark Operator
647
-
648
- hi link pandocSimpleTableDelims Delimiter
649
- hi link pandocSimpleTableHeader pandocStrong
650
- hi link pandocTableMultilineHeader pandocStrong
651
- hi link pandocTableDelims Delimiter
652
- hi link pandocGridTableDelims Delimiter
653
- hi link pandocGridTableHeader Delimiter
654
- hi link pandocPipeTableDelims Delimiter
655
- hi link pandocPipeTableHeader Delimiter
656
- hi link pandocTableHeaderWord pandocStrong
657
-
658
- hi link pandocAbbreviationHead Type
659
- hi link pandocAbbreviation Label
660
- hi link pandocAbbreviationTail Type
661
- hi link pandocAbbreviationSeparator Identifier
662
- hi link pandocAbbreviationDefinition Comment
663
-
664
- hi link pandocFootnoteID Label
665
- hi link pandocFootnoteIDHead Type
666
- hi link pandocFootnoteIDTail Type
667
- hi link pandocFootnoteDef Comment
668
- hi link pandocFootnoteDefHead Type
669
- hi link pandocFootnoteDefTail Type
670
- hi link pandocFootnoteBlock Comment
671
- hi link pandocFootnoteBlockSeparator Operator
672
-
673
- hi link pandocPCite Operator
674
- hi link pandocICite Operator
675
- hi link pandocCiteKey Label
676
- hi link pandocCiteAnchor Operator
677
- hi link pandocCiteLocator Operator
617
+ hi def link pandocDelimitedCodeBlockStart Delimiter
618
+ hi def link pandocDelimitedCodeBlockEnd Delimiter
619
+ hi def link pandocDelimitedCodeBlockLanguage Comment
620
+ hi def link pandocBlockQuoteinDelimitedCodeBlock pandocBlockQuote
621
+ hi def link pandocCodePre String
622
+
623
+ hi def link pandocLineBlockDelimiter Delimiter
624
+
625
+ hi def link pandocListItemBullet Operator
626
+ hi def link pandocUListItemBullet Operator
627
+ hi def link pandocListItemBulletId Identifier
628
+
629
+ hi def link pandocReferenceLabel Label
630
+ hi def link pandocReferenceURL Underlined
631
+ hi def link pandocLinkTip Identifier
632
+ hi def link pandocImageIcon Operator
633
+
634
+ hi def link pandocReferenceDefinition Operator
635
+ hi def link pandocReferenceDefinitionLabel Label
636
+ hi def link pandocReferenceDefinitionAddress Underlined
637
+ hi def link pandocReferenceDefinitionTip Identifier
638
+
639
+ hi def link pandocAutomaticLink Underlined
640
+
641
+ hi def link pandocDefinitionBlockTerm Identifier
642
+ hi def link pandocDefinitionBlockMark Operator
643
+
644
+ hi def link pandocSimpleTableDelims Delimiter
645
+ hi def link pandocSimpleTableHeader pandocStrong
646
+ hi def link pandocTableMultilineHeader pandocStrong
647
+ hi def link pandocTableDelims Delimiter
648
+ hi def link pandocGridTableDelims Delimiter
649
+ hi def link pandocGridTableHeader Delimiter
650
+ hi def link pandocPipeTableDelims Delimiter
651
+ hi def link pandocPipeTableHeader Delimiter
652
+ hi def link pandocTableHeaderWord pandocStrong
653
+
654
+ hi def link pandocAbbreviationHead Type
655
+ hi def link pandocAbbreviation Label
656
+ hi def link pandocAbbreviationTail Type
657
+ hi def link pandocAbbreviationSeparator Identifier
658
+ hi def link pandocAbbreviationDefinition Comment
659
+
660
+ hi def link pandocFootnoteID Label
661
+ hi def link pandocFootnoteIDHead Type
662
+ hi def link pandocFootnoteIDTail Type
663
+ hi def link pandocFootnoteDef Comment
664
+ hi def link pandocFootnoteDefHead Type
665
+ hi def link pandocFootnoteDefTail Type
666
+ hi def link pandocFootnoteBlock Comment
667
+ hi def link pandocFootnoteBlockSeparator Operator
668
+
669
+ hi def link pandocPCite Operator
670
+ hi def link pandocICite Operator
671
+ hi def link pandocCiteKey Label
672
+ hi def link pandocCiteAnchor Operator
673
+ hi def link pandocCiteLocator Operator
678
674
679
675
if g: pandoc #syntax #style#emphases == 1
680
676
hi pandocEmphasis gui = italic cterm= italic
@@ -699,19 +695,18 @@ function! s:SetupPandocHighlights()
699
695
exe ' hi pandocNoFormattedInEmphasis gui=italic cterm=italic' .s: hi_tail
700
696
exe ' hi pandocNoFormattedInStrong gui=bold cterm=bold' .s: hi_tail
701
697
endif
702
- hi link pandocNoFormatted String
703
- hi link pandocNoFormattedAttrs Comment
704
- hi link pandocSubscriptMark Operator
705
- hi link pandocSuperscriptMark Operator
706
- hi link pandocStrikeoutMark Operator
698
+ hi def link pandocNoFormatted String
699
+ hi def link pandocNoFormattedAttrs Comment
700
+ hi def link pandocSubscriptMark Operator
701
+ hi def link pandocSuperscriptMark Operator
702
+ hi def link pandocStrikeoutMark Operator
707
703
if g: pandoc #syntax #style#underline_special == 1
708
704
hi pandocSubscript gui = underline cterm= underline
709
705
hi pandocSuperscript gui = underline cterm= underline
710
706
hi pandocStrikeout gui = underline cterm= underline
711
707
endif
712
- hi link pandocNewLine Error
713
- hi link pandocHRule Delimiter
714
-
708
+ hi def link pandocNewLine Error
709
+ hi def link pandocHRule Delimiter
715
710
endfunction
716
711
717
712
" Whenever the colorscheme changes, all highlights are cleared.
@@ -749,3 +744,8 @@ let b:current_syntax = 'pandoc'
749
744
750
745
syntax sync clear
751
746
syntax sync minlines =1000
747
+
748
+ let &cpo = s: cpo_save
749
+ unlet s: cpo_save
750
+
751
+ " vim: set fdm = marker foldlevel = 0 :
0 commit comments