mirror of
https://github.com/junegunn/fzf.vim.git
synced 2026-02-15 22:42:07 +08:00
[GitFiles] List files from project root
This commit is contained in:
@@ -328,8 +328,14 @@ endfunction
|
|||||||
" ------------------------------------------------------------------
|
" ------------------------------------------------------------------
|
||||||
|
|
||||||
function! fzf#vim#gitfiles(...)
|
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({
|
call s:fzf({
|
||||||
\ 'source': 'git ls-tree --name-only -r HEAD',
|
\ 'source': 'git ls-tree --name-only -r HEAD',
|
||||||
|
\ 'dir': root,
|
||||||
\ 'sink*': s:function('s:common_sink'),
|
\ 'sink*': s:function('s:common_sink'),
|
||||||
\ 'options': '--prompt "GitFiles> " -m'.s:expect(),
|
\ 'options': '--prompt "GitFiles> " -m'.s:expect(),
|
||||||
\}, a:000)
|
\}, a:000)
|
||||||
|
|||||||
Reference in New Issue
Block a user