From d2475e136b391b8c09bf3cc06a1fa17945631cca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Fr=C3=B3es=20Franco?= Date: Thu, 28 May 2026 21:49:36 -0300 Subject: [PATCH] fix(syntax): colour keywords red/green like the HTML export MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All keywords shared one `nuwikiKeyword` group linked to `Todo`, so the editor showed TODO, DONE and XXX in the same colour. Split into nuwikiKeywordAttn (TODO/FIXME/XXX, red) and nuwikiKeywordDone (DONE/FIXED/STARTED, green) with explicit colours so the distinction survives any colorscheme — matching the export's per-keyword classes. Co-Authored-By: Claude Opus 4.7 --- syntax/vimwiki.vim | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/syntax/vimwiki.vim b/syntax/vimwiki.vim index 98b23b1..fa07ad5 100644 --- a/syntax/vimwiki.vim +++ b/syntax/vimwiki.vim @@ -89,7 +89,10 @@ syntax match nuwikiCode /`[^`]\+`/ contains=nuwikiCodeDelim syntax match nuwikiCodeDelim /`/ contained conceal syntax match nuwikiMathInline /\$[^$]\+\$/ -syntax match nuwikiKeyword /\<\(TODO\|DONE\|STARTED\|FIXME\|FIXED\|XXX\)\>/ +" Two keyword groups so the editor can colour them like the HTML export: +" attention/pending (red) vs resolved/in-progress (green). +syntax match nuwikiKeywordAttn /\<\(TODO\|FIXME\|XXX\)\>/ +syntax match nuwikiKeywordDone /\<\(DONE\|FIXED\|STARTED\)\>/ " Wikilink conceal: hide [[ / ]], and for [[target|desc]] hide target|. syntax region nuwikiWikilink start=/\[\[/ end=/\]\]/ keepend contains=nuwikiWikilinkBracket,nuwikiWikilinkTarget @@ -122,7 +125,11 @@ highlight default nuwikiBold gui=bold cterm=bold term=bold highlight default nuwikiItalic gui=italic cterm=italic term=italic highlight default link nuwikiCode String highlight default link nuwikiMathInline Number -highlight default link nuwikiKeyword Todo +" Explicit colours (not a `Todo` link) so the red/green split is visible in any +" colorscheme. Matches the HTML export: TODO/FIXME/XXX red, DONE/FIXED/STARTED +" green. +highlight default nuwikiKeywordAttn gui=bold cterm=bold term=bold guifg=#F44747 ctermfg=203 +highlight default nuwikiKeywordDone gui=bold cterm=bold term=bold guifg=#2EA043 ctermfg=35 highlight default link nuwikiWikilink Underlined highlight default link nuwikiTransclusion Identifier highlight default link nuwikiUrl Underlined