Skip to content

Instantly share code, notes, and snippets.

@oppara
Forked from c9s/.vimrc
Created March 5, 2010 11:47
Show Gist options
  • Save oppara/322656 to your computer and use it in GitHub Desktop.
Save oppara/322656 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