Why doesn't VIM recognize a color totally available? - vim

This is mystery drives me crazy: I am trying to specify certain colors that are listed inside gVim 7.3 when running this script.
But when put in a .vim syntax file, gVim simply issues an error "Color name not recognized". This happens even with simple colors like orange. Instead, it only recognizes a few colors like red, blue, yellow, darkyellow, darkgreen, black, etc.
Why does this happen and how to workaround this?

Because, as a terminal program vim only supports ANSI colors by default.
http://en.wikipedia.org/wiki/ANSI_escape_code#Colors
I don't know enough about syntax files to fully answer, but these links might be useful
http://vim.wikia.com/wiki/256_colors_in_vim
http://vim.wikia.com/wiki/View_all_colors_available_to_gvim
It's possible that only the normal colors are available to syntax files from there you can use a different color scheme to reassign the normal colors.
http://vimcasts.org/episodes/creating-colorschemes-for-vim/

I ended up solving the problem by hard coding the offending color (orange) in the .vim file:
hi def MyOrange_color ctermfg=202 guifg=#ff5f00

Related

Vim using wrong colors

I have a problem with my vim and terminal configurations.
I am on Fedora Linux 27, run i3 and the gnome-terminal. I want to use the srcery color scheme (GH page). On GVim it works perfectly, right out the box. However, on the terminal it doesn't look as good. Srcery isn't the only color scheme with this issue, virtually all Base16 color schemes and all others that use 256 colors suffer from the same problem.
What I find bizarre, is that my $TERM variable is set to xterm-256color, tput colors gives out 256, and even vim itself claims to have a t_Co set to 256. I can do things like make the background of vim transparent, which then works properly.
you can see the color scheme working properly in GVim
a comparison to normal vim.
I have my gnome-terminal colors set to the srcery colors as well, there's a script on the GH page to create a srcery profile, which i am using. Alas, that does not help with my issue either.
Currently, I don't know how i could enable vim to correctly display my color scheme
Any help you could provide would be greatly, greatly appreciated.

Use arbitrary colors in Vim and terminator

I am working on terminal Vim colorscheme (for 256-color terminal) and I need a few dark colours that I could use as backgrounds. I'm not satisfied with ones available in standard palette - for example, color 22 (#005f00), the darkest shade of green, is still too bright.
I've read that terminal Vim does not allow specifying colors as RGB, so - to get arbitrary colors - I would have to tweak terminal emulator's color palette. Is there a way to tweak full 256-color palette in gnome-terminal / terminator? Preferences window only allows editing basic 16.
BTW, Chrome's hterm allows this via 'color-palette-overrides' preference (but has its own drawbacks).
Gnome-terminal doesn't offer a UI to alter the colors (apart from the first 16), but you can use escape sequences, e.g.:
echo -ne '\e]4;22;#004f00\a'
As you've mentioned, sometimes these colors get reset to their default values. This was a bug in the underlying VTE library, and got fixed in version 0.36.
As far as I know, you won't find a single terminal emulator that gives you that kind of control over the whole standardized xterm palette.
So, if you ever intend to share that colorscheme you are stuck with the default palette.
On the other hand, if that colorscheme is only meant for your usage or if you are OK with forcing a hard dependency on your users, you can use japh's colorcoke to generate an alternate palette more suited to your needs. See the repo's wiki for examples)

Are there conventions on which color combinations go well together?

Most terminal color palettes have colorschemes that are customizable.
Many terminal users make use of some standard colorscheme such as solarized.
I'm building a terminal application that needs to use colors.
My question is, how do I know which color combinations from the terminal color palette go well together?
For instance, in the colorschemes that I use, the last color in the palette generally serves well as an alternative background color, but I couldn't afford the risk that some text is hardly visible for someone else because of his different colorscheme.
Are there any conventions on this?

Sublime Text2 spell check color variation

I'm experiencing that Sublime Text 2 (ST2) changes colors of the words that are marked by the spell checker with a red snakeline underneath them. This behaviour happens as I scroll or type words, and the color switches between pitch black or radioactive green. It doesn't seem to be a pattern in the variations.
Examples:
Before color behaviour occurs: http://grab.by/hL6y
The radioactive green color behaviour: http://grab.by/hL6E
Anyone else experiencing this? It's quite freaking annoying. I'm on a 2012 Macbook pro retina with Mountain Lion, using the Solarized Dark colour scheme for ST2 (I've tried multiple, but same behaviour for all), and would love a fix! I've tried the Sublimetext.com forum, but nobody has a fix.
There may now be a viable workaround -- a spell check alternative.
https://github.com/phyllisstein/CheckBounce
The default syntaxes will need to be defined within the user configuration files. It now defaults to Markdown, Text, and Tex.
The built-in spell check of ST2 should be turned off when enabling the CheckBounce package.
The dictionary of words added in Mountain Lion is stored in:
/Users/insert_your_user_name_here/Library/Spelling/LocalDictionary

Why do all my MacVim color schemes look wrong?

I am having a problem with my MacVim color schemes. I have 'syntax on' in my .vimrc and I work mostly with Python.
As an example, I have attached a screenshot of what the "default" color scheme looks like in MacVim to me. I am having this problem with varying degrees of color differences for all the different schemes. Whenever I find a scheme I like online, it never looks like it does in the screenshot.
Any ideas on what the problem is?
Many themes provide modes for both dark background colors and light background colors. If you'd like to keep using this theme, try running:
:set background=light
Most of the themes I've seen were designed with a dark background and lighter text in mind -- I personally find a mostly-black screen easier on my eyes than a mostly-white screen -- so perhaps you just need to change the background color to something dark. In which case, you'd then want to run:
:set background=dark
The problem seems to be in ~/.gvimrc, look at what it does with the highlights (such as highlight NonText guibg=grey80). I've just placed them in an if !exists("stupid_colors").

Resources