junegunn / junegunn/fzf.vim

fzf.vim cannot be used on Windows inside git-bash shell. [Interested to push a PR, but I need many directions]

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

Description

- [x] I have fzf 0.30.0 or above
- [x] I have read through https://github.com/junegunn/fzf.vim/blob/master/README.md
- [ ] I have read through https://github.com/junegunn/fzf/blob/master/README-VIM.md
- [x] I have read through the manual page of fzf (`man fzf`)
- [x] I have searched through the existing issues

I have been using fzf successfully under Ubuntu bash shell.

But there are several issues when trying to use in with git-bash shell on Windows 10.

**edit:** Using Neovim version 0.8.0-1210-gd367ed9b2

## Without `set shell`
If I do not set the shell in my `init.vim`, the shell is:

shell="C:\Program Files\Git\usr\bin\bash.exe"

Then I cannot get any `fzf` command to execute. E.g.

:Files

fails with error:

> Error detected while processing function fzf#vim#files[15]..94_fzf[1]..94_check_requirements[11]..fzf#exec[31]..function fzf#vim#files[15]..94_fzf[1]..94_check_requirements[11]..fzf#exec:
> line 31:
> E605: Exception not caught: Failed to run "C:\Users\adnn\AppData\Local\nvim-data\plugged\fzf/bin/fzf --version"

## With `set shell=cmd`

`fzf` commands `:Files` and `:Rg` work, as they show the pop-up window that is searchable. But the preview does not work:

> bash: C:UsersadnAppDataLocalNVIM-D~1pluggedfzf.vimbinpreview.sh: No such file or directory

`:Buffers` does not work at all. There is an error showing in the pop-up window

> [Command failed: type ^"C:\Users\adn\AppData\Local\Temp\nvim.0\FCdV6q\4^"]

---

I would be interested to address these issues, but I never worked with vim script, nor this project sources, so I would need directions.
I am most interested to address the first case (without setting a shell, which then uses git's `bash.exe`). From the error, I suppose the problem is that `bash` fails to execute `fzf - -version` because the absolute path is starting with `C:\Users`, which is not a valid git-bash path.

Any pointer where this path is generated in the plugin code?

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.