Score:0

How to disable comment highlighting in vim?

vn flag

I find myself on a new Ubuntu 22.04 machine running Vim 8.2, and I've found that all comments (in all languages) are highlighted, and it's driving me crazy.

Edit: This only happens when I'm in a tmux session (via SSH, from a Debian 11 system using GNOME term). $TERM is screen-256color.

How do I turn this off?

enter image description here enter image description here

enter image description here

enter image description here

My .vimrc is small, and doesn't have this effect on any other machines.


When I type :colorscheme, vim says default. However, if I type :colorscheme default, the highlighting goes away!

For now, I've added this to my .vimrc, which "fixes" the problem:

" https://askubuntu.com/q/1441256
colorscheme default

But why is this happening?

Quasímodo avatar
jp flag
I'd give another terminal a try. And also start a clean bash session, i.e. without `.bashrc`
Score:0
cn flag

Try this in Vim:

: highlight Comment ctermfg=Blue ctermbg=none

Jonathon Reinhart avatar
vn flag
That actually makes it worse (brighter highlight).
Score:0
in flag

I would have put this in a comment as a question instead of an answer, but I don't have the rep.. but

Have you checked to see if maybe there's an override in a system level vimrc such as /etc/vimrc or /etc/vim/vimrc

I don't have this specific issue so I can't repro and test myself but your question actually helped me solve my own issue which had to do with the default syntax highlighting for #commented out lines was such a dark blue my ancient eyes could not read it

after seeing your :colorscheme it led me where I wanted and solved my own issue with :colorscheme industry

and that's when I discovered that there's not just your /yourhomedir/.vimrc but also /etc/vim/vimrc (at least on my Ubuntu system)

I am hoping maybe this will lead you to your why, and thank you for your question helping me find my answer.

Score:0
jp flag

Yes, it did happen to my editor as well after switching from xterm-256color to screen-256color.

I'm not sure why it happen, but on my end I just rebooted my machine and the highlights on comments went away.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.