ef2011
ef2011

Reputation: 10631

Why doesn't VIM recognize a color totally available?

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?

Upvotes: 1

Views: 1668

Answers (2)

ef2011
ef2011

Reputation: 10631

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

Upvotes: 0

user606723
user606723

Reputation: 5125

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/

Upvotes: 2

Related Questions