dotfiles

<-- duh.
git clone https://hhvn.uk/dotfiles
git clone git://hhvn.uk/dotfiles
Log | Files | Refs | Submodules | LICENSE

vimwiki_markdown.vim (3576B)


      1 " vim:tabstop=2:shiftwidth=2:expandtab:textwidth=99
      2 " Vimwiki syntax file
      3 " Description: Defines markdown syntax
      4 " Home: https://github.com/vimwiki/vimwiki/
      5 
      6 
      7 " see the comments in vimwiki_default.vim for some info about this file
      8 
      9 
     10 let s:markdown_syntax = g:vimwiki_syntax_variables['markdown']
     11 
     12 " text: $ equation_inline $
     13 let s:markdown_syntax.rxEqIn = '\$[^$`]\+\$'
     14 let s:markdown_syntax.char_eqin = '\$'
     15 
     16 " text: *strong*
     17 " let s:markdown_syntax.rxBold = '\*[^*]\+\*'
     18 let s:markdown_syntax.rxBold = '\%(^\|\s\|[[:punct:]]\)\@<='.
     19       \'\*'.
     20       \'\%([^*`[:space:]][^*`]*[^*`[:space:]]\|[^*`[:space:]]\)'.
     21       \'\*'.
     22       \'\%([[:punct:]]\|\s\|$\)\@='
     23 let s:markdown_syntax.char_bold = '*'
     24 
     25 " text: _emphasis_
     26 " let s:markdown_syntax.rxItalic = '_[^_]\+_'
     27 let s:markdown_syntax.rxItalic = '\%(^\|\s\|[[:punct:]]\)\@<='.
     28       \'_'.
     29       \'\%([^_`[:space:]][^_`]*[^_`[:space:]]\|[^_`[:space:]]\)'.
     30       \'_'.
     31       \'\%([[:punct:]]\|\s\|$\)\@='
     32 let s:markdown_syntax.char_italic = '_'
     33 
     34 " text: *_bold italic_* or _*italic bold*_
     35 let s:markdown_syntax.rxBoldItalic = '\%(^\|\s\|[[:punct:]]\)\@<='.
     36       \'\*_'.
     37       \'\%([^*_`[:space:]][^*_`]*[^*_`[:space:]]\|[^*_`[:space:]]\)'.
     38       \'_\*'.
     39       \'\%([[:punct:]]\|\s\|$\)\@='
     40 let s:markdown_syntax.char_bolditalic = '\*_'
     41 
     42 let s:markdown_syntax.rxItalicBold = '\%(^\|\s\|[[:punct:]]\)\@<='.
     43       \'_\*'.
     44       \'\%([^*_`[:space:]][^*_`]*[^*_`[:space:]]\|[^*_`[:space:]]\)'.
     45       \'\*_'.
     46       \'\%([[:punct:]]\|\s\|$\)\@='
     47 let s:markdown_syntax.char_italicbold = '_\*'
     48 
     49 " text: `code`
     50 let s:markdown_syntax.rxCode = '`[^`]\+`'
     51 let s:markdown_syntax.char_code = '`'
     52 
     53 " text: ~~deleted text~~
     54 let s:markdown_syntax.rxDelText = '\~\~[^~`]\+\~\~'
     55 let s:markdown_syntax.char_deltext = '\~\~'
     56 
     57 " text: ^superscript^
     58 let s:markdown_syntax.rxSuperScript = '\^[^^`]\+\^'
     59 let s:markdown_syntax.char_superscript = '^'
     60 
     61 " text: ,,subscript,,
     62 let s:markdown_syntax.rxSubScript = ',,[^,`]\+,,'
     63 let s:markdown_syntax.char_subscript = ',,'
     64 
     65 " generic headers
     66 let s:markdown_syntax.rxH = '#'
     67 let s:markdown_syntax.symH = 0
     68 
     69 
     70 
     71 " <hr>, horizontal rule
     72 let s:markdown_syntax.rxHR = '^-----*$'
     73 
     74 " Tables. Each line starts and ends with '|'; each cell is separated by '|'
     75 let s:markdown_syntax.rxTableSep = '|'
     76 
     77 " Lists
     78 let s:markdown_syntax.bullet_types = ['-', '*', '+']
     79 let s:markdown_syntax.recurring_bullets = 0
     80 let s:markdown_syntax.number_types = ['1.']
     81 let s:markdown_syntax.list_markers = ['-', '*', '+', '1.']
     82 let s:markdown_syntax.rxListDefine = '::\%(\s\|$\)'
     83 
     84 " Preformatted text
     85 let s:markdown_syntax.rxPreStart = '```'
     86 let s:markdown_syntax.rxPreEnd = '```'
     87 
     88 " Math block
     89 let s:markdown_syntax.rxMathStart = '\$\$'
     90 let s:markdown_syntax.rxMathEnd = '\$\$'
     91 
     92 let s:markdown_syntax.rxComment = '^\s*%%.*$\|<!--[^>]*-->'
     93 let s:markdown_syntax.rxTags = '\%(^\|\s\)\@<=:\%([^:[:space:]]\+:\)\+\%(\s\|$\)\@='
     94 
     95 let s:markdown_syntax.header_search = '^\s*\(#\{1,6}\)\([^#].*\)$'
     96 let s:markdown_syntax.header_match = '^\s*\(#\{1,6}\)#\@!\s*__Header__\s*$'
     97 let s:markdown_syntax.bold_search = '\%(^\|\s\|[[:punct:]]\)\@<=\*\zs'.
     98       \ '\%([^*`[:space:]][^*`]*[^*`[:space:]]\|[^*`[:space:]]\)\ze\*\%([[:punct:]]\|\s\|$\)\@='
     99 let s:markdown_syntax.bold_match = '\%(^\|\s\|[[:punct:]]\)\@<=\*__Text__\*'.
    100       \ '\%([[:punct:]]\|\s\|$\)\@='
    101 let s:markdown_syntax.wikilink = '\[\[\zs[^\\\]|]\+\ze\%(|[^\\\]]\+\)\?\]\]'
    102 let s:markdown_syntax.tag_search = '\(^\|\s\)\zs:\([^:''[:space:]]\+:\)\+\ze\(\s\|$\)'
    103 let s:markdown_syntax.tag_match = '\(^\|\s\):\([^:''[:space:]]\+:\)*__Tag__:'.
    104       \ '\([^:[:space:]]\+:\)*\(\s\|$\)'