mirror of
https://github.com/junegunn/fzf.vim.git
synced 2025-12-06 12:44:24 +08:00
Make fzf#vim#complete#path take command as the first argument
inoremap <expr> <c-x><c-g> fzf#vim#complete#path('git ls-files $(git rev-parse --show-toplevel)')
This commit is contained in:
@@ -102,24 +102,12 @@ function! s:fname_prefix(str)
|
||||
return prefix
|
||||
endfunction
|
||||
|
||||
function! s:complete_file(command, extra_opts)
|
||||
function! fzf#vim#complete#path(command, ...)
|
||||
let s:file_cmd = a:command
|
||||
return fzf#vim#complete(extend({
|
||||
\ 'prefix': function('s:fname_prefix'),
|
||||
\ 'source': function('s:file_source'),
|
||||
\ 'options': function('s:file_options')}, get(a:extra_opts, 0, g:fzf#vim#default_layout)))
|
||||
endfunction
|
||||
|
||||
function! fzf#vim#complete#path(...)
|
||||
return s:complete_file("find . -path '*/\.*' -prune -o -print \| sed '1d;s:^..::'", a:000)
|
||||
endfunction
|
||||
|
||||
function! fzf#vim#complete#file(...)
|
||||
return s:complete_file("find . -path '*/\.*' -prune -o -type f -print -o -type l -print \| sed '1d;s:^..::'", a:000)
|
||||
endfunction
|
||||
|
||||
function! fzf#vim#complete#file_ag(...)
|
||||
return s:complete_file("ag -l -g ''", a:000)
|
||||
\ 'options': function('s:file_options')}, get(a:000, 0, g:fzf#vim#default_layout)))
|
||||
endfunction
|
||||
|
||||
" ----------------------------------------------------------------------------
|
||||
|
||||
@@ -63,9 +63,9 @@ function! fzf#complete(...)
|
||||
endfunction
|
||||
|
||||
inoremap <expr> <plug>(fzf-complete-word) fzf#vim#complete#word()
|
||||
inoremap <expr> <plug>(fzf-complete-path) fzf#vim#complete#path()
|
||||
inoremap <expr> <plug>(fzf-complete-file) fzf#vim#complete#file()
|
||||
inoremap <expr> <plug>(fzf-complete-file-ag) fzf#vim#complete#file_ag()
|
||||
inoremap <expr> <plug>(fzf-complete-path) fzf#vim#complete#path("find . -path '*/\.*' -prune -o -print \| sed '1d;s:^..::'")
|
||||
inoremap <expr> <plug>(fzf-complete-file) fzf#vim#complete#path("find . -path '*/\.*' -prune -o -type f -print -o -type l -print \| sed '1d;s:^..::'")
|
||||
inoremap <expr> <plug>(fzf-complete-file-ag) fzf#vim#complete#path("ag -l -g ''")
|
||||
inoremap <expr> <plug>(fzf-complete-line) fzf#vim#complete#line()
|
||||
inoremap <expr> <plug>(fzf-complete-buffer-line) fzf#vim#complete#buffer_line()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user