How to tell Vim to extend the background color to the whole screen?

6,698

Solution 1

As explained here, disable Background Color Erase (BCE) by clearing the t_ut terminal option (run :set t_ut= in Vim and then press Control+L to refresh the terminal's display) so that Vim extends the color scheme's background color to the whole terminal screen. This also works if Vim is being used inside tmux or GNU screen.

Solution 2

I had the same issue with Ubuntu 12.04 and OpenBSD 5.1 when using vim inside of tmux. Ultimately, I was able to resolve it by setting my terminal type to screen-256color.

Share:
6,698

Related videos on Youtube

chiborg
Author by

chiborg

Updated on September 18, 2022

Comments

  • chiborg
    chiborg almost 2 years

    I have an issue with the Vim color schemes: The background color does not fill the whole screen. For example, in the "blue" color scheme the whole screen should turn blue. Instead, the blue background only extends to the end of each line. Is this a setting in the console I'm missing or is this an issue with my vim default settings?

    I'm only having this issue with Ubuntu 10.10. echo $TERM outputs xterm-color.

    [Update]: To eliminate error sources my minimal ~/.vimrc looks like this:

    filetype plugin on
    colorscheme blue
    syntax on
    

    /etc/vim/vimrc contains the unchanged defaults of Ubuntu

    • Uku Loskit
      Uku Loskit about 13 years
      are you using screen?
    • chiborg
      chiborg about 13 years
      No, I'm not using screen
    • Martin
      Martin about 13 years
      have you tried setting in vim set t_Co=256?
    • gerryk
      gerryk about 13 years
      can you post the relevant section of .vimrc?
    • chiborg
      chiborg about 13 years
      set t_Co=256 makes the foreground text blink, but does not change the background color.