junegunn / junegunn/fzf.vim

fzf_action on :Files does not respect full path

Open
#381 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vim Script
Stars
10.3k
Forks
608
Avg merge
5d 8h
Merged PRs (30d)
2

Description

- Category
- [ ] Question
- [x] Bug
- [ ] Suggestion
- OS
- [x] Linux
- [ ] macOS
- [ ] Windows
- [ ] Etc.
- Vim
- [x] Vim
- [ ] Neovim

Say I have the following directory structure:
```
~/
alpha/
foo.txt
beta/
bar.txt
baz.txt
```
and in my vimrc I have the following defined:
```vim
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`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.