Why do most vim color schemes look as good as a screenshot when I use them?

I downloaded many vim color schemes and tried them, but many of them are not like the official screenshot.

For example, your own vim - desert color scheme should look like this: desert color schema

But in my vim, many colors will not be displayed, for example, the background. my vim color display

But some color schemes work correctly.

Why is this?

Q: Change-> Profile settings → Colors, I select "use colors from the system theme"

+43
vim terminal colors schema
Mar 23 2018-12-12T00:
source share
4 answers

Many color schemes are designed for 256 colors, which is significantly better than the standard 8-color terminal. To do this, you need $TERM install a 256-color terminal, for example xterm-256color .

If you have a 256-color terminal (it looks like you are taking a screenshot if it's a Gnome terminal), set $TERM to xterm-256color and turn on 256 colors in your vimrc with something like:

 if $TERM == "xterm-256color" set t_Co=256 endif 

The Vim wiki contains some tips for setting up the correct $TERM for different terminal emulators. The easiest way to quickly check this out is to do

 TERM=xterm-256color vim 

This will not cause the colorsmhemes intended for the vim GUI to be fully compatible with the Vim terminal, but they will do 256 color colors, and this is a gigantic improvement over the standard 8 color colors.

+52
Mar 23 2018-12-12T00:
source share

On * nix systems, the most important task is to set the $ TERM environment variable to a terminfo entry that describes your terminal capabilities , including the number of colors supported , to advertise these capabilities for applications that will run inside your terminal.

In other words, the reason you set this variable in the first place is to say Vim (or mutt .. slrn .. ELinks .. etc.) .. Hey, by the way .. I support 256 colors, you know..?

As a result, it is not indicated when adding spreads to your vimrc to check the value of $ TERM in order to set the value of the t_Co Vim variable. Vim is smart enough to pick up the supported number of colors from the terminfo entry pointed to by the $ TERM variable. That is why you install it first ..!

In this regard, the Vim terminal / console simply follows the * nix model and determines the capabilities of the terminal from the terminfo entry, and automatically sets the contents of the t_Co variable.

Tried and tested something like 15 different terminal emulations in GNU / linux environment.

+20
Jul 21 '12 at 20:21
source share

The first screenshot is GVim, not the Vim terminal. Terminals are very limited when it comes to color support. And GVim can use full RGB space.

+14
Mar 23 2018-12-12T00:
source share

Other answers here are good; I also found this page very useful for customizing and understanding the causes and methods of color environments for vim.

+6
Mar 23 '12 at 12:50
source share



All Articles