FZF is an interactive Unix filter for command-line that can be used with any list; files, command history, processes, hostnames, bookmarks, git commits, etc.
Tree
Display directories as trees (with optional color/HTML output)
1 | brew install tree |
fd
Simple, fast and user-friendly alternative to find.
1 | brew install fd |
ripgrep
ripgrep is a line-oriented search tool that recursively searches the current directory for a regex pattern.
1 | brew install ripgrep |
fish
User-friendly command-line shell for UNIX-like operating systems.
1 | brew install fish |
fzf
fzf is a general-purpose command-line fuzzy finder.
1 | brew install fzf |
FZF preview
Let’s create a function that will preview file or directory using mentioned tools
1 | # .config/fish/functions/__fzf_preview.fish |
Now change the default option
1 | set -U FZF_DEFAULT_OPTS " \ |
Search
Let’s make our search faster using fd and ripgrep
1 | set -U FZF_ALT_C_COMMAND "fd -t d . \$dir" |
About this Post
This post is written by Mahfuzur Rahman, licensed under CC BY-NC 4.0.