Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
F

fzf

> 开发工具
Free

:cherry_blossom: A command-line fuzzy finder

83.6K stars0 likes2 views
WebsiteGitHub

About

:cherry_blossom: A command-line fuzzy finder





Show your love for fzf -- T-shirts, mugs, and stickers now available!

commitgoods.com/collections/fzf


fzf is a general-purpose command-line fuzzy finder and an interactive terminal toolkit.

Whether you're selecting files, browsing command history, previewing data, navigating complex datasets with fuzzy matching, or creating custom menus and workflows, fzf provides the building blocks to turn shell scripts into rich terminal applications.

Highlights

  • Portable // Distributed as a single binary for easy installation
  • Fast // Optimized to process millions of items in milliseconds
  • Programmable // Event-driven architecture for building custom terminal interfaces and workflows
  • Batteries-included // Comes with integrations for Bash, Zsh, Fish, Nushell, Vim, and Neovim

Table of Contents

  • Installation
    • Using Homebrew
    • Using Mise
    • Linux packages
    • Windows packages
    • Using git
    • Binary releases
    • Setting up shell integration
    • Vim/Neovim plugin
  • Upgrading fzf
  • Building fzf
  • Usage
    • Using the finder
    • Display modes
      • --height mode
      • --popup mode
    • Search syntax
    • Environment variables
    • Customizing the look
    • Options
    • Demo
  • Examples
  • Key bindings for command-line
  • Fuzzy completion
    • Files and directories
    • Process IDs
    • Host names
    • Environment variables / Aliases
    • Customizing fuzzy completion for bash and zsh
      • Customizing fzf options for completion
      • Customizing completion source for paths and directories
      • Supported commands (bash)
      • Custom fuzzy completion
    • Fuzzy completion for fish
    • Fuzzy completion for Nushell
  • Vim plugin
  • Advanced topics
    • Customizing for different types of input
    • Performance
    • Executing external programs
    • Turning into a different process
    • Reloading the candidate list
      • 1. Update the list of processes by pressing CTRL-R
      • 2. Switch between sources by pressing CTRL-D or CTRL-F
      • 3. Interactive ripgrep integration
    • Preview window
    • Previewing an image
  • Tips
    • Respecting .gitignore
    • Fish shell
    • fzf Theme Playground
  • Related projects
  • License
  • Goods
  • Sponsors :heart:

Installation

Using Homebrew

You can use Homebrew (on macOS or Linux) to install fzf.

bash
brew install fzf

[!IMPORTANT] To set up shell integration (key bindings and fuzzy completion), see the instructions below.

fzf is also available via MacPorts: sudo port install fzf

Using Mise

You can use mise to install fzf.

bash
mise use -g fzf@latest

Linux packages

Package Manager Linux Distribution Command
APK Alpine Linux sudo apk add fzf
APT Debian 9+/Ubuntu 19.10+ sudo apt install fzf
Conda conda install -c conda-forge fzf
DNF Fedora sudo dnf install fzf
Nix NixOS, etc. nix-env -iA nixpkgs.fzf
Pacman Arch Linux sudo pacman -S fzf
pkg FreeBSD pkg install fzf
pkgin NetBSD pkgin install fzf
pkg_add OpenBSD pkg_add fzf
Portage Gentoo emerge --ask app-shells/fzf
Spack spack install fzf
XBPS Void Linux sudo xbps-install -S fzf
Zypper openSUSE sudo zypper install fzf

[!IMPORTANT] To set up shell integration (key bindings and fuzzy completion), see the instructions below.

Windows packages

On Windows, fzf is available via Chocolatey, Scoop, Winget, and MSYS2:

Package manager Command
Chocolatey choco install fzf
Scoop scoop install fzf
Winget winget install fzf
MSYS2 (pacman) pacman -S $MINGW_PACKAGE_PREFIX-fzf

Using git

Alternatively, you can "git clone" this repository to any directory and run install script.

bash
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install

The install script will add lines to your shell configuration file to modify $PATH and set up shell integration.

Binary releases

You can download the official fzf binaries from the releases page.

  • https://github.com/junegunn/fzf/releases

Setting up shell integration

Add the following line to your shell configuration file.

  • bash
    bash
    # Set up fzf key bindings and fuzzy completion
    eval "$(fzf --bash)"
  • zsh
    bash
    # Set up fzf key bindings and fuzzy completion
    source <(fzf --zsh)
  • fish
    fish
    # Set up fzf key bindings
    fzf --fish | source
  • Nushell -- Nushell does not support piping into source, so the install script generates a file in the autoload directory. If you didn't use the install script, you can manually set it up:
    nu
    # Generate the integration script
    mkdir ($nu.default-config-dir | path join "autoload")
    fzf --nushell | save -f ($nu.default-config-dir | path join "autoload" "_fzf_integration.nu")

[!NOTE] --bash, --zsh, --fish, and --nushell options are only available in recent versions of fzf. If you have an older version of fzf, or want finer control, you can source individual script files in the /shell directory. The location of the files may vary depending on the package manager you use. Please refer to the package documentation for more information. (e.g. apt show fzf)

