简体   繁体   中英

How to turn off a vim highlight group named //

The two characters that introduce comments, namely //, get highlighted in yellow. I don't want this. It happens in files of all types: C, js, html, pl.

When I consult the vim help, it says to do this

 :so $VIMRUNTIME/syntax/hitest.vim

to see the highlight groups. (I can also do this with :hi).

I do see a // highlight group. The documentation reads to me as if I could do the following to turn the highlighting off

:hi // NONE

but it doesn't work for me. (Gives me Invalid character in group name .) Mac OS, vim version 8.0

Are you certain that the highlight group in question you're after is named // ? I know that's not the name of the highlight group for JavaScript syntax.

You can look at the highlight group definitions in the vim syntax files on Github :

" Define the default highlighting.
" Only when an item doesn't have highlighting yet
hi def link javaScriptComment       Comment
hi def link javaScriptLineComment       Comment
hi def link javaScriptCommentTodo       Todo
hi def link javaScriptSpecial       Special
hi def link javaScriptStringS       String
hi def link javaScriptStringD       String
hi def link javaScriptStringT       String
hi def link javaScriptCharacter     Character

So :hi javaScriptComment NONE should unhighlight just JavaScript comments. And :hi Comment NONE would unhlighlight comments of all types.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM