Emacs Fuzzy Finder is like fzf but it leverages the power of your Emacs instance to filter and select candidates.
Use ezf
as part of your piping and command substitutions to manually select and filter matches.
Here’s an example:
sudo dnf install $(dnf search emacs | ezf -f 0)
This will search Fedora’s package repository for anything with the word emacs
in it – yielding over 100 results.
The first column is then passed to ezf
and you’re asked to filter and select candidates inside your own Emacs.
The ones you select are sent back to the shell, and substituted into the call to dnf install
.
You can play with the crm-seperator
regexp if you want to use a different character than ,
to separate multiple selections.
To better understand how it works, read Mikey Petersen’s original article on Fuzzy Finding with Emacs instead of fzf.
When making many selections, the completion buffer can become quite crowded. One option is to use the original repo with helm support. Another option might be to write a multiple completion framework similar to that done in citar. However for most use-cases, the default completion system works well.
This is a fork of Mikey Petersen’s original implementation at mickeynp/ezf.
I created the fork initially to remove the dependency on the helm completion framework.
Instead this version relies soley on the built-in completion frameworks/compatible frameworks.
In particular it relies on completing-read-multiple
.
I’ve tested with Vertico with the Orderless completion style and with the default completion framework.
I suspect it would work fine with MCT or Selectrum.
The bash script has also been converted to a posix-compliant shell script at the expense of losing -set o pipefail
.
If ezf is invoked from a terminal external to emacs, the emacs frame will raise. However, I do not have a good method of returning the user to the original terminal after they make the selection in emacs. I tried using xdotool for this but it requires a dependency and wasn’t super reliable across different terminals.
sudo dnf install $(dnf search emacs | ezf -m -f 0)
- Git clone the repo (or download)
- Load
ezf.el
Alternatively if you use straight.el as your package manager, you can point it directly to the repository.
(straight-use-package
'(ezf :type git :host github :repo "xcapaldi/ezf"))
(use-package ezf
:straight (ezf :type git :host github :repo "xcapaldi/ezf")
:commands ezf)
No matter the installation method for emacs, you need to put ezf
somewhere in your PATH
.
Make sure you run emacs as a daemon or use server-start
.