I'm using gnome terminal, and vim with solarized color theme. When I open vim in the terminal, it's illegible.

vim opened in the terminal

But when I open a file in gvim, the color scheme works perfectly.

gvim

Gnome terminal's color scheme is also solarized. One thing to note is that, if I set an illegal value for background, I get the expected background color (but also an error).

link|improve this question
Could you add your .vimrc and .gvimrc? – Pedro Nascimento Dec 21 '11 at 22:18
.vimrc is here there's no .gvimrc. I already checked the question on the 1st comment. My &term and $TERM are both the same (xterm-256color). – yasith Dec 21 '11 at 23:59
Found a temporary fix, adding this before colorscheme solarized. Changes the colors to the solarized theme. But, the line numbers column keeps having a brownish-grey color. – yasith Dec 22 '11 at 0:17
feedback

migrated from stackoverflow.com Dec 22 '11 at 8:13

This question came from our site for professional and enthusiast programmers.

2 Answers

vim use the power of your "terminal" to draw the characters onto the screen. thus, how the drawn chars look depend largely on what the "terminal" is capable of. the "terminal" uses an enviroment variable to tell the apps running inside it about its capabilities: TERM.

if you want to use vim to use 256 colors you need 2 things:

  • a terminal capable of rendering at least 256 colors
  • the right TERM variable (xterm-256color)

so, try this:

$ export TERM=xterm-256color
$ vim

also read up more upon the topic on http://vim.wikia.com/wiki/256_colors_in_vim

link|improve this answer
feedback

To complete Akira's advice, vim in term mode uses the terminal color palette. From the vim solarized colorscheme repo :

If you are going to use Solarized in Terminal mode (i.e. not in a GUI version like gvim or macvim), please please please consider setting your terminal emulator's colorscheme to used the Solarized palette. I've included palettes for some popular terminal emulator as well as Xdefaults in the official Solarized download available from Solarized homepage.

For gnome-term, there are instructions to set up the color palette.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.