Skip to content

Instantly share code, notes, and snippets.

@keikun17
Created September 17, 2012 04:45
Show Gist options
  • Save keikun17/3735615 to your computer and use it in GitHub Desktop.
Save keikun17/3735615 to your computer and use it in GitHub Desktop.
Toggle Powerline (Solarized light)
" ======== Glorious background toggling ========
" requires solarizedLightLC theme from : https://github.com/pearofducks/vim-powerline/blob/develop/autoload/Powerline/Colorschemes/solarizedLightLC.vim
" put this theme under this directory : ~/.yadr/vim/bundle/skwp-vim-powerline/autoload/Powerline/Colorschemes/
let g:powerline_dark_theme = 'skwp'
let g:powerline_light_theme = 'solarizedLightLC'
function! EmoModeOn()
set background=dark
let g:Powerline_colorscheme = g:powerline_dark_theme
endfunction
function! EmoModeOff()
set background=light
let g:Powerline_colorscheme = g:powerline_light_theme
endfunction
function! ToggleEmoMode()
echo 'emo mode called'
if &background == "dark"
call EmoModeOff()
elseif &background == "light"
call EmoModeOn()
end
PowerlineReloadColorscheme
endfunction
map <F5> :call ToggleEmoMode()<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment