I like the syntax rules and don't need to change them, but what bugs me is that for some reason the author decided to highlight keywords with Structure group and function names with Comment (or something else). I don't like such inconsistencies. I like keywords, comments and functions highlighted with the same color in every language I work.

The problem is that I can't find the source of this syntax.


1 Answer 1


As per Carpetsmoker's comment you can put just these hi commands in the syntax folder per file type, or use an autocmd in your vimrc like this:

autocmd Filetype * call CustomHighlight()

function! CustomHighlight()
    hi clear Keyword
    hi clear Comment
    hi link Keyword Function
    hi link Comment Function

You can choose whichever color you like best of the three, but I think this should do what you want.

See :h hi-link for more info.

  • Doesn't seems to be doing anything. Dec 16, 2016 at 6:30
  • 1
    @user1685095 You'll need to load this after the syntax file. Put it in ~/.vim/<after>/syntax/<filetype>vim or in a autocmd Filetype <filetype>. See the last bit of this answer. Dec 17, 2016 at 1:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.