I have a question about the highlight group of the warning message Swap file xxx already exists. The following is my .vimrc/init.vim file:

colorscheme nord
set termguicolors

Now I try to open a file from the terminal which has been opened in another vim/nvim instance. The following is what happens:

In vim enter image description here

In neovim enter image description here

This is the expected highlight for this message in nord colorscheme: enter image description here

As you can see, vim displays the warning message in correct highlight colors while neovim does not, even though the RC files are exactly the same in the two cases.

My question is, what caused this behavior difference? Can I achieve the correct highlight behavior for the warning message in neovim?

Thanks for your help!

  • It seems NeoVim only applies the theme later in startup, after this message has been printed... Try nvim --cmd 'colorscheme nord | set termguicolors' a.cc and it should match the MoreMsg highlight group in that case... You might want to open an issue in NeoVim about this. It's possible that the change was introduced on purpose (avoid reading init.vim if you'll end up quitting), but ignoring the colorscheme this way looks like the incorrect choice here...
    – filbranden
    Dec 21 '21 at 7:22
  • 1
    @filbranden, I tried nvim --cmd 'colorscheme nord | set termguicolors' a.cc and the result seems to be the same. nvim still does not respect the MoreMsg highlight group defined by the nord colorscheme. I am using nvim 0.5.1 in case the version matters.
    – Longwu Ou
    Dec 22 '21 at 2:04
  • 1
    I created this issue in the NeoVim github repo to report the problem.
    – Longwu Ou
    Dec 22 '21 at 2:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.