-
-
Save tyru/314597 to your computer and use it in GitHub Desktop.
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
function! s:SelectColorScheme() | |
30vnew | |
let files = split(globpath(&rtp, 'colors/*.vim'), "\n") | |
for idx in range(0, len(files) - 1) | |
let file = files[idx] | |
let name = matchstr(file , '\w\+\(\.vim\)\@=') | |
call setline(idx + 1, name) | |
endfor | |
file ColorSchemeSelector | |
setlocal bufhidden=wipe | |
setlocal buftype=nofile | |
setlocal nonu | |
setlocal nomodifiable | |
setlocal cursorline | |
nmap <buffer> <Enter> :<C-u>execute 'colorscheme' getline('.')<CR> | |
nmap <buffer> q :<C-u>close<CR> | |
endfunction | |
command! | |
\ -bar | |
\ SelectColorScheme | |
\ call s:SelectColorScheme() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment