Skip to content

Instantly share code, notes, and snippets.

@tyru
Forked from c9s/.vimrc
Created February 25, 2010 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tyru/314597 to your computer and use it in GitHub Desktop.
Save tyru/314597 to your computer and use it in GitHub Desktop.
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