Add way to toggle background light or dark

There is maybe a better place for this.

I'm a VimL beginner, I hope my code is correct. At home, it works.
This commit is contained in:
Leo Wzukw 2015-05-14 16:49:02 +02:00
parent 91d3d8edc6
commit e158e176b6

13
.vimrc
View File

@ -75,6 +75,19 @@
" General {
set background=dark " Assume a dark background
" Allow to trigger background
function! ToggleBG()
let s:tbg = &background
" Inversion
if s:tbg == "dark"
set background=light
else
set background=dark
endif
endfunction
noremap <leader>bg :call ToggleBG()<CR>
" if !has('gui')
"set term=$TERM " Make arrow and other keys work
" endif