Weekly Command: Fuzzy finding everything with fzf

Examples of on the fly details

get sha1sums on the fly with interactive searching

find /Users/dspencer1/Downloads/ -type f | fzf --preview="which shasum && shasum {} || sha1sum {}"

get hexdump on the fly with interactive searching

find /Users/dspencer1/Downloads/ -type f | fzf --preview="xxd {}" 

combining with other commands to get extra details

find /Users/dspencer1/Downloads/ -type f | fzf --preview="stat {} && (shasum {} | cut -f1 -d\  )"

Integration with Vim and Git

Setup

git config --global diff.tool vimdiff
git config --global difftool.prompt false
git config alias.vdiff '!git log | grep commit | cut -d" " -f2| fzf --preview="git diff $(cut -d\\  -f2 <<< {})"'

git vdiff

Bonus round

Pair fzf --preview with GNU Nmh+fetchmail+procmail for email and shic+bitlbee for chat.

Or even pair it with docker and ssh:

docker image ls --format '{{.Repository}}:{{.Tag}} {{.ID}} {{.Size}}' | fzf --preview='docker inspect $(cut -d\\  -f2 <<< "{}")'

Summary / TLDR;

FZF and companions will seriously up any one’s productivity and game.

Sure, One could use pretty gui tools but if one wants to get things done or earn their 1337 level badge then one has to be using the right tool for the job. Afterall how many gui tools out there can give you nanosecond fast fuzzy search and provide that to everything else built into the OS including all gui?

Love to see your creations, post a screenshot and command below

1 Like

What does fzf have to do with an early Naughties VW GT?

1 Like