fzf Install, Upgrade, and Shell Integration

Install fzf, enable shell integration, and configure global defaults for day-to-day use.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## Install and verify
Install with Homebrew
brew install fzf

# Install fzf on macOS or Linux with Homebrew.

Install with apt
sudo apt-get install -y fzf

# Install fzf from Debian or Ubuntu repositories.

Install with pacman
sudo pacman -S fzf

# Install fzf on Arch Linux.

Install from the upstream repository
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install

# Clone the repo and run the installer for shell integration.

Check the installed version
fzf --version

# Print the current fzf version.

Open the embedded manual
fzf --man

# Show the built-in man page from the binary.

## Shell integration
Source zsh integration
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

# Load fzf key bindings and completion in zsh.

Source bash integration
[ -f ~/.fzf.bash ] && source ~/.fzf.bash

# Load fzf key bindings and completion in bash.

Set a better default file source
export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'

# Use fd instead of find for faster file listings.

Define global default options
export FZF_DEFAULT_OPTS='--height=40% --layout=reverse --border --info=inline'

# Apply common options to every fzf invocation.

Customize CTRL-T picker
export FZF_CTRL_T_OPTS='--preview "bat --style=numbers --color=always --line-range :200 {}"'

# Tune the file picker bound to CTRL-T.

Recommended next

No recommendations yet.