gitmyhub

fzf

Go ★ 81k updated 6d ago

:cherry_blossom: A command-line fuzzy finder

fzf is a command-line fuzzy finder that turns any list, files, shell history, processes, git commits, into an interactive searchable picker you type into and press enter to select from.

GoBashZshFishsetup: easycomplexity 1/5

fzf is a command-line fuzzy finder. The short version: you give it a list of things, like files in a folder, your shell command history, running processes, hostnames, bookmarks, git commits, anything that comes one item per line, and it pops up an interactive prompt where you type a few characters and it filters the list as you go. The matching is fuzzy, which means the characters you type only need to appear in order somewhere in the candidate, not as a contiguous block, so typing fbar can find foo_bar_baz. Press enter and the selected line is returned to whatever you piped fzf into.

That last point is the whole design idea: fzf is built to be glued together with other Unix tools. It takes input on standard input and prints the chosen item on standard output, so any list-producing command can become an interactive picker. There is also a preview window that runs a command on each candidate as you scroll, so you can, for example, see the contents of a file before opening it. Search syntax supports exact-match anchors and negation as well as fuzzy, and key bindings can be reconfigured through an event-action system.

The README highlights four properties the author cares about: it is portable, shipping as a single binary; it is fast, optimised to process millions of items quickly; it is versatile, with a customisation system based on binding events to actions; and it is all-inclusive, coming with integrations for Bash, Zsh, Fish, Vim and Neovim out of the box.

People reach for fzf to jump to files inside large repos, to pull a previous command out of shell history, to switch between processes, to choose a git commit to check out, and as a building block in their own shell scripts. It is distributed as a single Go binary and can be installed through Homebrew, the mise version manager, Linux and Windows package managers, a git clone with the bundled install script, or a prebuilt download from the releases page. The project is released under the MIT license.

Where it fits