I'm trying to create a basic custom syntax file for the first time, but I noticed that after I set a highlight link it's basically set and I'm not really sure how to change it. Here is my syntax file:
if exists("b:current_syntax")
echom "Quitting"
finish
endif
syn keyword tTask task start fix
syn keyword tEnd finish
syn keyword tNote note
hi def link tTask Special
hi def link tEnd Todo
hi def link tNote Comment
let b:current_syntax = "todo"
In my .vimrc, I have au BufRead,BufNewFile *.todo setfiletype todo.
When I change Comment to Special for example, the highlighting won't change in a file I've created. In fact... not much I've tried changes it. Is this a common problem? I couldn't find this online.
Edit: I "reopen" the todo file by using :edit in the tab, but closing and reopening in a new instance gives the same result where the highlighting doesn't change. I have put in echom commands, so I know that the code is running when I run :edit or open a new instance, but the highlighting doesn't change.
echomin a syntax file. Also note that you can use theftdetectdirectory for new filetypes. And thatunletstatement seems spurious to me? You might also include a minimal vimrc with your problem; see How to debug my vimrc for help reducing it.) – D. Ben Knoble Aug 03 '21 at 16:36CommenttoSpecial) and then re-opening atest.todofile I have created. I've put inechomcommands in, and I know it runs, but nothing changes in thetest.todofile. Theunletstatement was a mistake (I had removed its matchingletstatement earlier), so I will update the question. The only relevant line in my vimrc is theautocmdstatement that sets thetodofiletype. – Justin Marquez Aug 03 '21 at 16:59:editor opening a brand new vim instance? Please [edit] the question so this information does not get lost in the comments. – D. Ben Knoble Aug 03 '21 at 17:22