mirror of
https://github.com/junegunn/fzf.vim.git
synced 2026-01-30 22:55:31 +08:00
[GitFiles] List files from project root
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user