Skip to content
Myr

[vim] Apply --multi and --prompt to :FZF command

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 3066b20 · Browse files · 2 files+8 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

2 files+8 added−4 removed

  • other:+8 added−4 removed

2 files+8 added−4 removed

modified:plugin/fzf.vim+7 added-3 removed
556 unmodified lines
557 \ 'ctrl-v': 'vsplit' }558559function! s:cmd(bang, ...) abort560 let args = copy(a:000)561 let opts = {}561 let opts = { 'options': '--multi ' }562 if len(args) && isdirectory(expand(args[-1]))563 let opts.dir = substitute(remove(args, -1), '\\\(["'']\)', '\1', 'g')563 let opts.dir = substitute(substitute(remove(args, -1), '\\\(["'']\)', '\1', 'g'), '/*$', '/', '')564 let opts.options .= ' --prompt '.shellescape(opts.dir)565 else566 let opts.options .= ' --prompt '.shellescape(pathshorten(getcwd()).'/')567 endif565 call fzf#run(fzf#wrap('FZF', extend({'options': join(args)}, opts), a:bang))568 let opts.options .= ' '.join(args)569 call fzf#run(fzf#wrap('FZF', opts, a:bang))570endfunction571572command! -nargs=* -complete=dir -bang FZF call s:cmd(<bang>0, <f-args>)573
2 unmodified lines
modified:README.md+1 added-1 removed
303 unmodified lines
304" Look for files under your home directory305:FZF ~306307" With options308:FZF --no-sort -m /tmp308:FZF --no-sort --reverse --inline-info /tmp309310" Bang version starts in fullscreen instead of using tmux pane or Neovim split311:FZF!312```
119 unmodified lines