vimwiki.vim (19908B)
1 " vim:tabstop=2:shiftwidth=2:expandtab:textwidth=99 2 " Vimwiki syntax file 3 " Home: https://github.com/vimwiki/vimwiki/ 4 5 6 " Quit if syntax file is already loaded 7 if v:version < 600 8 syntax clear 9 elseif exists("b:current_syntax") 10 finish 11 endif 12 13 14 let s:current_syntax = vimwiki#vars#get_wikilocal('syntax') 15 16 17 call vimwiki#vars#populate_syntax_vars(s:current_syntax) 18 19 20 " LINKS: highlighting is complicated due to "nonexistent" links feature 21 function! s:add_target_syntax_ON(target, type) 22 let prefix0 = 'syntax match '.a:type.' `' 23 let suffix0 = '` display contains=@NoSpell,VimwikiLinkRest,'.a:type.'Char' 24 let prefix1 = 'syntax match '.a:type.'T `' 25 let suffix1 = '` display contained' 26 execute prefix0. a:target. suffix0 27 execute prefix1. a:target. suffix1 28 endfunction 29 30 31 function! s:add_target_syntax_OFF(target) 32 let prefix0 = 'syntax match VimwikiNoExistsLink `' 33 let suffix0 = '` display contains=@NoSpell,VimwikiLinkRest,VimwikiLinkChar' 34 let prefix1 = 'syntax match VimwikiNoExistsLinkT `' 35 let suffix1 = '` display contained' 36 execute prefix0. a:target. suffix0 37 execute prefix1. a:target. suffix1 38 endfunction 39 40 41 function! s:highlight_existing_links() 42 " Wikilink 43 " Conditional highlighting that depends on the existence of a wiki file or 44 " directory is only available for *schemeless* wiki links 45 " Links are set up upon BufEnter (see plugin/...) 46 let safe_links = '\%('.vimwiki#base#file_pattern( 47 \ vimwiki#vars#get_bufferlocal('existing_wikifiles')) . '\%(#[^|]*\)\?\|#[^|]*\)' 48 " Wikilink Dirs set up upon BufEnter (see plugin/...) 49 let safe_dirs = vimwiki#base#file_pattern(vimwiki#vars#get_bufferlocal('existing_wikidirs')) 50 51 " match [[URL]] 52 let target = vimwiki#base#apply_template( 53 \ vimwiki#u#escape(vimwiki#vars#get_global('WikiLinkTemplate1')), 54 \ safe_links, vimwiki#vars#get_global('rxWikiLinkDescr'), '') 55 call s:add_target_syntax_ON(target, 'VimwikiLink') 56 " match [[URL|DESCRIPTION]] 57 let target = vimwiki#base#apply_template( 58 \ vimwiki#u#escape(vimwiki#vars#get_global('WikiLinkTemplate2')), 59 \ safe_links, vimwiki#vars#get_global('rxWikiLinkDescr'), '') 60 call s:add_target_syntax_ON(target, 'VimwikiLink') 61 62 " match {{URL}} 63 let target = vimwiki#base#apply_template( 64 \ vimwiki#u#escape(vimwiki#vars#get_global('WikiInclTemplate1')), 65 \ safe_links, vimwiki#vars#get_global('rxWikiInclArgs'), '') 66 call s:add_target_syntax_ON(target, 'VimwikiLink') 67 " match {{URL|...}} 68 let target = vimwiki#base#apply_template( 69 \ vimwiki#u#escape(vimwiki#vars#get_global('WikiInclTemplate2')), 70 \ safe_links, vimwiki#vars#get_global('rxWikiInclArgs'), '') 71 call s:add_target_syntax_ON(target, 'VimwikiLink') 72 " match [[DIRURL]] 73 let target = vimwiki#base#apply_template( 74 \ vimwiki#u#escape(vimwiki#vars#get_global('WikiLinkTemplate1')), 75 \ safe_dirs, vimwiki#vars#get_global('rxWikiLinkDescr'), '') 76 call s:add_target_syntax_ON(target, 'VimwikiLink') 77 " match [[DIRURL|DESCRIPTION]] 78 let target = vimwiki#base#apply_template( 79 \ vimwiki#u#escape(vimwiki#vars#get_global('WikiLinkTemplate2')), 80 \ safe_dirs, vimwiki#vars#get_global('rxWikiLinkDescr'), '') 81 call s:add_target_syntax_ON(target, 'VimwikiLink') 82 endfunction 83 84 85 " use max highlighting - could be quite slow if there are too many wikifiles 86 if vimwiki#vars#get_wikilocal('maxhi') 87 " WikiLink 88 call s:add_target_syntax_OFF(vimwiki#vars#get_syntaxlocal('rxWikiLink')) 89 " WikiIncl 90 call s:add_target_syntax_OFF(vimwiki#vars#get_global('rxWikiIncl')) 91 92 " Subsequently, links verified on vimwiki's path are highlighted as existing 93 call s:highlight_existing_links() 94 else 95 " Wikilink 96 call s:add_target_syntax_ON(vimwiki#vars#get_syntaxlocal('rxWikiLink'), 'VimwikiLink') 97 " WikiIncl 98 call s:add_target_syntax_ON(vimwiki#vars#get_global('rxWikiIncl'), 'VimwikiLink') 99 endif 100 101 102 " Weblink 103 call s:add_target_syntax_ON(vimwiki#vars#get_syntaxlocal('rxWeblink'), 'VimwikiLink') 104 105 106 " WikiLink 107 " All remaining schemes are highlighted automatically 108 let s:rxSchemes = '\%('. 109 \ vimwiki#vars#get_global('schemes') . '\|'. 110 \ vimwiki#vars#get_global('web_schemes1'). 111 \ '\):' 112 113 " a) match [[nonwiki-scheme-URL]] 114 let s:target = vimwiki#base#apply_template( 115 \ vimwiki#u#escape(vimwiki#vars#get_global('WikiLinkTemplate1')), 116 \ s:rxSchemes.vimwiki#vars#get_global('rxWikiLinkUrl'), 117 \ vimwiki#vars#get_global('rxWikiLinkDescr'), '') 118 call s:add_target_syntax_ON(s:target, 'VimwikiLink') 119 " b) match [[nonwiki-scheme-URL|DESCRIPTION]] 120 let s:target = vimwiki#base#apply_template( 121 \ vimwiki#u#escape(vimwiki#vars#get_global('WikiLinkTemplate2')), 122 \ s:rxSchemes.vimwiki#vars#get_global('rxWikiLinkUrl'), 123 \ vimwiki#vars#get_global('rxWikiLinkDescr'), '') 124 call s:add_target_syntax_ON(s:target, 'VimwikiLink') 125 126 " a) match {{nonwiki-scheme-URL}} 127 let s:target = vimwiki#base#apply_template( 128 \ vimwiki#u#escape(vimwiki#vars#get_global('WikiInclTemplate1')), 129 \ s:rxSchemes.vimwiki#vars#get_global('rxWikiInclUrl'), 130 \ vimwiki#vars#get_global('rxWikiInclArgs'), '') 131 call s:add_target_syntax_ON(s:target, 'VimwikiLink') 132 " b) match {{nonwiki-scheme-URL}[{...}]} 133 let s:target = vimwiki#base#apply_template( 134 \ vimwiki#u#escape(vimwiki#vars#get_global('WikiInclTemplate2')), 135 \ s:rxSchemes.vimwiki#vars#get_global('rxWikiInclUrl'), 136 \ vimwiki#vars#get_global('rxWikiInclArgs'), '') 137 call s:add_target_syntax_ON(s:target, 'VimwikiLink') 138 139 140 141 " Header levels, 1-6 142 for s:i in range(1,6) 143 execute 'syntax match VimwikiHeader'.s:i 144 \ . ' /'.vimwiki#vars#get_syntaxlocal('rxH'.s:i, s:current_syntax). 145 \ '/ contains=VimwikiTodo,VimwikiHeaderChar,VimwikiNoExistsLink,VimwikiCode,'. 146 \ 'VimwikiLink,@Spell' 147 execute 'syntax region VimwikiH'.s:i.'Folding start=/'. 148 \ vimwiki#vars#get_syntaxlocal('rxH'.s:i.'_Start', s:current_syntax).'/ end=/'. 149 \ vimwiki#vars#get_syntaxlocal('rxH'.s:i.'_End', s:current_syntax). 150 \ '/me=s-1 transparent fold' 151 endfor 152 153 154 155 " possibly concealed chars 156 let s:conceal = exists("+conceallevel") ? ' conceal' : '' 157 158 execute 'syn match VimwikiEqInChar contained /'. 159 \ vimwiki#vars#get_syntaxlocal('char_eqin').'/'.s:conceal 160 execute 'syn match VimwikiBoldChar contained /'. 161 \ vimwiki#vars#get_syntaxlocal('char_bold').'/'.s:conceal 162 execute 'syn match VimwikiItalicChar contained /'. 163 \ vimwiki#vars#get_syntaxlocal('char_italic').'/'.s:conceal 164 execute 'syn match VimwikiBoldItalicChar contained /'. 165 \ vimwiki#vars#get_syntaxlocal('char_bolditalic').'/'.s:conceal 166 execute 'syn match VimwikiItalicBoldChar contained /'. 167 \ vimwiki#vars#get_syntaxlocal('char_italicbold').'/'.s:conceal 168 execute 'syn match VimwikiCodeChar contained /'. 169 \ vimwiki#vars#get_syntaxlocal('char_code').'/'.s:conceal 170 execute 'syn match VimwikiDelTextChar contained /'. 171 \ vimwiki#vars#get_syntaxlocal('char_deltext').'/'.s:conceal 172 execute 'syn match VimwikiSuperScript contained /'. 173 \ vimwiki#vars#get_syntaxlocal('char_superscript').'/'.s:conceal 174 execute 'syn match VimwikiSubScript contained /'. 175 \ vimwiki#vars#get_syntaxlocal('char_subscript').'/'.s:conceal 176 177 178 179 180 181 let s:options = ' contained transparent contains=NONE' 182 183 " A shortener for long URLs: LinkRest (a middle part of the URL) is concealed 184 " VimwikiLinkRest group is left undefined if link shortening is not desired 185 if exists("+conceallevel") && vimwiki#vars#get_global('url_maxsave') > 0 186 let s:options .= s:conceal 187 execute 'syn match VimwikiLinkRest `\%(///\=[^/ \t]\+/\)\zs\S\+\ze' 188 \.'\%([/#?]\w\|\S\{'.vimwiki#vars#get_global('url_maxsave').'}\)`'.' cchar=~'.s:options 189 endif 190 191 " VimwikiLinkChar is for syntax markers (and also URL when a description 192 " is present) and may be concealed 193 194 " conceal wikilinks 195 execute 'syn match VimwikiLinkChar /'.vimwiki#vars#get_global('rx_wikilink_prefix').'/'.s:options 196 execute 'syn match VimwikiLinkChar /'.vimwiki#vars#get_global('rx_wikilink_suffix').'/'.s:options 197 execute 'syn match VimwikiLinkChar /'.vimwiki#vars#get_global('rx_wikilink_prefix1').'/'.s:options 198 execute 'syn match VimwikiLinkChar /'.vimwiki#vars#get_global('rx_wikilink_suffix1').'/'.s:options 199 200 " conceal wikiincls 201 execute 'syn match VimwikiLinkChar /'.vimwiki#vars#get_global('rxWikiInclPrefix').'/'.s:options 202 execute 'syn match VimwikiLinkChar /'.vimwiki#vars#get_global('rxWikiInclSuffix').'/'.s:options 203 execute 'syn match VimwikiLinkChar /'.vimwiki#vars#get_global('rxWikiInclPrefix1').'/'.s:options 204 execute 'syn match VimwikiLinkChar /'.vimwiki#vars#get_global('rxWikiInclSuffix1').'/'.s:options 205 206 207 " non concealed chars 208 execute 'syn match VimwikiHeaderChar contained /\%(^\s*'. 209 \ vimwiki#vars#get_syntaxlocal('rxH').'\+\)\|\%('.vimwiki#vars#get_syntaxlocal('rxH'). 210 \ '\+\s*$\)/' 211 execute 'syn match VimwikiEqInCharT contained /' 212 \ .vimwiki#vars#get_syntaxlocal('char_eqin').'/' 213 execute 'syn match VimwikiBoldCharT contained /' 214 \ .vimwiki#vars#get_syntaxlocal('char_bold').'/' 215 execute 'syn match VimwikiItalicCharT contained /' 216 \ .vimwiki#vars#get_syntaxlocal('char_italic').'/' 217 execute 'syn match VimwikiBoldItalicCharT contained /' 218 \ .vimwiki#vars#get_syntaxlocal('char_bolditalic').'/' 219 execute 'syn match VimwikiItalicBoldCharT contained /' 220 \ .vimwiki#vars#get_syntaxlocal('char_italicbold').'/' 221 execute 'syn match VimwikiCodeCharT contained /' 222 \ .vimwiki#vars#get_syntaxlocal('char_code').'/' 223 execute 'syn match VimwikiDelTextCharT contained /' 224 \ .vimwiki#vars#get_syntaxlocal('char_deltext').'/' 225 execute 'syn match VimwikiSuperScriptT contained /' 226 \ .vimwiki#vars#get_syntaxlocal('char_superscript').'/' 227 execute 'syn match VimwikiSubScriptT contained /' 228 \ .vimwiki#vars#get_syntaxlocal('char_subscript').'/' 229 230 231 execute 'syntax match VimwikiTodo /'. vimwiki#vars#get_global('rxTodo') .'/' 232 233 234 235 " Tables 236 syntax match VimwikiTableRow /^\s*|.\+|\s*$/ 237 \ transparent contains=VimwikiCellSeparator, 238 \ VimwikiLinkT, 239 \ VimwikiNoExistsLinkT, 240 \ VimwikiTodo, 241 \ VimwikiBoldT, 242 \ VimwikiItalicT, 243 \ VimwikiBoldItalicT, 244 \ VimwikiItalicBoldT, 245 \ VimwikiDelTextT, 246 \ VimwikiSuperScriptT, 247 \ VimwikiSubScriptT, 248 \ VimwikiCodeT, 249 \ VimwikiEqInT, 250 \ @Spell 251 syntax match VimwikiCellSeparator 252 \ /\%(|\)\|\%(-\@<=+\-\@=\)\|\%([|+]\@<=-\+\)/ contained 253 254 255 " Lists 256 execute 'syntax match VimwikiList /'.vimwiki#vars#get_syntaxlocal('rxListItemWithoutCB').'/' 257 execute 'syntax match VimwikiList /'.vimwiki#vars#get_syntaxlocal('rxListDefine').'/' 258 execute 'syntax match VimwikiListTodo /'.vimwiki#vars#get_syntaxlocal('rxListItem').'/' 259 260 if vimwiki#vars#get_global('hl_cb_checked') == 1 261 execute 'syntax match VimwikiCheckBoxDone /'.vimwiki#vars#get_syntaxlocal('rxListItemWithoutCB') 262 \ . '\s*\[['.vimwiki#vars#get_syntaxlocal('listsyms_list')[-1] 263 \ . vimwiki#vars#get_global('listsym_rejected') 264 \ . ']\]\s.*$/ contains=VimwikiNoExistsLink,VimwikiLink,@Spell' 265 elseif vimwiki#vars#get_global('hl_cb_checked') == 2 266 execute 'syntax match VimwikiCheckBoxDone /' 267 \ . vimwiki#vars#get_syntaxlocal('rxListItemAndChildren') 268 \ .'/ contains=VimwikiNoExistsLink,VimwikiLink,@Spell' 269 endif 270 271 272 execute 'syntax match VimwikiEqIn /'.vimwiki#vars#get_syntaxlocal('rxEqIn'). 273 \ '/ contains=VimwikiEqInChar' 274 execute 'syntax match VimwikiEqInT /'.vimwiki#vars#get_syntaxlocal('rxEqIn'). 275 \ '/ contained contains=VimwikiEqInCharT' 276 277 execute 'syntax match VimwikiBold /'.vimwiki#vars#get_syntaxlocal('rxBold'). 278 \ '/ contains=VimwikiBoldChar,@Spell' 279 execute 'syntax match VimwikiBoldT /'.vimwiki#vars#get_syntaxlocal('rxBold'). 280 \ '/ contained contains=VimwikiBoldCharT,@Spell' 281 282 execute 'syntax match VimwikiItalic /'.vimwiki#vars#get_syntaxlocal('rxItalic'). 283 \ '/ contains=VimwikiItalicChar,@Spell' 284 execute 'syntax match VimwikiItalicT /'.vimwiki#vars#get_syntaxlocal('rxItalic'). 285 \ '/ contained contains=VimwikiItalicCharT,@Spell' 286 287 execute 'syntax match VimwikiBoldItalic /'.vimwiki#vars#get_syntaxlocal('rxBoldItalic'). 288 \ '/ contains=VimwikiBoldItalicChar,VimwikiItalicBoldChar,@Spell' 289 execute 'syntax match VimwikiBoldItalicT /'.vimwiki#vars#get_syntaxlocal('rxBoldItalic'). 290 \ '/ contained contains=VimwikiBoldItalicChatT,VimwikiItalicBoldCharT,@Spell' 291 292 execute 'syntax match VimwikiItalicBold /'.vimwiki#vars#get_syntaxlocal('rxItalicBold'). 293 \ '/ contains=VimwikiBoldItalicChar,VimwikiItalicBoldChar,@Spell' 294 execute 'syntax match VimwikiItalicBoldT /'.vimwiki#vars#get_syntaxlocal('rxItalicBold'). 295 \ '/ contained contains=VimwikiBoldItalicCharT,VimsikiItalicBoldCharT,@Spell' 296 297 execute 'syntax match VimwikiDelText /'.vimwiki#vars#get_syntaxlocal('rxDelText'). 298 \ '/ contains=VimwikiDelTextChar,@Spell' 299 execute 'syntax match VimwikiDelTextT /'.vimwiki#vars#get_syntaxlocal('rxDelText'). 300 \ '/ contained contains=VimwikiDelTextCharT,@Spell' 301 302 execute 'syntax match VimwikiSuperScript /'.vimwiki#vars#get_syntaxlocal('rxSuperScript'). 303 \ '/ contains=VimwikiSuperScriptChar,@Spell' 304 execute 'syntax match VimwikiSuperScriptT /'.vimwiki#vars#get_syntaxlocal('rxSuperScript'). 305 \ '/ contained contains=VimwikiSuperScriptCharT,@Spell' 306 307 execute 'syntax match VimwikiSubScript /'.vimwiki#vars#get_syntaxlocal('rxSubScript'). 308 \ '/ contains=VimwikiSubScriptChar,@Spell' 309 execute 'syntax match VimwikiSubScriptT /'.vimwiki#vars#get_syntaxlocal('rxSubScript'). 310 \ '/ contained contains=VimwikiSubScriptCharT,@Spell' 311 312 execute 'syntax match VimwikiCode /'.vimwiki#vars#get_syntaxlocal('rxCode'). 313 \ '/ contains=VimwikiCodeChar' 314 execute 'syntax match VimwikiCodeT /'.vimwiki#vars#get_syntaxlocal('rxCode'). 315 \ '/ contained contains=VimwikiCodeCharT' 316 317 318 " <hr> horizontal rule 319 execute 'syntax match VimwikiHR /'.vimwiki#vars#get_syntaxlocal('rxHR').'/' 320 321 execute 'syntax region VimwikiPre start=/'.vimwiki#vars#get_syntaxlocal('rxPreStart'). 322 \ '/ end=/'.vimwiki#vars#get_syntaxlocal('rxPreEnd').'/ contains=@Spell' 323 324 execute 'syntax region VimwikiMath start=/'.vimwiki#vars#get_syntaxlocal('rxMathStart'). 325 \ '/ end=/'.vimwiki#vars#get_syntaxlocal('rxMathEnd').'/ contains=@Spell' 326 327 328 " placeholders 329 syntax match VimwikiPlaceholder /^\s*%nohtml\s*$/ 330 syntax match VimwikiPlaceholder 331 \ /^\s*%title\ze\%(\s.*\)\?$/ nextgroup=VimwikiPlaceholderParam skipwhite 332 syntax match VimwikiPlaceholder 333 \ /^\s*%date\ze\%(\s.*\)\?$/ nextgroup=VimwikiPlaceholderParam skipwhite 334 syntax match VimwikiPlaceholder 335 \ /^\s*%template\ze\%(\s.*\)\?$/ nextgroup=VimwikiPlaceholderParam skipwhite 336 syntax match VimwikiPlaceholderParam /.*/ contained 337 338 339 " html tags 340 if vimwiki#vars#get_global('valid_html_tags') != '' 341 let s:html_tags = join(split(vimwiki#vars#get_global('valid_html_tags'), '\s*,\s*'), '\|') 342 exe 'syntax match VimwikiHTMLtag #\c</\?\%('.s:html_tags.'\)\%(\s\{-1}\S\{-}\)\{-}\s*/\?>#' 343 execute 'syntax match VimwikiBold #\c<b>.\{-}</b># contains=VimwikiHTMLTag' 344 execute 'syntax match VimwikiItalic #\c<i>.\{-}</i># contains=VimwikiHTMLTag' 345 execute 'syntax match VimwikiUnderline #\c<u>.\{-}</u># contains=VimwikiHTMLTag' 346 347 execute 'syntax match VimwikiComment /'.vimwiki#vars#get_syntaxlocal('rxComment'). 348 \ '/ contains=@Spell,VimwikiTodo' 349 endif 350 351 " tags 352 execute 'syntax match VimwikiTag /'.vimwiki#vars#get_syntaxlocal('rxTags').'/' 353 354 355 356 " header groups highlighting 357 if vimwiki#vars#get_global('hl_headers') == 0 358 " Strangely in default colorscheme Title group is not set to bold for cterm... 359 if !exists("g:colors_name") 360 hi Title cterm=bold 361 endif 362 for s:i in range(1,6) 363 execute 'hi def link VimwikiHeader'.s:i.' Title' 364 endfor 365 else 366 for s:i in range(1,6) 367 execute 'hi def VimwikiHeader'.s:i.' guibg=bg guifg=' 368 \ .vimwiki#vars#get_global('hcolor_guifg_'.&bg)[s:i-1].' gui=bold ctermfg=' 369 \ .vimwiki#vars#get_global('hcolor_ctermfg_'.&bg)[s:i-1].' term=bold cterm=bold' 370 endfor 371 endif 372 373 374 375 hi def link VimwikiMarkers Normal 376 377 hi def link VimwikiEqIn Number 378 hi def link VimwikiEqInT VimwikiEqIn 379 380 hi def VimwikiBold term=bold cterm=bold gui=bold 381 hi def link VimwikiBoldT VimwikiBold 382 383 hi def VimwikiItalic term=italic cterm=italic gui=italic 384 hi def link VimwikiItalicT VimwikiItalic 385 386 hi def VimwikiBoldItalic term=bold cterm=bold gui=bold,italic 387 hi def link VimwikiItalicBold VimwikiBoldItalic 388 hi def link VimwikiBoldItalicT VimwikiBoldItalic 389 hi def link VimwikiItalicBoldT VimwikiBoldItalic 390 391 hi def VimwikiUnderline gui=underline 392 393 hi def link VimwikiCode PreProc 394 hi def link VimwikiCodeT VimwikiCode 395 396 hi def link VimwikiPre PreProc 397 hi def link VimwikiPreT VimwikiPre 398 399 hi def link VimwikiMath Number 400 hi def link VimwikiMathT VimwikiMath 401 402 hi def link VimwikiNoExistsLink SpellBad 403 hi def link VimwikiNoExistsLinkT VimwikiNoExistsLink 404 405 hi def link VimwikiLink Underlined 406 hi def link VimwikiLinkT VimwikiLink 407 408 hi def link VimwikiList Identifier 409 hi def link VimwikiListTodo VimwikiList 410 hi def link VimwikiCheckBoxDone Comment 411 hi def link VimwikiHR Identifier 412 hi def link VimwikiTag Keyword 413 414 hi def link VimwikiDelText Constant 415 hi def link VimwikiDelTextT VimwikiDelText 416 417 hi def link VimwikiSuperScript Number 418 hi def link VimwikiSuperScriptT VimwikiSuperScript 419 420 hi def link VimwikiSubScript Number 421 hi def link VimwikiSubScriptT VimwikiSubScript 422 423 hi def link VimwikiTodo Todo 424 hi def link VimwikiComment Comment 425 426 hi def link VimwikiPlaceholder SpecialKey 427 hi def link VimwikiPlaceholderParam String 428 hi def link VimwikiHTMLtag SpecialKey 429 430 hi def link VimwikiEqInChar VimwikiMarkers 431 hi def link VimwikiCellSeparator VimwikiMarkers 432 hi def link VimwikiBoldChar VimwikiMarkers 433 hi def link VimwikiItalicChar VimwikiMarkers 434 hi def link VimwikiBoldItalicChar VimwikiMarkers 435 hi def link VimwikiItalicBoldChar VimwikiMarkers 436 hi def link VimwikiDelTextChar VimwikiMarkers 437 hi def link VimwikiSuperScriptChar VimwikiMarkers 438 hi def link VimwikiSubScriptChar VimwikiMarkers 439 hi def link VimwikiCodeChar VimwikiMarkers 440 hi def link VimwikiHeaderChar VimwikiMarkers 441 442 hi def link VimwikiEqInCharT VimwikiMarkers 443 hi def link VimwikiBoldCharT VimwikiMarkers 444 hi def link VimwikiItalicCharT VimwikiMarkers 445 hi def link VimwikiBoldItalicCharT VimwikiMarkers 446 hi def link VimwikiItalicBoldCharT VimwikiMarkers 447 hi def link VimwikiDelTextCharT VimwikiMarkers 448 hi def link VimwikiSuperScriptCharT VimwikiMarkers 449 hi def link VimwikiSubScriptCharT VimwikiMarkers 450 hi def link VimwikiCodeCharT VimwikiMarkers 451 hi def link VimwikiHeaderCharT VimwikiMarkers 452 hi def link VimwikiLinkCharT VimwikiLinkT 453 hi def link VimwikiNoExistsLinkCharT VimwikiNoExistsLinkT 454 455 456 " Load syntax-specific functionality 457 call vimwiki#u#reload_regexes_custom() 458 459 460 " FIXME it now does not make sense to pretend there is a single syntax "vimwiki" 461 let b:current_syntax="vimwiki" 462 463 464 " EMBEDDED syntax setup 465 let s:nested = vimwiki#vars#get_wikilocal('nested_syntaxes') 466 if vimwiki#vars#get_wikilocal('automatic_nested_syntaxes') 467 let s:nested = extend(s:nested, vimwiki#base#detect_nested_syntax(), "keep") 468 endif 469 if !empty(s:nested) 470 for [s:hl_syntax, s:vim_syntax] in items(s:nested) 471 call vimwiki#base#nested_syntax(s:vim_syntax, 472 \ vimwiki#vars#get_syntaxlocal('rxPreStart').'\%(.*[[:blank:][:punct:]]\)\?'. 473 \ s:hl_syntax.'\%([[:blank:][:punct:]].*\)\?', 474 \ vimwiki#vars#get_syntaxlocal('rxPreEnd'), 'VimwikiPre') 475 endfor 476 endif 477 478 479 " LaTeX 480 call vimwiki#base#nested_syntax('tex', 481 \ vimwiki#vars#get_syntaxlocal('rxMathStart').'\%(.*[[:blank:][:punct:]]\)\?'. 482 \ '\%([[:blank:][:punct:]].*\)\?', 483 \ vimwiki#vars#get_syntaxlocal('rxMathEnd'), 'VimwikiMath') 484 485 486 syntax spell toplevel 487