fzf
Created May 28, 2025.
There have been no updates since.
You’ve heard of fzf, right?
If you’re like me, you’re probably thinking “this is cool but I’m not sure how and where to use it”.
Here, I document the ways I use fzf.
⌘P in Visual Studio
Occasionally I’ll want to open up a file inside of a directory hierarchy but not want to type out the whole path.
Here’s what typing out the whole path looks like:
bbedit words/computing/ideal/os/index.gmi
That may not be a whole lot of typing in a normal terminal, but it’s pretty stop-and-go with the tab key.
Eventually I thought “I use `fd -e …` plenty. Can’t I just pipe that to fzf?”
You’re less likely to have heard of fd:
In short, it’s find(1), but the command-line options are different and it ignores files in .git directories and .gitignore files.
So I tried running this:
bbedit (fd -e gmi | fzf)
…and then I typed `os`…
The bottom hit was the one I wanted:
⋮ words/others/parthenon/index.gmi words/sywtlf/obesogens-out/index.gmi words/computing/ideal/os/graveyard/index.gmi ▌ words/computing/ideal/os/index.gmi 41/69 ──────────────────────────────────────── > os
…and then I pressed the Enter key, and a BBEdit window popped up with my ideal-OS gemtext file in it.
I then thought I might want to make this kind of thing generally easier, so I added a few abbreviations in my ~/.config/fish/config.fish:
abbr --add fdf --position anywhere --set-cursor "(fd -e % | fzf)"
abbr --add fdfg --position anywhere "(fd -e gmi | fzf)"
if command -q fdfind # fd…on debian
abbr --add fdf --position anywhere --set-cursor "(fdfind -e % | fzf)"
abbr --add fdfg --position anywhere "(fdfind -e gmi | fzf)"
end
(I’m a big fan of automatic formatters like gofmt/Prettier/etc., but most emphatically not for my fish code.)
I’m not sure if I’ll be able to remember “fdf” and “fdfg” when typing `bbedit (` will start the completion and `bbedit (fd -e gmi | fzf)` shows up in my scrollback, but I suppose writing it down nicely both in my config.fish and typing it up here will help.
Incidentally, this is BBEdit:
I like writing in it because it has an option to automatically curl quote marks.
⏚