PRIMARY CATEGORIES → DESKTOP SETUP • SERVER 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 🛈
Check this out too
Installation
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"
Repeat all the above steps as Root
IMPORTANT
Note that the above actions require Bat and FD to be installed in the system
Shortcuts
Shorcuts’ Meaning
Key | Meaning | |
---|---|---|
C | Control | C-c → Control+c |
M | Alt | M-a → Alt+a |
S | Shift | S-o → Shift+o |
Super | Windows | Super-s → Windows+s |
Return | Enter | C-S-Return → Control+Shift+Enter |
- | + | C-z → Control+z |
{a,b,c,d} | a b c d | C-{a,b,c,d} → C-a C-b C-c C-d |
Reverse History
Action | Shortcut |
---|---|
Toogle | C-r |
Up/Down | C-k C-j C-p C-n |
Select Item | Return |
Exit | C-g C-c Esc |
Mark Items Backward/Forward (Multiselect Mode) | TAB S-TAB |
Others
Action | Shortcut |
---|---|
File Selection | C-t |
cd-like Movement | M-c |
Autocomplete | ** + TAB |
Integration
FZF supports integrations with some Tools and Functionalities such as →
Nvim/Vim/Vi
$ nvim $( fzf )
Bat/Cat
$ bat $( fzf )