[vim] Display relative path in prompt

This commit is contained in:
Junegunn Choi 2016-12-02 21:07:23 +09:00
parent 67026718c1
commit d9a51030ea
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -588,7 +588,7 @@ function! s:cmd(bang, ...) abort
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()).'/')
let opts.options .= ' --prompt '.shellescape(pathshorten(fnamemodify(getcwd(), ':~:.')).'/')
endif
let opts.options .= ' '.join(args)
call fzf#run(fzf#wrap('FZF', opts, a:bang))