Fnf (short for fnf's not fzy)1 reads a list of newline-separated items from standard input and presents an incremental, interactive selection interface. As you type a query, fnf scores and filters candidates by fuzzy matching, highlighting matched characters and instantly updating the sorted list so you can quickly select the best match.
For detailed usage instructions and additional information, please refer to the manpage.
1 Fnf is a fork of the original fzy tool, which introduces several new features, such as support for 256 and 24-bit colors, customizable padding, and multi-selection capabilities.
Fnf is availible in multiple package repositories. If not packaged for your system, perform a manual installation as follows:
mkdir build && cd build
git clone https://github.com/leo-arch/fnf
cd fnf
make
sudo make install
The PREFIX
environment variable can be used to specify the install location (the default is /usr/local
).
Note
If not running on Linux, you may need to use gmake
instead of make
.
Use with clifm
Just run clifm as follows:
clifm --fnftab
Note
You need at least clifm 1.12.9. Since version 1.26.1, the proper option is --tabmode=fnf
.
Consult this gist for details.
Fnf attempts to present the best matches first. The following considerations are weighted when sorting:
- It prefers consecutive characters:
file
will match file over filter. - It prefers matching the beginning of words:
amp
is likely to match app/models/posts.rb. - It prefers shorter matches:
abce
matches abcdef over abc de. - It prefers shorter candidates:
test
matches tests over testing.