2018-02-21 07:11:51 +01:00
|
|
|
" vim:tabstop=2:shiftwidth=2:expandtab:foldmethod=marker:textwidth=99
|
2012-06-07 02:00:00 +02:00
|
|
|
" Vimwiki syntax file
|
2015-02-23 12:10:42 +01:00
|
|
|
" Desc: Defines markdown syntax
|
|
|
|
" Home: https://github.com/vimwiki/vimwiki/
|
2012-06-07 02:00:00 +02:00
|
|
|
|
2017-01-07 21:51:15 +01:00
|
|
|
" see the comments in vimwiki_default.vim for some info about this file
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
" text: *strong*
|
2017-01-07 21:51:15 +01:00
|
|
|
" let s:markdown_syntax.rxBold = '\*[^*]\+\*'
|
|
|
|
let s:markdown_syntax.rxBold = '\%(^\|\s\|[[:punct:]]\)\@<='.
|
2012-06-07 02:00:00 +02:00
|
|
|
\'\*'.
|
|
|
|
\'\%([^*`[:space:]][^*`]*[^*`[:space:]]\|[^*`[:space:]]\)'.
|
|
|
|
\'\*'.
|
|
|
|
\'\%([[:punct:]]\|\s\|$\)\@='
|
2017-01-07 21:51:15 +01:00
|
|
|
let s:markdown_syntax.char_bold = '*'
|
2012-06-07 02:00:00 +02:00
|
|
|
|
|
|
|
" text: _emphasis_
|
2017-01-07 21:51:15 +01:00
|
|
|
" let s:markdown_syntax.rxItalic = '_[^_]\+_'
|
|
|
|
let s:markdown_syntax.rxItalic = '\%(^\|\s\|[[:punct:]]\)\@<='.
|
2012-06-07 02:00:00 +02:00
|
|
|
\'_'.
|
|
|
|
\'\%([^_`[:space:]][^_`]*[^_`[:space:]]\|[^_`[:space:]]\)'.
|
|
|
|
\'_'.
|
|
|
|
\'\%([[:punct:]]\|\s\|$\)\@='
|
2017-01-07 21:51:15 +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:]]\)\@<='.
|
2012-06-07 02:00:00 +02:00
|
|
|
\'\*_'.
|
|
|
|
\'\%([^*_`[:space:]][^*_`]*[^*_`[:space:]]\|[^*_`[:space:]]\)'.
|
|
|
|
\'_\*'.
|
|
|
|
\'\%([[:punct:]]\|\s\|$\)\@='
|
2017-01-07 21:51:15 +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:]]\)\@<='.
|
2012-06-07 02:00:00 +02:00
|
|
|
\'_\*'.
|
|
|
|
\'\%([^*_`[:space:]][^*_`]*[^*_`[:space:]]\|[^*_`[:space:]]\)'.
|
|
|
|
\'\*_'.
|
|
|
|
\'\%([[:punct:]]\|\s\|$\)\@='
|
2017-01-07 21:51:15 +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
|
2017-01-07 21:51:15 +01: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
|
|
|
|
2012-06-07 02:00:00 +02:00
|
|
|
" Preformatted text
|
2017-01-07 21:51:15 +01:00
|
|
|
let s:markdown_syntax.rxPreStart = '```'
|
|
|
|
let s:markdown_syntax.rxPreEnd = '```'
|
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*$'
|
|
|
|
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\%(|[^\\\]]\+\)\?\]\]' "XXX plus markdown-style links
|
|
|
|
let s:markdown_syntax.tag_search = '\(^\|\s\)\zs:\([^:''[:space:]]\+:\)\+\ze\(\s\|$\)'
|
|
|
|
let s:markdown_syntax.tag_match = '\(^\|\s\):\([^:''[:space:]]\+:\)*__Tag__:\([^:[:space:]]\+:\)*\(\s\|$\)'
|