views:

3490

answers:

2
+5  Q: 

VIM Background

When I am trying to change background in vimrc or directly in vim using
set background=dark
it doesn't affect my background at all, same with light option, however it looks okay when I run gvim.
Is there a way to change background in vim without changing my Konsole settings?
Thanks.

UPD: Okay there is a difference between guifg/guibg and ctermfg/ctermbg. While gui accepts lots of different color combinations, cterm allows only few standard ones.

+5  A: 

As vim's own help on set background says, "Setting this option does not change the background color, it tells Vim what the background color looks like. For changing the background color, see |:hi-normal|."

For example

:highlight Normal ctermfg=grey ctermbg=darkblue

will write in white on blue on your color terminal.

Alex Martelli
Thanks, it works. I tried that option before, but it seems that not all colors work, for instance brown and yellow options don't affect my default console background at all.
negative
that may be b/c of what kind of terminal vim thinks you have.
rampion
Yep, setting up your terminal description properly to make vim happy can be a hassle (I remember epic past battles with early Linux, BSD and other Unix flavors -- nowadays with Mac and Ubuntu it just seems to work, more or less, even across ssh among them, and I don't have to do much vi-editing elsewhere these days).
Alex Martelli
A: 

Using set bg=dark with a white background can produce nearly unreadable text in some syntax highlighting schemes. Instead, you can change the overall colorscheme to something that looks good in your terminal. The colorscheme file should set the background attribute for you appropriately. Also, for more information see:

:h color
Kristo
that actually why I posted my question here. Even dark colorschemes didn't affect my default background color.
negative