2018-04-20 07:03:53 +02:00
|
|
|
" vim:tabstop=2:shiftwidth=2:expandtab:textwidth=99
|
2010-01-20 01:00:00 +01:00
|
|
|
" Vimwiki syntax file
|
2018-04-20 07:03:53 +02:00
|
|
|
" Description: Defines default syntax
|
2015-02-23 12:10:42 +01:00
|
|
|
" Home: https://github.com/vimwiki/vimwiki/
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2018-04-20 07:03:53 +02:00
|
|
|
|
2016-12-28 22:17:08 +01:00
|
|
|
" s:default_syntax is kind of a reference to the dict in
|
|
|
|
" g:vimwiki_syntax_variables['default']. It is used here simply as an
|
|
|
|
" abbreviation for the latter.
|
|
|
|
let s:default_syntax = g:vimwiki_syntax_variables['default']
|
|
|
|
|
2018-04-20 07:03:53 +02:00
|
|
|
|
2020-08-02 09:51:25 +02:00
|
|
|
" TODO mutualise
|
|
|
|
" Get config: possibly concealed chars
|
|
|
|
let b:vimwiki_syntax_conceal = exists('+conceallevel') ? ' conceal' : ''
|
|
|
|
let b:vimwiki_syntax_concealends = has('conceal') ? ' concealends' : ''
|
2018-04-20 07:03:53 +02:00
|
|
|
|
2020-08-02 09:51:25 +02:00
|
|
|
" Typeface:
|
|
|
|
let s:default_syntax.dTypeface = {}
|
2012-06-07 02:00:00 +02:00
|
|
|
|
2010-01-20 01:00:00 +01:00
|
|
|
" text: *strong*
|
2020-08-02 09:51:25 +02:00
|
|
|
let s:default_syntax.dTypeface['bold'] = [
|
|
|
|
\ ['\S\@<=\*\|\*\S\@=', '\S\@<=\*\|\*\S\@='],
|
|
|
|
\ ]
|
|
|
|
|
|
|
|
" text: _italic_
|
|
|
|
let s:default_syntax.dTypeface['italic'] = [
|
|
|
|
\ ['\S\@<=_\|_\S\@=', '\S\@<=_\|_\S\@='],
|
|
|
|
\ ]
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2020-08-02 09:51:25 +02:00
|
|
|
" text: no underline defined
|
|
|
|
let s:default_syntax.dTypeface['underline'] = []
|
2010-01-20 01:00:00 +01:00
|
|
|
|
|
|
|
" text: *_bold italic_* or _*italic bold*_
|
2020-08-02 09:51:25 +02:00
|
|
|
let s:default_syntax.dTypeface['bold_italic'] = [
|
|
|
|
\ ['\S\@<=\*_\|\*_\S\@=', '\S\@<=_\*\|_\*\S\@='],
|
|
|
|
\ ['\S\@<=_\*\|_\*\S\@=', '\S\@<=\*_\|\*_\S\@='],
|
|
|
|
\ ]
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2020-08-02 09:51:25 +02:00
|
|
|
|
|
|
|
" text: $ equation_inline $
|
|
|
|
let s:default_syntax.rxEqIn = '\$[^$`]\+\$'
|
|
|
|
let s:default_syntax.char_eqin = '\$'
|
2010-01-20 01:00:00 +01:00
|
|
|
|
|
|
|
" text: `code`
|
2016-12-28 22:17:08 +01:00
|
|
|
let s:default_syntax.rxCode = '`[^`]\+`'
|
|
|
|
let s:default_syntax.char_code = '`'
|
2010-01-20 01:00:00 +01:00
|
|
|
|
|
|
|
" text: ~~deleted text~~
|
2016-12-28 22:17:08 +01:00
|
|
|
let s:default_syntax.rxDelText = '\~\~[^~`]\+\~\~'
|
|
|
|
let s:default_syntax.char_deltext = '\~\~'
|
2010-01-20 01:00:00 +01:00
|
|
|
|
|
|
|
" text: ^superscript^
|
2016-12-28 22:17:08 +01:00
|
|
|
let s:default_syntax.rxSuperScript = '\^[^^`]\+\^'
|
|
|
|
let s:default_syntax.char_superscript = '^'
|
2010-01-20 01:00:00 +01:00
|
|
|
|
|
|
|
" text: ,,subscript,,
|
2016-12-28 22:17:08 +01:00
|
|
|
let s:default_syntax.rxSubScript = ',,[^,`]\+,,'
|
|
|
|
let s:default_syntax.char_subscript = ',,'
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2012-06-07 02:00:00 +02:00
|
|
|
" generic headers
|
2016-12-28 22:17:08 +01:00
|
|
|
let s:default_syntax.rxH = '='
|
|
|
|
let s:default_syntax.symH = 1
|
2012-06-07 02:00:00 +02:00
|
|
|
|
|
|
|
|
2010-08-24 02:00:00 +02:00
|
|
|
|
2010-01-20 01:00:00 +01:00
|
|
|
" <hr>, horizontal rule
|
2016-12-28 22:17:08 +01:00
|
|
|
let s:default_syntax.rxHR = '^-----*$'
|
2012-06-07 02:00:00 +02:00
|
|
|
|
|
|
|
" Tables. Each line starts and ends with '|'; each cell is separated by '|'
|
2016-12-28 22:17:08 +01:00
|
|
|
let s:default_syntax.rxTableSep = '|'
|
2010-01-20 01:00:00 +01:00
|
|
|
|
2013-07-14 18:58:46 +02:00
|
|
|
" Lists
|
2016-12-28 22:17:08 +01:00
|
|
|
let s:default_syntax.bullet_types = ['-', '*', '#']
|
|
|
|
" 1 means the bullets can be repeatet to indicate the level, like * ** ***
|
|
|
|
" 0 means the bullets stand on their own and the level is indicated by the indentation
|
|
|
|
let s:default_syntax.recurring_bullets = 0
|
|
|
|
let s:default_syntax.number_types = ['1)', '1.', 'i)', 'I)', 'a)', 'A)']
|
2013-07-14 18:58:46 +02:00
|
|
|
"this should contain at least one element
|
2013-07-17 15:57:35 +02:00
|
|
|
"it is used for i_<C-L><C-J> among other things
|
2016-12-28 22:17:08 +01:00
|
|
|
let s:default_syntax.list_markers = ['-', '1.', '*', 'I)', 'a)']
|
|
|
|
let s:default_syntax.rxListDefine = '::\(\s\|$\)'
|
2013-07-17 15:57:35 +02:00
|
|
|
|
2010-01-20 01:00:00 +01:00
|
|
|
" Preformatted text
|
2016-12-28 22:17:08 +01:00
|
|
|
let s:default_syntax.rxPreStart = '{{{'
|
|
|
|
let s:default_syntax.rxPreEnd = '}}}'
|
2011-06-11 02:00:00 +02:00
|
|
|
|
2012-06-07 02:00:00 +02:00
|
|
|
" Math block
|
2016-12-28 22:17:08 +01:00
|
|
|
let s:default_syntax.rxMathStart = '{{\$'
|
|
|
|
let s:default_syntax.rxMathEnd = '}}\$'
|
|
|
|
|
2020-08-01 07:12:21 +02:00
|
|
|
let s:default_syntax.rxMultilineCommentStart = '%%+'
|
|
|
|
let s:default_syntax.rxMultilineCommentEnd = '+%%'
|
2016-12-28 22:17:08 +01:00
|
|
|
let s:default_syntax.rxComment = '^\s*%%.*$'
|
|
|
|
let s:default_syntax.rxTags = '\%(^\|\s\)\@<=:\%([^:''[:space:]]\+:\)\+\%(\s\|$\)\@='
|
|
|
|
|
|
|
|
let s:default_syntax.header_search = '^\s*\(=\{1,6}\)\([^=].*[^=]\)\1\s*$'
|
|
|
|
let s:default_syntax.header_match = '^\s*\(=\{1,6}\)=\@!\s*__Header__\s*\1=\@!\s*$'
|
2018-04-20 07:03:53 +02:00
|
|
|
let s:default_syntax.bold_search = '\%(^\|\s\|[[:punct:]]\)\@<=\*\zs\%([^*`[:space:]][^*`]*'.
|
|
|
|
\ '[^*`[:space:]]\|[^*`[:space:]]\)\ze\*\%([[:punct:]]\|\s\|$\)\@='
|
|
|
|
let s:default_syntax.bold_match = '\%(^\|\s\|[[:punct:]]\)\@<=\*__Text__\*'.
|
|
|
|
\ '\%([[:punct:]]\|\s\|$\)\@='
|
2016-12-28 22:17:08 +01:00
|
|
|
let s:default_syntax.wikilink = '\[\[\zs[^\\\]|]\+\ze\%(|[^\\\]]\+\)\?\]\]'
|
|
|
|
let s:default_syntax.tag_search = '\(^\|\s\)\zs:\([^:''[:space:]]\+:\)\+\ze\(\s\|$\)'
|
2018-04-20 07:03:53 +02:00
|
|
|
let s:default_syntax.tag_match = '\(^\|\s\):\([^:''[:space:]]\+:\)*__Tag__:'.
|
|
|
|
\ '\([^:[:space:]]\+:\)*\(\s\|$\)'
|