[Tab] When bash-completion meets fuzzy finder.
Pipe bash tab-completion suggestions into fzf
fuzzy finder
bash-completion
by default, so there is less chance you will have to install it)Source fzf-simple-completion.sh
at the end of your .bashrc
. For example:
source ~/path/fzf-simple-completion.sh
This will replace the default bash completion by fzf selection menu whenever you hit TAB
.
This project is motivated by Accessing tab-completion programmatically in Bash. You may find some alternatives on Github as well, but the implementations looks overwhelming to me (I'm not a bash guru so I want to keep things as clean and manageable as possible).
The idea this project works on is straightforward:
bash-completion
directly into fzf
for easy search and selection.There is an extra work to make the complettion handle directories with spaces, shortening paths, and coloring. The script itself is written in just a few lines of code, making it easy to modify and customize as needed.