Skip to content

Instantly share code, notes, and snippets.

@salvianoo
Created March 24, 2012 22:32
Show Gist options
  • Save salvianoo/2188675 to your computer and use it in GitHub Desktop.
Save salvianoo/2188675 to your computer and use it in GitHub Desktop.
Function to toggle background color
"my first vimscript function
function! <sid>BackgroundToggle()
if &background == 'dark'
set background=light
else
set background=dark
endif
endfunction
"call function
nnoremap <leader>B :call <sid>BackgroundToggle()<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment