简体   繁体   中英

Cannot load correct color scheme Using vim-Plug installing solarized

I am on Mac a just installed solarized with vim-Plug. However, the color scheme is totally not correct like this:

终端截图

I googled similar questions like Fail to install vim solarized But it seems unsolved. Can anyone tell me what is happening here? My $TERM = xterm256color

See this important note for terminal users in the installation instructions for vim-colors-solarized:

If you are going to use Solarized in Terminal mode (ie not in a GUI version like gvim or macvim), please please please consider setting your terminal emulator's colorscheme to used the Solarized palette. [...]

If you use Solarized without these colors, Solarized will need to be told to degrade its colorscheme to a set compatible with the limited 256 terminal palette (whereas by using the terminal's 16 ansi color values, you can set the correct, specific values for the Solarized palette).

If you do use the custom terminal colors, solarized.vim should work out of the box for you.

If you are using a terminal emulator that supports 256 colors and don't want to use the custom Solarized terminal colors, you will need to use the degraded 256 colorscheme. To do so, simply add the following line before the colorscheme solarized line:

 let g:solarized_termcolors=256

Again, I recommend just changing your terminal colors to Solarized values either manually or via one of the many terminal schemes available for import.

In short, the best way to use the Solarized theme is to also use it in your terminal. That's in large part the point of a theme such as Solarized, to have consistency between your shell applications and that typically involves configuring all of them for the theme. See the Solarized website for more on the theme and the ideas behind it.

As an alternative, if you're using a 256-color terminal, you can get colors that are near the Solarized colors on Vim only by changing your vimrc to:

let g:solarized_termcolors=256
colorscheme solarized

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