From 1c4a9bb1afb4ac4336ef33a184d9847507762011 Mon Sep 17 00:00:00 2001 From: Silvio Ricardo Cordeiro Date: Sun, 1 Apr 2018 21:45:15 +0200 Subject: [PATCH] HTML comments and better TODO * Allow HTML-style comment syntax Allow in vimwiki's highlight for markdown. * Avoid matching "TODO" on word boundaries Do not match e.g. "xTODO:" as if it were "TODO:". This also lifts the requirement of ":" after these keywords (it is more flexible to just require a word boundary regardless of what). --- autoload/vimwiki/vars.vim | 2 +- syntax/vimwiki.vim | 2 +- syntax/vimwiki_markdown.vim | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/autoload/vimwiki/vars.vim b/autoload/vimwiki/vars.vim index 7946f68..1a9968f 100644 --- a/autoload/vimwiki/vars.vim +++ b/autoload/vimwiki/vars.vim @@ -164,7 +164,7 @@ function! s:populate_global_variables() let g:vimwiki_global_vars.rxWikiInclSuffix1 = g:vimwiki_global_vars.rxWikiInclArgs. \ g:vimwiki_global_vars.rxWikiInclSuffix - let g:vimwiki_global_vars.rxTodo = '\C\%(TODO:\|DONE:\|STARTED:\|FIXME:\|FIXED:\|XXX:\)' + let g:vimwiki_global_vars.rxTodo = '\C\<\%(TODO\|DONE\|STARTED\|FIXME\|FIXED\|XXX\)\>' " default colors when headers of different levels are highlighted differently " not making it yet another option; needed by ColorScheme autocommand diff --git a/syntax/vimwiki.vim b/syntax/vimwiki.vim index 66e3610..9d8ba16 100644 --- a/syntax/vimwiki.vim +++ b/syntax/vimwiki.vim @@ -295,7 +295,7 @@ if vimwiki#vars#get_global('valid_html_tags') != '' execute 'syntax match VimwikiItalic #\c.\{-}# contains=VimwikiHTMLTag' execute 'syntax match VimwikiUnderline #\c.\{-}# contains=VimwikiHTMLTag' - execute 'syntax match VimwikiComment /'.vimwiki#vars#get_syntaxlocal('rxComment').'/ contains=@Spell' + execute 'syntax match VimwikiComment /'.vimwiki#vars#get_syntaxlocal('rxComment').'/ contains=@Spell,VimwikiTodo' endif " tags diff --git a/syntax/vimwiki_markdown.vim b/syntax/vimwiki_markdown.vim index 36e9279..4242f82 100644 --- a/syntax/vimwiki_markdown.vim +++ b/syntax/vimwiki_markdown.vim @@ -87,7 +87,7 @@ let s:markdown_syntax.rxPreEnd = '```' let s:markdown_syntax.rxMathStart = '\$\$' let s:markdown_syntax.rxMathEnd = '\$\$' -let s:markdown_syntax.rxComment = '^\s*%%.*$' +let s:markdown_syntax.rxComment = '^\s*%%.*$\|' let s:markdown_syntax.rxTags = '\%(^\|\s\)\@<=:\%([^:[:space:]]\+:\)\+\%(\s\|$\)\@=' let s:markdown_syntax.header_search = '^\s*\(#\{1,6}\)\([^#].*\)$'