[fzf#vim#colors] Pick up colorschemes from opt packages (#489)

This commit is contained in:
Michael Kaiser 2017-11-02 13:35:48 +01:00 committed by Junegunn Choi
parent f31a2925fe
commit 5c6cee878a

View file

@ -407,9 +407,12 @@ endfunction
" Colors
" ------------------------------------------------------------------
function! fzf#vim#colors(...)
let colors = split(globpath(&rtp, "colors/*.vim"), "\n")
if has('packages')
let colors += split(globpath(&packpath, "pack/*/opt/*/colors/*.vim"), "\n")
endif
return s:fzf('colors', {
\ 'source': fzf#vim#_uniq(map(split(globpath(&rtp, "colors/*.vim"), "\n"),
\ "substitute(fnamemodify(v:val, ':t'), '\\..\\{-}$', '', '')")),
\ 'source': fzf#vim#_uniq(map(colors, "substitute(fnamemodify(v:val, ':t'), '\\..\\{-}$', '', '')")),
\ 'sink': 'colo',
\ 'options': '+m --prompt="Colors> "'
\}, a:000)