1. 26

    1. 10

      I have this incredibly useful alias that I use all the time:

      alias e='fzf -m --bind ctrl-a:select-all,ctrl-d:deselect-all,ctrl-t:toggle-all --print0 --preview "bat --theme Dracula --color=always {}" | xargs -0 -o $EDITOR'

      It uses fzf for finding, bat for colored preview and then launches the selected file(s) in $EDITOR (vim in my case)

    2. 5

      I used to be annoyed at how often this “clearly useless” thing kept popping up in all my RSS feeds and on Mastodon and on forums and then one day I tried it and…

      …it turns out it’s super useful and I use it in, without a joke, close to 100% of my scripts. This is a rare tool where I’d strongly suggest reading the manual, and then approaching almost any interactive input problem with, “okay, but can fzf handle this?” Because the answer is almost always “yes” in my experience, and will almost always be a better user experience-for-dev-time trade-off than a custom solution

      1. 3

        I have so few complaints about fzf, and all of them are because they’re responsibly judicious about adding complexity to it (but obviously my use case makes sense and should be added, right?).

        Truly excellent software.

      2. 1

        I use it in, without a joke, close to 100% of my scripts.

        How do you use it in scripts? I only use it interactively.

        1. 3

          I tend to write my scripts to allow interactive input if you forget a parameter, and giving fzf a list of valid options is usually a great way to handle that: takes barely any time to do, and feels very polished

    3. 4

      Oooo… I loved fzf. What a gem! Thanks for pointing me to it. :-)

      1. 1

        I’m glad you found it useful

    4. 2

      What’s the point of something like: git branch | fzf when it only prints out the branch name for you.

      I find more fzf commands to be dead-ends like that which greatly reduces their usefulness.

      I have something like this setup but it’s also not great. The fzf documentation is less than awesome if you’re fiddling around with this stuff.

      set -x FZF_DEFAULT_OPTS "--bind 'ctrl-l:execute-silent(qlmanage -p {}),ctrl-r:execute-silent(open -R {}),ctrl-o:execute-silent(open {})+abort,ctrl-e:execute(code {}),enter:execute(echo {} |tr -d "\\r\\n" | pbcopy; echo {})+abort'"
    5. 2

      You’ve got a duplicate sentence at the end of your * n-gram Analysis bullet point. Great article.

      1. 1

        Thank you for letting me know

        I’ll fix that and I’m glad you found it helpful

    6. 2

      There’s quite a lot of TUI fuzzy matchers, but I use skim because it’s as featureful as fzf (and mostly flag-compatible!) and even has some extra features, and is written in Rust (which I mostly prefer due to being able to cargo install it along with like the majority of tools I use).

      1. 1

        I’ll give a try to skim, and it looks really cool as I checked the github page

        I have a been extensively using fzf and it has worked quite well for me

      2. 1

        I can second skim, because it’s also really nice to use as a rust library.

    7. 2

      Any time anyone uses Alfred, spotlight, or rofi-like systems, I usually have been able to use fzf from the terminal. It allows me to use a workflow that works on Linux on Windows or MacOS, like tmuxc.

      1. 4

        rofi is still cool for when you want to immediately do an action without activating your terminal window first. Or is there some trick to do it without having to open/navigate to a terminal session?

        1. 1

          I just live in the terminal so much. Also, rofi doesn’t work well over an ssh connection, on a Mac, or Windows.