Last active
July 8, 2020 21:33
-
-
Save brianjp93/bb2fff399b37c3c9272bb10d64df7beb to your computer and use it in GitHub Desktop.
cycle through colorschemes in vim and switch to light theme for specific themes. Bound alt-c to cycle.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let s:mycolors = ['deus', 'gruvbox', 'onedark'] " colorscheme names that we use to set color | |
function! NextColor() | |
call s:NextColor() | |
endfunction | |
function! s:NextColor() | |
let current = index(s:mycolors, g:colors_name) | |
let go_next = 1 | |
if index(['gruvbox'], g:colors_name) >= 0 | |
if &background == 'dark' | |
let go_next = 0 | |
execute 'set bg=light' | |
endif | |
endif | |
if go_next | |
execute 'set bg=dark' | |
execute 'colorscheme ' .s:mycolors[(current+1) % len(s:mycolors)] | |
endif | |
endfunction | |
nnoremap <a-c> :call NextColor()<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment