PRIMARY CATEGORY → SETUP

FZF → A General-Purpose Command-Line Fuzzy Finder 🔎

It is an interactive Text Filter program for any kind of list such as →

  • Files

  • Command History → C-R

  • System Processes → Tab

  • SSH Connections → Tab

References 🛈

Github Repository

FZF Documentation

Check this out too

Keybinds
Reverse History
ActionShortcut
ToogleC-r
Up/DownC-k/C-j or C-p/C-n
Select ItemEnter
ExitC-g/C-c/Esc
Multiselect Mode - Mark ItemsTAB/S-TAB
Others
ActionShortcut
File SelectionC-t
cd-like MovementM-c
Autocomplete** + TAB
Installation

Reference

Clone the Github Repository and run the Install Script as follows →

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

That’s it!

$ command -V fzf
fzf is /home/al3xbb/.fzf/bin/fzf

To enable some handy features of FZF, add the following lines in the .zshrc file

File Preview with BAT

export FZF_DEFAULT_OPTS="--height 40% --border --preview 'bat --color=always {} 2> /dev/null'"

The above one modifies the FZF’s Display Format and enables File Preview Mode with BAT

FD instead of Find

export FZF_DEFAULT_COMMAND="fd --type f"
Integration

FZF supports integrations with some Tools and Functionalities such as →

Nvim/Vim/Vi
$ nvim $( fzf )

Bat/Cat
$ bat $( fzf )