Created
September 13, 2024 17:12
-
-
Save mike-clark-8192/bb9c56062c453fd13227a4fae711e951 to your computer and use it in GitHub Desktop.
Cycle through Gvim color schemes and display current scheme's name
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 g:colors = getcompletion('', 'color') | |
func! NextColors() | |
let idx = index(g:colors, g:colors_name) | |
return (idx + 1 >= len(g:colors) ? g:colors[0] : g:colors[idx + 1]) | |
endfunc | |
func! PrevColors() | |
let idx = index(g:colors, g:colors_name) | |
return (idx - 1 < 0 ? g:colors[-1] : g:colors[idx - 1]) | |
endfunc | |
nnoremap <silent> <s-a-n> :exe "colo " .. NextColors() \| redraw \| colorsch <CR> | |
nnoremap <silent> <s-a-p> :exe "colo " .. PrevColors() \| redraw \| colorsch <CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment