Vim + solarized + terminator = keywords highlighted in black - vim

I started to configure vim so I installed pathogen and solarized.
Here is my .vimrc and the screenshot of the solarized theme at the same time.
I don't understand why I have keywords like 'set' highlighted in black?
Is it because of terminator?
It's the same problem when I open a python script, all the keywords are highlighted...
Thanks
EDIT
The real problem is that you can set different background/colors in vim, in zsh and also in terminator config. Is there a way to make it all looks like solarized? I think the problem comes from backgrounds that overlap each others. The black color is actually the background of terminator.

Colorscheme authors can build their own palette from a 16,777,216 colors palette for GUI colorschemes, the 256 colors xterm palette for 256-colors terminal emulators and the 16, user-configurable, named ANSI colors in other cases.
The obvious consequence is that it is extremely difficult to come up with a colorscheme that is guaranteed to look the same everywhere.
The choice I've made with my colorscheme was to only use colors from the xterm palette in the GUI version, making it virtually impossible to distinguish between terminal Vim and graphical Vim based on the colors alone. I honestly don't know how many colorschemes do that but the intrinsic limitations of that palette (no browns, for example) admittedly make that a bit complicated and restrictive.
For 8/16 colors terminals, I provide the values of 18 from my palette so that the user can customize his 16 ANSI colors and enjoy almost the same experience as with more capable terminals or GVim. This is something that every colorscheme author has to do and there's no workaround.
Some colorscheme authors start their work with a limited and arbitrary palette, often 16-20 colors, that they retrofit into their colorschemes. Since their palette is most of the time outside of the xterm palette, they are able to give you a pretty impressive out-of-the-box GUI experience but the 256-colors terminal experience is usually so-so, forcing you to retrograde your terminal to a xterm $TERM to enjoy the customized ANSI colors.

Related

WSL: Installed colorscheme for terminal vim not working properly

I am a fairly new user of WSL and vim, and I wanted to install a new colorscheme for terminal vim. I do the standard steps: Create a ~/.vim/colors directory, then move the theme.vim files there. And when I open vim I can select them with :colorscheme, but the theme I get is entirely different from the one I installed. I have tried three different themes now and none of them have worked as expected.
Anyone one here knows what the cause of this could be?
Tl;dr: make sure the colorscheme fits your environment.
Vim colorschemes can have any of the following properties, alone or in combination…
8/16color-friendly colorschemes use the terminal emulator's 0-based 16 colours palette. Since various terminal emulators have different defaults and that palette is user-configurable it is impossible to predict accurately how it will look like.
You can expect these colorschemes to work reasonably well in most terminal emulators.
256color-friendly colorschemes use a semi-standardised 0-based 256 colours palette with the lower 16 indices corresponding to the aforementioned 16 colours palette. This means that colours 16 to 255 can reasonably be expected to look the same across modern terminal emulators.
You can expect these colorschemes to work well in many terminal emulators if your $TERM environment variable is set to something ending with 256color, xterm-256color being the most common correct value.
GUI-friendly colorschemes use hexadecimal values like in HTML/CSS for the best possible experience. If a colorscheme is GUI-friendly, it is automatically true-colors-friendly, which makes it suitable for use in terminal emulators that support the so-called "true color" feature.
If you use GUI Vim, then you don't have to worry about anything with these colorschemes. If you use Vim in a terminal emulator, then you will have to check if it supports the "true colors" feature and, if that's the case, enable it in Vim with :help 'termguicolors'.
Colorscheme authors are usually explicit about those things so you should be able to tell if a colorscheme fits your needs or not just by reading its README. If that is not the case, you can try looking for these hints in the code:
ctermbg and ctermfg only set to colour names or to numbers 0-15 means that the colorscheme is 8/16color-friendly.
Note that the name notation is more portable than the number notation.
ctermbg and ctermfg set to numbers 0-255 means that the colorscheme is 256color-friendly.
guibg and guifg present means that the colorscheme is GUI-friendly/true-color-friendly.

