roro
roro

Reputation: 940

How to remove highlight group?

I'm trying to remove the jsonCommentError highlight group. On startup I see the highlight group is active by running :hi jsonCommentError.

:hi jsonCommentError
jsonCommentError xxx links to Error

I tried to remove it with :hi clear jsonCommentError and :hi jsonCommentError NONE but this didn't work, and there is no change when I run :hi jsonCommentError.

I guess :hi clear didn't work because the highlight group wasn't added by the user, but I don't know why :hi NONE didn't work.

Upvotes: 0

Views: 629

Answers (1)

Matt
Matt

Reputation: 15091

You can't really remove the group. Only to make it transparent.

hi clear removes group's own highlighting colors. hi link sets group's link target (that always has a preference over group's own colors).

Which one you need, it depends. But it never hurts to do both at the same time:

hi clear jsonCommentError
hi! link jsonCommentError NONE

Also in this case, you may want to switch off all error highlighting at once (see :h json.vim):

let g:vim_json_warnings = 0

Upvotes: 1

Related Questions