Skip to content

Instantly share code, notes, and snippets.

@nicolascb
Created November 14, 2021 01:04
Show Gist options
  • Save nicolascb/0efa33a620b3e3ff7af60b2a6739ec13 to your computer and use it in GitHub Desktop.
Save nicolascb/0efa33a620b3e3ff7af60b2a6739ec13 to your computer and use it in GitHub Desktop.
vim: background toggle
let s:darkmode = 0
function! BgToggle()
if s:darkmode
execute 'set background=light'
execute 'colorscheme base16-atelier-dune-light'
execute 'AirlineTheme base16_atelier_dune_light'
let s:darkmode = 0
return
endif
execute 'set background=dark'
execute 'colorscheme base16-flat'
execute 'AirlineTheme base16_flat'
let s:darkmode = 1
endfunction
nnoremap <F9> :call BgToggle()<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment