Why vim color schemes differs between gvim and a normal terminal?
For example many schemes of this showcase don work in a normal terminal.
I am saving all new schemes to ~/.vim/colors/
and set with :colorscheme cool
Any way to solve this?
Why vim color schemes differs between gvim and a normal terminal?
For example many schemes of this showcase don work in a normal terminal.
I am saving all new schemes to ~/.vim/colors/
and set with :colorscheme cool
Any way to solve this?
Terminal windows (such as xterm
) are typically limited to 2**8 colors. On the other hand, a GUI term can have as many colors as your graphical windows desktop.
Many vim
color schemes are designed for either the GUI or the terminal; if they are designed for a GUI, it's unlikely they would display in a terminal well by-default.
If you need to convert a GUI scheme to terminal (256 colors), you can use the CSApprox plugin.
The two current answers are pretty good. Your vote should go to Mike's because there is no perfect workaround.
Vim colorschemes usually specify colors separately for the GUI and for the CLI. Some colorshemes don't define anything for the CLI and those that do use the X11 colors.
These X11 colors (noted 0-255) have been more or less standardized since a very long time and only really work in terminal emulators that support 256 colors. In other less capable terminal emulators the higher numbers are skipped and your colors are messed.
GUI Vim can also use these 256 colors plus any color you might want, as long as it's specified with an hexadecimal notation (#00d6e3).
Because GUI colorschemes can use thousands of colours, and CLI colorschemes can only use 256 colors the values used for the CLI can only be approximations of those used by the GUI. That's why CLI Vim can't really look like GUI Vim, even if you use a modern terminal emulator.
If your colorscheme of choice insists on using colors outside of the X11 range you will never have CLI Vim and GUI Vim look the same.
The only way to sync the colors of GUI and CLI Vim I see is to dumb down the GUI colorscheme by using X11 colors only.
Theres a new kid on the block called CSExact which moldes you terminal to the exact colors of the colorscheme. Colors look a lot better than with CSApprox.
This plugin allows the use of GUI (GVim) color schemes in (some) terminals. This is done by using terminal magic to modify the terminal's color palette on startup and each time a color scheme is loaded.
Because gvim directly selects X11 colors, while the terminal vim uses the available terminal palette.
So if you use a modern terminal (gnome, kde or even OS X) you can change the palette of available colors and VIM will look completely different. GVIM, on the other hand, sets the colors directly without the intermediate translation layer of the terminal app.
© 2022 - 2024 — McMap. All rights reserved.
~/.vimrc
for the machine in question – Howlanvim-gtk
orvim-gnome
– Howlan.gvimrc
to set a colorscheme for your windowed environment, and.vimrc
to set the scheme for your CLI environment. – Crammer