How do I stop color changes when quitting vi from a terminal emulator?

Posted by Michael Warhol on Ask Ubuntu See other posts from Ask Ubuntu or by Michael Warhol
Published on 2012-11-29T20:16:31Z Indexed on 2012/11/29 23:20 UTC
Read the original article Hit count: 239

Filed under:
|
|
|

I have a problem with colors when using vi under Ubuntu 12.04.

I'm connecting to my Ubuntu server from a PC, using PowerTerm terminal emulation software. I have PowerTerm set up to display black text on a grey background.

When I connect to the Ubuntu box, the screen is fine. When I open a file with vi, the screen is fine. The text is black on a gray background, which is normal for my PowerTerm setup. However, if the file is less than a full screen long, the remainder of the screen is a black background. When I quit vi, the entire background turns black, and the text becomes white. I have to do a Terminal Reset to restore my normal text and background colors.

What I want is for there to be no change at all when I use vi. The text should be black and the background grey. I have another server loaded with RedHat 9, and that acts normally; colors don’t change when using vi.

Here is my .vimrc file:

set compatible
syntax off
let g:loaded_matchparen=1
set nocp
set noincsearch
set nohlsearch
set noshowmatch
set bg=dark

I've tried set bg=dark and set bg=light. It makes no difference. Is there some other set command that would clear this up for me, or some TERM setting (my TERM is set to linux)?

© Ask Ubuntu or respective owner

Related posts about 12.04

Related posts about server