2018-04-20 07:03:53 +02:00
|
|
|
" vim:tabstop=2:shiftwidth=2:expandtab:textwidth=99
|
2012-06-07 02:00:00 +02:00
|
|
|
" Vimwiki syntax file
|
2018-04-20 07:03:53 +02:00
|
|
|
" Description: Defines markdown syntax
|
2015-02-23 12:10:42 +01:00
|
|
|
" Home: https://github.com/vimwiki/vimwiki/
|
2012-06-07 02:00:00 +02:00
|
|
|
|
2018-04-20 07:03:53 +02:00
|
|
|
|
2017-01-07 21:51:15 +01:00
|
|
|
" see the comments in vimwiki_default.vim for some info about this file
|
|
|
|
|
2018-04-20 07:03:53 +02:00
|
|
|
|
2017-01-07 21:51:15 +01:00
|
|
|
let s:markdown_syntax = g:vimwiki_syntax_variables['markdown']
|
|
|
|
|
2012-06-07 02:00:00 +02:00
|
|
|
" text: $ equation_inline $
|
2017-01-07 21:51:15 +01:00
|
|
|
let s:markdown_syntax.rxEqIn = '\$[^$`]\+\$'
|
|
|
|
let s:markdown_syntax.char_eqin = '\$'
|
2012-06-07 02:00:00 +02:00
|
|
|
|
2019-03-14 21:03:42 +01:00
|
|
|
" text: **strong** or __strong__
|
2017-01-07 21:51:15 +01:00
|
|
|
let s:markdown_syntax.rxBold = '\%(^\|\s\|[[:punct:]]\)\@<='.
|
2019-03-14 21:03:42 +01:00
|
|
|
\'\(\*\|_\)\{2\}'.
|
|
|
|
\'\%([^*_`[:space:]][^*_`]*[^*_`[:space:]]\|[^*_`[:space:]]\)'.
|
|
|
|
\'\1\{2\}'.
|
2012-06-07 02:00:00 +02:00
|
|
|
\'\%([[:punct:]]\|\s\|$\)\@='
|
2019-03-14 21:03:42 +01:00
|
|
|
let s:markdown_syntax.char_bold = '\*\*\|__'
|
2012-06-07 02:00:00 +02:00
|
|
|
|
2019-03-14 21:03:42 +01:00
|
|
|
" text: _emphasis_ or *emphasis*
|
2017-01-07 21:51:15 +01:00
|
|
|
let s:markdown_syntax.rxItalic = '\%(^\|\s\|[[:punct:]]\)\@<='.
|
2019-03-14 21:03:42 +01:00
|
|
|
\'\(\*\|_\)'.
|
|
|
|
\'\%([^*_`[:space:]][^*_`]*[^*_`[:space:]]\|[^*_`[:space:]]\)'.
|
|
|
|
\'\1'.
|
2012-06-07 02:00:00 +02:00
|
|
|
\'\%([[:punct:]]\|\s\|$\)\@='
|
2019-03-14 21:03:42 +01:00
|
|
|
let s:markdown_syntax.char_italic = '\*\|_'
|
2012-06-07 02:00:00 +02:00
|
|
|
|
|
|
|
" text: *_bold italic_* or _*italic bold*_
|
2017-01-07 21:51:15 +01:00
|
|
|
let s:markdown_syntax.rxBoldItalic = '\%(^\|\s\|[[:punct:]]\)\@<='.
|
2019-03-14 22:21:04 +01:00
|
|
|
\'\(\*\)\{3\}'.
|
|
|
|
\'\%([^*`[:space:]][^*`]*[^*`[:space:]]\|[^*`[:space:]]\)'.
|
|
|
|
\'\1\{3\}'.
|
2012-06-07 02:00:00 +02:00
|
|
|
\'\%([[:punct:]]\|\s\|$\)\@='
|
2019-03-14 22:21:04 +01:00
|
|
|
let s:markdown_syntax.char_bolditalic = '\*\*\*'
|
2012-06-07 02:00:00 +02:00
|
|
|
|
2017-01-07 21:51:15 +01:00
|
|
|
let s:markdown_syntax.rxItalicBold = '\%(^\|\s\|[[:punct:]]\)\@<='.
|
2019-03-14 22:21:04 +01:00
|
|
|
\'\(_\)\{3\}'.
|
|
|
|
\'\%([^_`[:space:]][^_`]*[^_`[:space:]]\|[^_`[:space:]]\)'.
|
|
|
|
\'\1\{3\}'.
|
2012-06-07 02:00:00 +02:00
|
|
|
\'\%([[:punct:]]\|\s\|$\)\@='
|
2019-03-14 22:21:04 +01:00
|
|
|
let s:markdown_syntax.char_italicbold = '___'
|
2012-06-07 02:00:00 +02:00
|
|
|
|
|
|
|
" text: `code`
|
2017-01-07 21:51:15 +01:00
|
|
|
let s:markdown_syntax.rxCode = '`[^`]\+`'
|
|
|
|
let s:markdown_syntax.char_code = '`'
|
2012-06-07 02:00:00 +02:00
|
|
|
|
|
|
|
" text: ~~deleted text~~
|
2017-01-07 21:51:15 +01:00
|
|
|
let s:markdown_syntax.rxDelText = '\~\~[^~`]\+\~\~'
|
|
|
|
let s:markdown_syntax.char_deltext = '\~\~'
|
2012-06-07 02:00:00 +02:00
|
|
|
|
|
|
|
" text: ^superscript^
|
2017-01-07 21:51:15 +01:00
|
|
|
let s:markdown_syntax.rxSuperScript = '\^[^^`]\+\^'
|
|
|
|
let s:markdown_syntax.char_superscript = '^'
|
2012-06-07 02:00:00 +02:00
|
|
|
|
|
|
|
" text: ,,subscript,,
|
2017-01-07 21:51:15 +01:00
|
|
|
let s:markdown_syntax.rxSubScript = ',,[^,`]\+,,'
|
|
|
|
let s:markdown_syntax.char_subscript = ',,'
|
2012-06-07 02:00:00 +02:00
|
|
|
|
|
|
|
" generic headers
|
2017-01-07 21:51:15 +01:00
|
|
|
let s:markdown_syntax.rxH = '#'
|
|
|
|
let s:markdown_syntax.symH = 0
|
2012-06-07 02:00:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" <hr>, horizontal rule
|
2019-05-24 05:59:13 +02:00
|
|
|
let s:markdown_syntax.rxHR = '\(^---*$\|^___*$\|^\*\*\**$\)'
|
2012-06-07 02:00:00 +02:00
|
|
|
|
|
|
|
" Tables. Each line starts and ends with '|'; each cell is separated by '|'
|
2017-01-07 21:51:15 +01:00
|
|
|
let s:markdown_syntax.rxTableSep = '|'
|
2012-06-07 02:00:00 +02:00
|
|
|
|
2013-07-14 18:58:46 +02:00
|
|
|
" Lists
|
2017-01-07 21:51:15 +01:00
|
|
|
let s:markdown_syntax.bullet_types = ['-', '*', '+']
|
|
|
|
let s:markdown_syntax.recurring_bullets = 0
|
|
|
|
let s:markdown_syntax.number_types = ['1.']
|
|
|
|
let s:markdown_syntax.list_markers = ['-', '*', '+', '1.']
|
|
|
|
let s:markdown_syntax.rxListDefine = '::\%(\s\|$\)'
|
2013-07-18 07:55:24 +02:00
|
|
|
|
2020-01-03 15:10:02 +01:00
|
|
|
" Preformatted text (code blocks)
|
2020-01-01 18:58:56 +01:00
|
|
|
let s:markdown_syntax.rxPreStart = '\%(`\{3,}\|\~\{3,}\)'
|
|
|
|
let s:markdown_syntax.rxPreEnd = '\%(`\{3,}\|\~\{3,}\)'
|
2020-01-08 14:03:40 +01:00
|
|
|
" TODO see syntax/vimwiki_markdown_custom.vim for more info
|
|
|
|
" let s:markdown_syntax.rxIndentedCodeBlock = '\%(^\n\)\@1<=\%(\%(\s\{4,}\|\t\+\).*\n\)\+'
|
2012-06-07 02:00:00 +02:00
|
|
|
|
|
|
|
" Math block
|
2017-01-07 21:51:15 +01:00
|
|
|
let s:markdown_syntax.rxMathStart = '\$\$'
|
|
|
|
let s:markdown_syntax.rxMathEnd = '\$\$'
|
|
|
|
|
2018-04-01 21:45:15 +02:00
|
|
|
let s:markdown_syntax.rxComment = '^\s*%%.*$\|<!--[^>]*-->'
|
2017-01-07 21:51:15 +01:00
|
|
|
let s:markdown_syntax.rxTags = '\%(^\|\s\)\@<=:\%([^:[:space:]]\+:\)\+\%(\s\|$\)\@='
|
|
|
|
|
|
|
|
let s:markdown_syntax.header_search = '^\s*\(#\{1,6}\)\([^#].*\)$'
|
|
|
|
let s:markdown_syntax.header_match = '^\s*\(#\{1,6}\)#\@!\s*__Header__\s*$'
|
2018-04-20 07:03:53 +02:00
|
|
|
let s:markdown_syntax.bold_search = '\%(^\|\s\|[[:punct:]]\)\@<=\*\zs'.
|
|
|
|
\ '\%([^*`[:space:]][^*`]*[^*`[:space:]]\|[^*`[:space:]]\)\ze\*\%([[:punct:]]\|\s\|$\)\@='
|
|
|
|
let s:markdown_syntax.bold_match = '\%(^\|\s\|[[:punct:]]\)\@<=\*__Text__\*'.
|
|
|
|
\ '\%([[:punct:]]\|\s\|$\)\@='
|
|
|
|
let s:markdown_syntax.wikilink = '\[\[\zs[^\\\]|]\+\ze\%(|[^\\\]]\+\)\?\]\]'
|
2017-01-07 21:51:15 +01:00
|
|
|
let s:markdown_syntax.tag_search = '\(^\|\s\)\zs:\([^:''[:space:]]\+:\)\+\ze\(\s\|$\)'
|
2018-04-20 07:03:53 +02:00
|
|
|
let s:markdown_syntax.tag_match = '\(^\|\s\):\([^:''[:space:]]\+:\)*__Tag__:'.
|
|
|
|
\ '\([^:[:space:]]\+:\)*\(\s\|$\)'
|