annotate runtime/syntax/pandoc.vim @ 36133:8c394230efed

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