Skip to content
Myr

[vim] Fix #167 - :FZF with directory

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent cef93f7 · Browse files · 1 file+9 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+9 added−4 removed

  • other:+9 added−4 removed

1 file+9 added−4 removed

modified:plugin/fzf.vim+9 added-4 removed
239 unmodified lines
240241function! s:cmd(bang, ...) abort242 let args = copy(a:000)243 if !s:legacy244 let args = add(args, '--expect=ctrl-t,ctrl-x,ctrl-v')244 let args = insert(args, '--expect=ctrl-t,ctrl-x,ctrl-v', 0)245 endif246 let opts = {}247 if len(args) > 0 && isdirectory(expand(args[-1]))248 let opts.dir = remove(args, -1)
14 unmodified lines
263 elseif key == 'ctrl-x' | let cmd = 'split'264 elseif key == 'ctrl-v' | let cmd = 'vsplit'265 else | let cmd = 'e'266 endif267 try268 call s:pushd(opts)267 for item in output268 execute cmd s:escape(item)269 endfor269 for item in output270 execute cmd s:escape(item)271 endfor272 finally273 call s:popd(opts)274 endtry275 endif276endfunction277278command! -nargs=* -complete=dir -bang FZF call s:cmd('<bang>' == '!', <f-args>)
4 unmodified lines