I have the following minimal .vimrc file:
" syntax enable
syntax case match
syntax keyword MyTodo TODO PENDING
syntax keyword MyTodoIP IN PROGRESS
syntax keyword MyTodoClosed CLOSED COMPLETE DONE
hi MyTodo ctermfg=yellow
hi MyTodoIP ctermfg=darkgreen
hi MyTodoClosed ctermfg=darkgray
As is, this works fine (
TODO, etc are correctly highlighted).
However, When I uncomment
syntax enable, my syntax keywords are not highlighted as I have specified.
I looked at
:help syn-enable and it says the following:
:syntax enablecommand will keep your current color settings. This allows using
:highlightcommands to set your preferred colors before or after using this command.
I also tried using
syntax match MyTodoMatch "TODO"
hi MyTodoWatch with the same result.
There is a similar question on stackoverflow from 2011 that seems to be having the same problem, but no solution so I'm posting here.
What am I missing here? How can I use
syntax enable with custom
syntax enable 'enabled', I can
source ~/.vimrc after opening vim and the desired syntax is applied correctly.