diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index 4fbe505..066e15d 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -877,6 +877,12 @@ is decorated: > super^script^ sub,,script,, +For Markdown syntax these variations are used: > + + **bold text** or __bold text__ + *italic text* or _italic text_ + ***bold_italic text*** or ___italic_bold text___ + Furthermore, there are a number of words which are highlighted extra flashy: TODO, DONE, STARTED, FIXME, FIXED, XXX. diff --git a/syntax/vimwiki.vim b/syntax/vimwiki.vim index 512aad9..6a2f9cf 100644 --- a/syntax/vimwiki.vim +++ b/syntax/vimwiki.vim @@ -383,7 +383,7 @@ hi def link VimwikiBoldT VimwikiBold hi def VimwikiItalic term=italic cterm=italic gui=italic hi def link VimwikiItalicT VimwikiItalic -hi def VimwikiBoldItalic term=bold cterm=bold gui=bold,italic +hi def VimwikiBoldItalic term=bold,italic cterm=bold,italic gui=bold,italic hi def link VimwikiItalicBold VimwikiBoldItalic hi def link VimwikiBoldItalicT VimwikiBoldItalic hi def link VimwikiItalicBoldT VimwikiBoldItalic diff --git a/syntax/vimwiki_markdown.vim b/syntax/vimwiki_markdown.vim index 5962699..05e1f34 100644 --- a/syntax/vimwiki_markdown.vim +++ b/syntax/vimwiki_markdown.vim @@ -13,38 +13,36 @@ let s:markdown_syntax = g:vimwiki_syntax_variables['markdown'] let s:markdown_syntax.rxEqIn = '\$[^$`]\+\$' let s:markdown_syntax.char_eqin = '\$' -" text: *strong* -" let s:markdown_syntax.rxBold = '\*[^*]\+\*' +" text: **strong** or __strong__ let s:markdown_syntax.rxBold = '\%(^\|\s\|[[:punct:]]\)\@<='. - \'\*'. - \'\%([^*`[:space:]][^*`]*[^*`[:space:]]\|[^*`[:space:]]\)'. - \'\*'. + \'\(\*\|_\)\{2\}'. + \'\%([^*_`[:space:]][^*_`]*[^*_`[:space:]]\|[^*_`[:space:]]\)'. + \'\1\{2\}'. \'\%([[:punct:]]\|\s\|$\)\@=' -let s:markdown_syntax.char_bold = '*' +let s:markdown_syntax.char_bold = '\*\*\|__' -" text: _emphasis_ -" let s:markdown_syntax.rxItalic = '_[^_]\+_' +" text: _emphasis_ or *emphasis* let s:markdown_syntax.rxItalic = '\%(^\|\s\|[[:punct:]]\)\@<='. - \'_'. - \'\%([^_`[:space:]][^_`]*[^_`[:space:]]\|[^_`[:space:]]\)'. - \'_'. + \'\(\*\|_\)'. + \'\%([^*_`[:space:]][^*_`]*[^*_`[:space:]]\|[^*_`[:space:]]\)'. + \'\1'. \'\%([[:punct:]]\|\s\|$\)\@=' -let s:markdown_syntax.char_italic = '_' +let s:markdown_syntax.char_italic = '\*\|_' " text: *_bold italic_* or _*italic bold*_ let s:markdown_syntax.rxBoldItalic = '\%(^\|\s\|[[:punct:]]\)\@<='. - \'\*_'. - \'\%([^*_`[:space:]][^*_`]*[^*_`[:space:]]\|[^*_`[:space:]]\)'. - \'_\*'. + \'\(\*\)\{3\}'. + \'\%([^*`[:space:]][^*`]*[^*`[:space:]]\|[^*`[:space:]]\)'. + \'\1\{3\}'. \'\%([[:punct:]]\|\s\|$\)\@=' -let s:markdown_syntax.char_bolditalic = '\*_' +let s:markdown_syntax.char_bolditalic = '\*\*\*' let s:markdown_syntax.rxItalicBold = '\%(^\|\s\|[[:punct:]]\)\@<='. - \'_\*'. - \'\%([^*_`[:space:]][^*_`]*[^*_`[:space:]]\|[^*_`[:space:]]\)'. - \'\*_'. + \'\(_\)\{3\}'. + \'\%([^_`[:space:]][^_`]*[^_`[:space:]]\|[^_`[:space:]]\)'. + \'\1\{3\}'. \'\%([[:punct:]]\|\s\|$\)\@=' -let s:markdown_syntax.char_italicbold = '_\*' +let s:markdown_syntax.char_italicbold = '___' " text: `code` let s:markdown_syntax.rxCode = '`[^`]\+`'