Skip to content

Instantly share code, notes, and snippets.

@c9s
Created February 25, 2010 10:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save c9s/314439 to your computer and use it in GitHub Desktop.
Save c9s/314439 to your computer and use it in GitHub Desktop.
vim colorscheme selector
fun! s:SelectColorS()
50vnew
setlocal bufhidden=wipe buftype=nofile nonu fdc=0
file ColorSchemeSelector
let files = split(glob(expand('~/.vim/colors/').'*'))
for file in files
let name = matchstr( file , '\w\+\(\.vim\)\@=' )
if strlen(name) > 0
put=name
endif
endfor
normal ggdd
setlocal nomodifiable
setlocal cursorline
hi CursorLine gui=reverse
nmap <buffer> <Enter> :cal g:SetColor()<CR>
nmap <buffer> <C-q> :q<CR>
nmap <buffer> e :exec 'tabe ~/.vim/colors/' . getline('.') . '.vim'<CR>
endf
com! SelectColorS :cal s:SelectColorS()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment