Skip to content

Commit

Permalink
Add way to toggle background light or dark
Browse files Browse the repository at this point in the history
There is maybe a better place for this.

I'm a VimL beginner, I hope my code is correct. At home, it works.
  • Loading branch information
Leo Wzukw committed May 14, 2015
1 parent 91d3d8e commit e158e17
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e158e17

Please sign in to comment.