junegunn / fzf.vim

fzf :heart: vim
MIT License
9.59k stars 581 forks source link

fzf_action on :Files does not respect full path #381

Open ddickstein opened 7 years ago

ddickstein commented 7 years ago

Say I have the following directory structure:

~/
  alpha/
    foo.txt
  beta/
    bar.txt
    baz.txt

and in my vimrc I have the following defined:

let g:fzf_action = {
  \ 'ctrl-t': 'tab split',
  \ 'ctrl-s': 'split',
  \ 'ctrl-v': 'vsplit',
\}

Say my working directory is ~/alpha and I am editing foo.txt. If I run :Files ~/beta the two options that appear are bar.txt and baz.txt. If I hit enter on either of them the file opens in the current window successfully. However, if I use one of the other defined actions, Vim attempts to invoke the action on the partial name of the file rather than on the full path. For example, if I hit ctrl-s on bar.txt, Vim invokes split bar.txt, but since I am in ~/alpha it attempts to open ~/alpha/bar.txt, which doesn't exist. I want the fzf action to be applied to the full path; that is, the selected file with the path argument to :Files prepended so it would properly split ~/beta/bar.txt.

junegunn commented 7 years ago

It works for me as expected. Can you check if you still have the issue with the following minimal vimrc?

vim -Nu <(curl https://gist.githubusercontent.com/junegunn/6936bf79fedd3a079aeb1dd2f3c81ef5/raw)

(https://gist.githubusercontent.com/junegunn/6936bf79fedd3a079aeb1dd2f3c81ef5/raw)

georgexsh commented 2 years ago

Is there any documentation for the fzf_action option? I found it by read the source code.