2

Yesterday I updated NeoVim to 0.10 and this is how, e.g., JavaScript code looks like:

neovim 0.10 broken syntax highlight

Although it used to look this way (now it's a screenshot from Vim):

expected syntax highlight

I've found this question on SO: https://stackoverflow.com/questions/78521945/neovim-0-10-colorscheme-changes-affecting-highlighting-in-terminal which says that a solution is either to set the set notermguicolors option or have gui colors everywhere cterm colors are used.

As for the option, it doesn't seem like a viable solution, b/c it looks this way then (and no easy straightforward way to fix it):

syntax highlight with the 'set notermguicolors' option

As one can see the regexp highlighting is broken, the colorcolumn is broken. I tried to set just to test if anything would change — nothing:

hi ColorColumn guibg=ff0000 guifg=none

So this solution (to have the set notermguicolors set) seemed no viable.


The other solution: to have the guifg/guibg set everywhere cterm counterparts are used also seemed problematic. In order to know if anything would change, I commented out all syntax highlight settings from my vimrc file — again no change.


Is someone here, who's more experienced with Vim/NeoVim who could advise something on what should I do? Ideally to get my syntax highlight back, but at least to alleviate the current issues)=. May be it's even to change completely my approach to syntax highlighting.

6
  • Have you tried a colorscheme that sets gui colors? You might need to provide more info about your environment (terminal emulator and color support, and colorscheme, for two).
    – D. Ben Knoble
    Commented May 26 at 16:43
  • @D.BenKnoble the emulator is tmux (if that's what you meant). My colorscheme seems to be default at least that's what is set in vimrc
    – d.k
    Commented May 26 at 16:47
  • @D.BenKnoble could you suggest a different scheme, just to try if it changes anything
    – d.k
    Commented May 26 at 16:48
  • Neovim 0.10 has introduced a new default colorscheme maybe this the origin of the difference. Commented May 26 at 18:45
  • @VivianDeSmedt thank you, I'll look into it, will try to use the previous one
    – d.k
    Commented May 26 at 19:01

1 Answer 1

8

Neovim 0.10 has introduced a new default colorscheme.

If you want to get back your old colors you have to add to your init.vim the following line:

colorscheme vim
set notermguicolors

There are more breaking changes and notes about compatibility in the release notes and the release announcement.

1
  • 2
    It restored the original syntax highlight fully, but it worked only with set notermguicolors. So if anyone stumbles upon this answer, keep this in mind
    – d.k
    Commented May 26 at 19:33

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.