I have defined

urxvt*color0:      #000000
urxvt*color8:      #777777

in my $HOME/.Xdefault. Using vim (console not gvim), this gives me a light grey for strings in bash scripts when I use urxvt. Now, if I start GNU screen and edit the same file with vim, all strings are now black. This is a problem since I use revese video (white text on black background for my terminal). The TERM is the same in both instances (xterm).

Is this a vim or screen issue? More importantly, how do I solve it?

After bhinesley reply put me on the right tracks, the solution was to add

set t_Co=256

to my $HOME/.vimrc. Also, I have the following set for my TERM variable:


for screen and urxvt console.


Download and run 256colors2.pl from here: http://www.frexx.de/xterm-256-notes/

If it doesn't look like the screenshot on the site, then you know that your problem is screen. If it looks fine, you can test Vim using :runtime syntax/colortest.vim.

  • AHA, thanks. This has pointed me in the right direction. It was neither screen (worked fine) nor vim (worked fine) but my own broken colour theme. I shall fix that. Thanks. – Sardathrion - against SE abuse Aug 22 '11 at 17:45

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.