Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim highlighting: remove syntax keyword

Tags:

vim

One of the vim plugins I use does:

syn keyword rustTodo contained TODO FIXME XXX NB NOTE

Resulting in highlighting NB in comments, which I don't like. Is there a way to either redefine the keywords or remove one from them? Looking at :help syn-keyword makes me think that this is not possible.

like image 699
ynimous Avatar asked Apr 24 '17 08:04

ynimous


Video Answer


1 Answers

If that is the only definition for rustTodo (these are cummulative), you can remove and then redefine it:

syn clear rustTodo
syn keyword rustTodo contained TODO FIXME XXX NOTE

Unfortunately, the granularity for removal of syntax items is limited to whole syntax groups (here : rustTodo); you cannot pick individual keywords unless they also have separate groups (which would result in much more linking of highlight groups and therefore inefficient).

To make this permanent, put it into ~/.vim/after/syntax/rust.vim

If you think that the majority of users doesn't like NB here, please suggest to the author to drop it. Adding it back as a personal customization is easier and more maintainable than removing it...

like image 95
Ingo Karkat Avatar answered Sep 26 '22 15:09

Ingo Karkat