Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use fzf (command line fuzzy finder) with windows 10 git-bash?

I downloaded the .exe file and placed it into my PATH variable. fzf seems to work in command prompt. But I would like to use it in git-bash. When i use fzf in git-bash it seems to start but nothing happens.

Any advice would be helpful. I'm trying to save myself some keystrokes.

like image 725
warnerm06 Avatar asked May 21 '20 21:05

warnerm06


2 Answers

Yes it is.

I just downloaded fzf.exe from fzf-bin, launched bash.exe, and typed ./fzf.exe

But for that, I use a simplified PATH first:

set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
set GH=C:\path\to\git
set PATH=%GH%\bin;%GH%\usr\bin;%GH%\mingw64\bin;%GH%\mingw64\libexec\git-core;%PATH%

With that PATH, fzf just works.

fzf in bash

like image 168
VonC Avatar answered Oct 23 '22 14:10

VonC


I know this question was a while ago, but hopefully I can be of some use for any new readers trying to get fuzzy finder working, in git-bash

For whatever reason, I had tried the package from the GitHub repo @VonC shared and the new repo linked thereof and neither package executed in terminal as expected - Only thing could do was fzf --help


As you know git-bash is based on MSYS2, and they have pacman to install packages and a package list can also be found here https://packages.msys2.org/package/ including a fuzzy finder, however not fzf, but fzy

To get the Windows compatible file, go straight to 'File', not the upstream URL and within the downloaded compressed file you will find the .exe

Move that .exe to your git-bash /usr/bin and either rename fzy.exe to fzf.exe or bash alias fzf to execute fzy

like image 35
Azmath Choudhury Avatar answered Oct 23 '22 14:10

Azmath Choudhury