This plugin will allow you to toggle the background and colorscheme together with a single key.
If you are using pathogen:
git clone https://github.com/saghul/vim-colortoggle.git ~/.vim/bundle/vim-colortoggle
If you are not using any plugins manager, just copy the folder plugin into your ~/.vim directory
Define global variables with your default background choice and color schemes for dark and light backgrounds. Example:
let g:default_background_type = "dark"
let g:dark_colorscheme = "mustang"
let g:light_colorscheme = "pyte"
Then map the key you want to the ToggleBg function:
map <silent><F11> :ToggleBg<CR>
If you want the current value to be saved and restored you need to tell viminfo to store global variables, by appending the ! symbol:
" viminfo options: http://vimdoc.sourceforge.net/htmldoc/usr_21.html#21.3
set viminfo='100,<50,s10,h,!
rviminfo
This is my first plugin for ViM, hope you like it :-)
Saúl Ibarra Corretgé [email protected]