Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim background color doesn't render properly in GNOME terminal

Problem with Vim background

I'm guessing lots of people get this problem, but I can't seem to find any other threads/questions about it anywhere. I guess it's difficult to capture in keywords.

Basically, Vim doesn't draw the background color when scrolling up in places where there is no text. I've also seen it on my friend's Mac, so it's not peculiar to my setup.

I have a pretty big vimrc, but I get the same problem without a vimrc and setting :colorscheme blue.

I'm using gnome-terminal on Ubuntu 11.10 (Oneiric Ocelot). It's a fairly clean install that I set up only a few days ago, so there's not really any funny business going on. I expect this would happen out of the box.

I've not had this problem in other contexts e.g. over SSH with PuTTY or previous versions of Ubuntu which I'm guessing was also gnome-terminal.

What's going on?

like image 879
voltrevo Avatar asked Nov 16 '11 01:11

voltrevo


1 Answers

In Linux I had export TERM=xterm-256color in my .bashrc. That caused Vim to look like this (after setting set t_Co=256):

Vim looks with molokai theme before fixing TERM variable

When I removed that line from my .bashrc and opened a new terminal (exec bash didn't do it). This is what I get (you need to have set t_Co=256):

Vim looks with molokai theme after fixing TERM variable

like image 120
DavidGamba Avatar answered Sep 22 '22 15:09

DavidGamba