Vim background color doesn't render properly in GNOME terminal
Asked Answered
S

3

12

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?

Shuddering answered 16/11, 2011 at 1:19 Comment(4)
I really like that color scheme. Is that available somewhere? (Wish I had an answer for your question -- I have similar issues in iterm2, and ended up just setting my terminal's background color to match the one I set in vim)Ionian
It's basically :colorscheme blue. Send me an email Mozza314 (at) gmail.com if you'd like the vimrc though.Shuddering
Related Question : #14690425 tl;dr add set t_ut= to your .vimrc configurationFreedwoman
The problem is that vim is trying to be efficient at updating the terminal screen. It doesn't redraw any more than it thinks it has to. Spaces remain spaces, so it believes it doesn't need to redraw them. Blank space is treated the same. This could be in an underlying layer, such as curses, which may take it out of vim's control.Scevor
H
1

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

Hebner answered 1/6, 2014 at 18:18 Comment(0)
R
0

Try running :set t_Co=256 (replacing 256 with the value corresponding to the number of colors your terminal supports). A similar looking (though less conspicuous) problem of mine was caused by using too few of the available terminal colors in Vim. To figure out how many colors your terminal supports, see this.

Ruyter answered 24/11, 2012 at 20:24 Comment(1)
I don't use ubuntu much anymore but I have a similar problem on my mac and it doesn't work for it. I'll be sure to try it next time I'm in vim on ubuntu though :/.Shuddering
F
0

I had to do two things:

Farnese answered 29/3, 2019 at 11:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.