-
-
Save mattn/1321853 to your computer and use it in GitHub Desktop.
vim colorscheme selector
This file contains hidden or 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() | |
let files = sort(map(split(globpath(&rtp, 'colors/*.vim'), "\n"), 'fnamemodify(v:val, ":t:r")')) | |
silent 15vnew | |
call setline(1, files) | |
silent file `="SelectColorScheme"` | |
setlocal bufhidden=wipe buftype=nofile nonu nomodifiable cursorline | |
nnoremap <buffer> <silent> j j:<c-u>exe 'color' getline('.')<cr> | |
nnoremap <buffer> <silent> k k:<c-u>exe 'color' getline('.')<cr> | |
nnoremap <buffer> <silent> q :<c-u>close<cr> | |
endfunction | |
command! SelectColorScheme call s:SelectColorScheme() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment