[GitFiles] List files from project root

This commit is contained in:
Junegunn Choi
2015-11-02 10:17:56 +09:00
parent 1a2d597045
commit 7d5154ae68

View File

@@ -328,8 +328,14 @@ endfunction
" ------------------------------------------------------------------
function! fzf#vim#gitfiles(...)
let root = systemlist('git rev-parse --show-toplevel')[0]
if v:shell_error
call s:warn('Not in git repo')
return
endif
call s:fzf({
\ 'source': 'git ls-tree --name-only -r HEAD',
\ 'dir': root,
\ 'sink*': s:function('s:common_sink'),
\ 'options': '--prompt "GitFiles> " -m'.s:expect(),
\}, a:000)