Vim colorscheme changes with terminal theme

So this seems a bit odd to me, but I have a theme I made for vim, and when I change my terminal's colors, it changes the color in vim as well.
Here is the vim colorscheme with the matching terminal color scheme applied.
If I change the terminal color scheme to a light one, if changes my vim color scheme to this.
Here is my repo
https://github.com/mhartington/oceanic-next
Any idea whats up? This doesn't seem to happen in any other theme.
DISCLAIMER: I have to admit that I'm not very knowledgeable about this, so am very likely to be wrong, but in case this is not answered-
I believe terminal colorschemes map color-names to specific ansi codes. Vim themes can take colors in hex-codes or in numeric codes where number is from 0 to (number of colors supported by terminal - 1 ). Each of these colors would map to the color-names that the terminal has assigned, which in turn would map to ANSI codes. A terminal assignment of a color-code would depend on its theme. Its likely that your other themes give colors in hex codes.
Try running: http://www.vim.org/scripts/script.php?script_id=1349 with different terminal themes maybe and see?

color schemes interaction in terminal, zsh, and vim

I noticed that the color-scheme setting in .zshrc does not affect the background color of the terminal window, so I decided to load a separate preset color-scheme for the OSX terminal. This, in return, changed how the .zshrc color-scheme looked previously. Vim also has its own color-scheme that seems to be affected by that of the OSX terminal.
I'm curious if there is any universal method to change the color-schemes of all three parties. If not, please help me understand the interactions of color-schemes in the OSX terminal, vim, and zsh
Terminal
Terminal.app lets you change its default color palette in its preferences. Those colors are referenced by your shell and the programs you run in it either with standard names like "blue" or with numbers from 0 to 15. Changing your terminal emulator's palette will obviously change the look of your shell and the programs you run in it.
ZSH
Some zsh themes use color numbers (16-255) from the xterm palette. It is possible to alter that palette but that practice is not common and I've not heard of a zsh theme doing that (which doesn't mean it doesn't exist in the wild) so it is relatively safe to assume that those colors will be the same across terminals. Such themes should not be affected by your changes to the terminal emulator's default ANSI palette.
Some zsh themes, on the other hand, use standard color names like "green" or "red" which correspond to the 16 ANSI colors defined in the preferences of your terminal emulator. Since you changed those colors, it is logical to expect that your zsh theme looks different.
Vim
Well written Vim colorschemes are usually capable to work in an 8/16 colors environment or a 256 colors environment. What set of color codes to use is determined by Vim from your terminal emulator's TERM:
TERM colors
xterm 8
screen 8
xterm-256color 256
screen-256color 256
Using a 256 colors ready colorscheme in an 8/16 colors environment won't work because only the numbers 0 to 15 will be used correctly.
Using a 256 colors ready colorscheme in a 256 colors environment will likely give a consistant experience and be immune to changes in the default ANSI palette.
Using an 8 colors ready colorscheme will likely have the same effect whether you use a 256 colors environment or an 8/16 one. Such colorschemes depend completely on the default ANSI colors, though, so they will look differently if you change your terminal emulator's settings.
Conclusion?
Given the following:
your zsh theme only uses standard ANSI names,
your TERM is set to an 8/16 colors value,
your Vim colorscheme is 8/16 colors ready,
you should be able to achieve a consistant look and feel across the board only by tweaking the ANSI color palette in Terminal.app's preferences.

Why my MacVIM and terminal vi looks different?

I'm using both console and GUI VIM. Cannot understand why my GUI vim shows different color palette and different parentheses colors (Rainbow parentheses plugin)
Console vim is in the left (and it seems to be better):
Terminal vim only has (at most) 256 colors, gvim/macvim has a lot more (#000000 - #FFFFFF).
If you look in your colorscheme/plugins for highlight commands. Terminal vim will you ctermfg/ctermbg and gvim/macvim will use guifg/guibg when selecting which color to use.

Why vim color schemes differs between gvim and a normal terminal?

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.

Resources