Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have the following .vimrc:

set nocompatible              " Use vim defaults
"set ls=2                      " Always show status line
set showcmd                   " Show incomplete commands
set scrolloff=3               " Keep 3 lines when scrolling
set ruler                     " Show the cursor position all the time
set title                     " Show title in console title bar
set hid                       " Change buffer without saving
set showmatch                 " Show matching bracets

set ts=2                      " Numbers of spaces of tab character
set sw=2                      " Numbers of spaces to (auto)indent
set et                        " Tabs are converted to spaces, use only when required
set sts=2                     " Soft tab stop
set smartindent               " Smart indent
set autoindent
set nocindent
set wrap

set hlsearch                  " Highlight searches
set incsearch                 " Do incremental searching

And when I open vim from my Ubuntu 12.04 terminal, I see the colors of the scheme, but the background is the same that the one I open the terminal with. I would say the background should change, but I don't know why it doesn't.

Any help please?

share|improve this question

migrated from stackoverflow.com Oct 28 '12 at 8:13

This question came from our site for professional and enthusiast programmers.

    
Why do you think background should change? –  ZyX Oct 27 '12 at 12:57
    
Maybe because that's what's supposed to happen? –  romainl Oct 27 '12 at 19:22
    
What colorscheme? Does it have something like hi Normal ctermbg=something? What command to load the colorscheme? What's the output of $ echo $TERM? –  romainl Oct 27 '12 at 19:28
    
@romainl I don't understand, he doesn't have any colorscheme in his .vimrc. why do you say it's supposed to happen? –  gokcehan Oct 28 '12 at 1:28
    
If your colorscheme defines a background color you are supposed to see it instead of the terminal's background color. That's why I also ask how he is loading his colorscheme and what it is since I don't see any colorscheme in his vimrc. –  romainl Oct 28 '12 at 6:07

2 Answers 2

try this to change bg color:

:set background=dark

or

:set background=light

to change your color scheme:

:colorscheme name

Edit colorscheme and set highlight commands, for instance;

highlight Normal ctermbg='color'

vivify is a nice place to get a new color scheme

share|improve this answer
    
set background=… does exactly nothing with background. It just tells vim whether it should think that background is dark or light and adjust default colors accordingly. Does nothing for non-default colors (those that are changed by colorscheme). Is altered automatically when colorscheme redefines Normal highlighting group. And, by the way hi Normal ctermbg=color, no quotes. –  ZyX Oct 27 '12 at 12:56
    
'color' stands for 'which color do you want'! I have given options to solve the problem! your -1 is excessive!!! –  b3h3m0th Oct 27 '12 at 14:49
    
It is for “try this to change bg color: set background…”. It does never change the background. Color is not a problem (not that for -1): it is just uncommon to have 'color' as a placeholder for things like Red. It would be common if you used ctermbg=color or ctermbg={color}. I now know that ctermbg='Red' is accepted as well, but I do not see this acceptance stated in :h highlight-ctermfg, only in :h highlight-guifg. –  ZyX Oct 27 '12 at 18:27
    
In fact, that line with hi comment guifg='salmon pink' is the only line where :highlight in help is used with single-quoted arguments (excluding 383’rd patch description in :h version6), neither I saw quoting in any colorschemes. –  ZyX Oct 27 '12 at 18:32

Your ~/.vimrc doesn't contain any mention of a colorscheme.

That means that either:

  • you use the default colorscheme, or

  • you load a specific as yet unnamed colorscheme manually.

If you use the default colorscheme, what you see is normal. The default colorscheme doesn't define any background color so you are supposed to see your terminal's background color.

If you are loading a specific colorscheme, with :colorscheme colorscheme_name, and you don't see the background change colors, well… it could be because that colorscheme doesn't define a background color either. See if it contains something like Hi Normal ctermbg=color. But we can't debug it because you didn't post it.

I'd bet on the default colorscheme.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.