[!TIP] You can disable CTRL-T, CTRL-R, or ALT-C bindings by setting the corresponding *_COMMAND variable to an empty string when sourcing the script. For example, to disable CTRL-R and ALT-C:

  • bash: FZF_CTRL_R_COMMAND= FZF_ALT_C_COMMAND= eval "$(fzf --bash)"
  • zsh: FZF_CTRL_R_COMMAND= FZF_ALT_C_COMMAND= source <(fzf --zsh)
  • fish: fzf --fish | FZF_CTRL_R_COMMAND= FZF_ALT_C_COMMAND= source
  • nushell: add to your env.nu: $env.FZF_CTRL_R_COMMAND = ""; $env.FZF_ALT_C_COMMAND = ""

Setting the variables after sourcing the script will have no effect.

Vim/Neovim plugin

If you use vim-plug, add this to your Vim configuration file:

vim
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
  • junegunn/fzf provides the basic library functions
    • fzf#install() makes sure that you have the latest binary
  • junegunn/fzf.vim is a separate project that provides a variety of useful commands

To learn more about the Vim integration, see README-VIM.md.

[!TIP] If you use Neovim and prefer Lua-based plugins, check out fzf-lua.

Upgrading fzf

fzf is being actively developed, and you might want to upgrade it once in a while. Please follow the instruction below depending on the installation method used.

  • git: cd ~/.fzf && git pull && ./install
  • brew: brew update; brew upgrade fzf
  • macports: sudo port upgrade fzf
  • chocolatey: choco upgrade fzf
  • vim-plug: :PlugUpdate fzf

Building fzf

See BUILD.md.

Usage

fzf will launch interactive finder, read the list from STDIN, and write the selected item to STDOUT.

bash
find * -type f | fzf > selected

Without STDIN pipe, fzf will traverse the file system under the current directory to get the list of files.

bash
vim $(fzf)

[!NOTE] You can override the default behavior

  • Either by setting $FZF_DEFAULT_COMMAND to a command that generates the desired list
  • Or by setting --walker, --walker-root, and --walker-skip options in $FZF_DEFAULT_OPTS

[!WARNING] A more robust solution would be to use xargs but we've presented the above as it's easier to grasp

bash
fzf --print0 | xargs -0 -o vim

[!TIP] fzf also has the ability to turn itself into a different process.

bash
fzf --bind 'enter:become(vim {})'

See Turning into a different process for more information.

Using the finder

  • CTRL-K / CTRL-J (or CTRL-P / CTRL-N) to move cursor up and down
  • Enter key to select the item, CTRL-C / CTRL-G / ESC to exit
  • On multi-select mode (-m), TAB and Shift-TAB to mark multiple items
  • Emacs style key bindings
  • Mouse: scroll, click, double-click; shift-click and shift-scroll on multi-select mode

Display modes

fzf by default runs in fullscreen mode, but there are other display modes.

--height mode

With --height HEIGHT[%], fzf will start below the cursor with the given height.

bash
fzf --height 40%

reverse layout and --border goes well with this option.

bash
fzf --height 40% --layout reverse --border

By prepending ~ to the height, you're setting the maximum height.

bash
# Will take as few lines as possible to display the list
seq 3 | fzf --height ~100%
seq 3000 | fzf --height ~100%

Height value can be a negative number.

bash
# Screen height - 3
fzf --height -3

--popup mode

With --popup option, fzf will start in a popup window (requires tmux 3.3+ or Zellij 0.44+).

bash
# --popup [center

Issues· 332 open

View all issuesOpen on GitHub
  • #4921

    `:FZF!` no longer follows dynamic `g:terminal_ansi_colors` changes

    Updated Sep 24, 2026
  • #4924

    csi and modifyotherkeys ctrl-backspace input handing

    Updated Sep 23, 2026
  • #4916

    Add `shift-space` key name for Kitty `CSI 32;2u`

    Updated Sep 21, 2026
  • #4922

    [FEATURE] multiple selection types

    Updated Sep 19, 2026
  • #4820

    Feature: Built-in copy action for cross-platform clipboard support

    featureUpdated Sep 14, 2026
  • #4915

    pending STDIN and --height=~80% delay first paint indefinitely

    Updated Sep 11, 2026
  • #4911

    Perf: Collect fish completion results in bulk

    fishUpdated Sep 7, 2026
  • #3430

    Use vim as previewer

    Updated Sep 2, 2026
  • #4890

    [Feature] Ability to change the cursor in the header on WIndows FullScreen

    Updated Aug 15, 2026
  • #4883

    Regression in 0.74.1 (and 0.74.2) where there's an invalid space after the last character typed in Emacs, 0.74.0 works correctly

    emacsUpdated Aug 12, 2026

> Tags

Gobashclifish

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 17, 2026
Category开发工具
PricingFree

> Related tools

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具