vim colorschemes not changing background color

后端 未结 11 1843
北恋
北恋 2021-01-30 08:43

I try to apply various color schemes in vim that I have seen on the net. Whatever scheme I choose, the background remains white, even though screenshots of the applied scheme sh

11条回答
  •  心在旅途
    2021-01-30 09:34

    I have this in my .vimrc and it solved this problem for me using while using PuTTY.

    set t_Co=256
    set background=dark
    colorscheme mustang
    highlight Normal ctermbg=NONE
    highlight nonText ctermbg=NONE
    

    It's important to load the colorscheme before the ctermbg settings in .vimrc because they need to override the same ones set by the colorscheme. This also means you can't switch colorscheme while Vim is running and expect it to work.

提交回复
热议问题