Skip to content

Instantly share code, notes, and snippets.

@mattn
Created July 15, 2016 03:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattn/cad18067dbd09cf75e46336507134ac2 to your computer and use it in GitHub Desktop.
Save mattn/cad18067dbd09cf75e46336507134ac2 to your computer and use it in GitHub Desktop.
function! s:SelectColorScheme()
silent 15vnew
silent file `="SelectColorScheme"`
call setline(1, sort(map(split(globpath(&rtp, 'colors/*.vim'), "\n"), 'fnamemodify(v:val, ":t:r")')))
call search(g:colors_name)
setlocal bufhidden=wipe buftype=nofile nonu nomodifiable cursorline
augroup SelectColor
au!
au CursorMoved <buffer> :exe 'colorscheme' getline('.')
augroup END
nnoremap <buffer> <silent> q <c-w>c
endfunction
command! SelectColorScheme call s:SelectColorScheme()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment