Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to configure Solarized for use in VIM in Konsole (KDE terminal). This is the result that I get: Konsole with Solarized

Note that Solarized looks fine in GVIM on the same machine: GVIM with Solarized

I suspect that it is Konsole's profile (colorscheme) that is the problem, but I do not see how to configure Konsole properly. I tried to use the Solarized .Xresources file hoping that would improve Konsole support, but it did not.

share|improve this question

2 Answers 2

up vote 6 down vote accepted

The theme works fine in gVIM because gVIM supports 16.7 million colors, the Solarized colors being among them.

In the terminal, Solarized will use the 16 default ANSI terminal colors. This will look terrible unless you install the Solarized theme for your terminal emulator. There are many versions available for Konsole, you should browse around and pick the most accurate one. Once installed, the theme will replace the 16 ANSI colors (usually quite plain) with the Solarized ones, 'Solarizing' your whole terminal (or rather any application with color).

The alternative is to tell Solarized to 'degrade' to the basic 256-color palette that many terminal emulators support. The colors you get will not represent the true Solarized colors, but are an approximation. You can enable the degraded 256-color version of Solarized by adding let g:solarized_termcolors=256 to your .vimrc file.

Also, if the degraded colors STILL don't show up, add Daniel Andersson's answer to mine, and add set t_Co=256 to your .vimrc. (this should not be necessary if your $TERM is properly set, it should probably be xterm-256color)

share|improve this answer
4  
Thank you. Adding let g:solarized_termcolors=256 to .vimrc resolved the issue. –  dotancohen Jun 26 '12 at 10:31

Mostly, follow http://vim.wikia.com/wiki/256_colors_in_vim.

In short:

  • Does the 256 color support work correctly in your terminal? Run some 256 color test (I use this script).
  • Is your $TERM value correctly set? The Vim wiki suggests TERM=konsole-256color for Konsole.
  • A correct term should set an equivalent to set t_Co=256 in Vim; you can also try setting this yourself (in the ~/.vimrc, before the color scheme is loaded).

Hopefully this can eliminate some error possibilities at least.

share|improve this answer
    
Clever script, thanks! It shows that all the colours work as intended. TERM was xterm-256color but even setting it to konsole-256color and then launching VIM did not help. Also, running :set t_Co=246 in the running VIM did not help either. –  dotancohen May 12 '12 at 18:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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