The background
setting actually doesn't control the background colors but more the foregrounds colors. It dates from a time (that includes the present for some terminal) where the background couldn't be controlled.
It is a way to tell the colorscheme
or Vim in general what kind of color should be selected to offer a good contrast with the background (i.e. select light foreground color if the background
is dark
, select dark foreground color if the background
is `light).
Remark: about the reason for which the sequence of the background
option setting and the colorscheme
settings is important is the following line of the default
colorscheme
:
set bg&
It resets the background
option to its default which is dark
.