3

On Archlinux, using Vim 7.4 (installed with pacman), I tried to use the lucius color scheme. However, the moment I turned it on, all color went away. This happened in the Xfce Terminal emulator under XFCE (black on white, since that was the color scheme of the emulator), or before even starting X11 (then, white on black). Going back to the default coloring scheme turned colors back on.

Using Vim under uxterm did not have this problem.

On Ubuntu 12.04, using Vim 7.4 (compiled from source) with the exact same .vimrc and .vim contents, on the same Xfce terminal emulator, under XFCE, did not have this problem.

I did manage to get it to work on Archlinux for Xfce terminal and command line: I added the following to the top of my .vimrc:

set t_Co=256

This suggestion came from here.

What was wrong with my setup before that? What is the correct way to get this to work?

2

set t_Co=256 enables Vim to use 256 Colors in terminals that support that (I think most of them do). Without that command Vim will only show 8 or 16 different colors.

If you load a colorscheme that is 256 colors only (or made for that in mind) it will look off or just not display correctly if t_Co is not set to 256.

http://vim.wikia.com/wiki/256_colors_in_vim

  • The same setup (as close as it gets) but on Ubuntu 12.04 did not have this problem (see the edit). The .vimrc on the Ubuntu installation did not have the set t_Co=256 either, but the colors showed perfectly fine. So I guess there must be something more to it? – XXX May 21 '15 at 18:18
  • Yes. Some Colorschemes set this option by them self in their configuration such that the user doesn't have to. – ap0 May 21 '15 at 18:19
  • Yes, but it was the same colorscheme, the same .vimrc, and (as far as I am aware) the same .vim contents.... – XXX May 21 '15 at 18:20
  • 1
    Have you checked wether that option was already set by default on ubuntu? Either in /.vimrc or /etc/vimrc? – ap0 May 21 '15 at 18:24
  • 1
    It also depends on the terminal database. Vim might automatically detect 256 colors on your Ubuntu; :set t_Co? will tell. – Ingo Karkat May 21 '15 at 18:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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