by BiteCode_dev · 3y ago · 0 comments
I was exactly in the situation the article describes, I installed it, then, didn't find a use case.
But that's because Ubuntu doesn't come with completion enabled by default.
You have to add in your bashrc:
if [ -e /usr/share/doc/fzf/examples/key-bindings.bash ]; then
source /usr/share/doc/fzf/examples/key-bindings.bash
fi
The fzf and ubuntu docs don't mention you have to.Couldn't find easily how to do it with google, but chatgpt saved the day once again.
git log --oneline | fzf
for example is one of my favorite tricks. Instead of scanning by eye or repeatedly grepping to find something, it's a live fuzzy filter. And depending on how deep you want to go you can then add key bindings to check out the selected commit, or preview the full message, or anything really. git log --oneline | fzf | cowsay
Sky's the limit.Then it would just be (in bash anyway):
source /usr/share/fzf/keybindings.bash if [ -e /usr/share/doc/fzf/examples/completion.bash ]; then
source /usr/share/doc/fzf/examples/completion.bash
fi
/usr/share/doc/fzf/README.Debian explains this, as well as the setup for zsh, fish and vim.[1]: https://github.com/junegunn/fzf#fuzzy-completion-for-bash-an...