9

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.

warnerm06
  • 654
  • 1
  • 9
  • 20

3 Answers3

4

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

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks, to then integrate it with bash's `CTRL`+`R` history search is there a simpler way than cloning the fzf repo to `~/.fzf` and then running `~/.fzf/install`? – Sam Hasler Sep 14 '20 at 09:17
  • 1
    @SamHasler you could only curl that single file `curl -o- https://raw.githubusercontent.com/junegunn/fzf/master/install|bash`, as in here: https://stackoverflow.com/a/49063127/6309 – VonC Sep 14 '20 at 11:40
  • ```$ set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\ > bash: C:WINDOWS: command not found bash: C:WINDOWSSystem32Wbem: command not found bash: C:WINDOWSSystem32WindowsPowerShellv1.0: command not found $ set GH=C:\myprog\Git $ set PATH=%GH%\bin;%GH%\usr\bin;%GH%\mingw64\bin;%GH%\mingw64\libexec\git-core;%PATH% bash: fg: %GH%usrbin: no such job bash: fg: %GH%mingw64bin: no such job bash: fg: %GH%mingw64libexecgit-core: no such job bash: fg: %PATH%: no such job ``` Only setting GH worked for me. Any ideas what went wrong? – Frumda Grayforce Dec 14 '21 at 07:30
  • 1
    @Tablut Those `set` commands are meant to be executed in a `CMD` session. *Then*, from that same `CMD` session, you type `bash` to enter a `bash` session. – VonC Dec 14 '21 at 07:32
  • Is what file do we add the three set statements? – phage May 18 '23 at 20:38
  • @phage They are not in a file. They are typed and executed directly in the CMD, in order to change the PATH for that CMD session. – VonC May 18 '23 at 20:41
2

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

0

Put the fzf.exe file in the cmd folder under Git. So for me it would be C:\Users\<<username>>\AppData\Local\Programs\Git\cmd

phage
  • 584
  • 3
  • 17