diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2016-10-04 00:20:36 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2016-10-04 00:30:04 +0900 |
commit | 01b88539ba912da4f49cfba48e2a736c04ec6006 (patch) | |
tree | ae84dd0ab1bbebb527ba24a354e2b0179649cdc8 /plugin | |
parent | 3066b206af11258c06cc0b549e2056db9549855a (diff) |
[vim] Apply --multi and --prompt to :FZF command
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/fzf.vim | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim index 8e3859dd..2eb98d47 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -558,11 +558,15 @@ let s:default_action = { function! s:cmd(bang, ...) abort let args = copy(a:000) - let opts = {} + let opts = { 'options': '--multi ' } if len(args) && isdirectory(expand(args[-1])) - let opts.dir = substitute(remove(args, -1), '\\\(["'']\)', '\1', 'g') + let opts.dir = substitute(substitute(remove(args, -1), '\\\(["'']\)', '\1', 'g'), '/*$', '/', '') + let opts.options .= ' --prompt '.shellescape(opts.dir) + else + let opts.options .= ' --prompt '.shellescape(pathshorten(getcwd()).'/') endif - call fzf#run(fzf#wrap('FZF', extend({'options': join(args)}, opts), a:bang)) + let opts.options .= ' '.join(args) + call fzf#run(fzf#wrap('FZF', opts, a:bang)) endfunction command! -nargs=* -complete=dir -bang FZF call s:cmd(<bang>0, <f-args>) |