Live data from Hacker News

Fzf – a command-line fuzzy finder

github.com

71–80 of 93 posts

Re: Fzf – a command-line fuzzy finder

#71

Another wonderful tool is "entr". It just runs a program when files change. It's incredible. I use it 20-40 times an hour to do very fast Dev/DevOps development: - "run Pytest when Python files change" - "I forgot how to use ps, run my-ps.sh when it changes and show me the output" - "rebuild all these Kubernetes resources when I edit the YAML files" - "run fast lint, then unit test Python files, then invoke one and s…

I use https://watchexec.github.io/ for this, which looks similar. Anyone who tried both and knows which one is better?

watchexec is a lot better at watching directories. entr deals with (existing files) best.

Re: Fzf – a command-line fuzzy finder

#72

ripgrep[1] is usually mentioned in the same breath. I use them both daily. Truly indispensable. [1] https://github.com/BurntSushi/ripgrep

Seconded. Fzf didn't stick with me, but Ripgrep I use a dozen times an hour . It's incredibly fast, and mostly does exactly what I want.

I use fzf to open files in vim. And I use ripgrep's file listing to feed into fzf, so I use both daily together :)

Re: Fzf – a command-line fuzzy finder

#73

ripgrep[1] is usually mentioned in the same breath. I use them both daily. Truly indispensable. [1] https://github.com/BurntSushi/ripgrep

Seconded. Fzf didn't stick with me, but Ripgrep I use a dozen times an hour . It's incredibly fast, and mostly does exactly what I want.

I think you have to really love the idea of creating an app/script or hot key for a work flow to really start to enjoy using 'fzf'. And for most, I get it, it's "Where to start? Ugh, looks like work."

For those that haven't tried yet, and want an entry point, I'd highly recommend you play around with the 'fzf' key bindings and completion scripts for zsh[0] to see what's possible. A little app of mine[1] also has an example of what one might call the minimal viable hot key script for you (note: for skim or 'sk', a 'fzf' Rust clone).

[0]: https://github.com/junegunn/fzf/tree/master/shell [1]: https://github.com/kimono-koans/httm

Re: Fzf – a command-line fuzzy finder

#74
post #30

Earlier quoted context omitted.

How do you do this, by the way? I used sudo apt install fzf and then realized I still have to set up the ctrl-r part. I think I installed it differently on other systems previously, and those installs took care of the integration for me.

Try installing it from the source into eg. ~/.fzf and run ~/.fzf/install (if I remember correctly). It will offer to add bindings for ctrl-r etc. to the shell's rc file. Easy to update, just run git pull in ~/.fzf and install again.

Easy on its own but nonstandard, so it's annoying to manage every tool in its own way.

Re: Fzf – a command-line fuzzy finder

#75
post #21

Fzf was life changing when I first stumbled on it. Even cooler was the rabbit hole it led me down. Through fzf I discovered fd, bat, delta, and rg. That first exposure to fzf brought the biggest change to my workflow in years.

Have you looked through this list? https://github.com/rust-unofficial/awesome-rust#system-tools . zoxide is one of favorites plus the ones you mentioned.

Re: Fzf – a command-line fuzzy finder

#76

I can totally see why fzf is a great utility and is indeed very cool but I don't see real value other than as a Vim plugin for Ctrl-P. For a Ctrl-R replacement in the terminal, it never sticked with me, because getting more than 1 results was distracting. Also, if I'm in a directory and want to open a file in vim that I'm not sure of its location, I do `vim` and then Ctrl-P. I tried to incorporate it a few times in m…

Because it's a two-dimensional ctrl-R; therefore far superior. You can look through variations of the same command. If you do a lot of CLI that's important, at least to some of us.

Re: Fzf – a command-line fuzzy finder

#77

I have been really inspired by 'fzf' recently. Wrote a fun little ZFS utility[0] which I intended to just script with 'fzf', but have since found skim[1], or 'sk', and now use it both as my sole fuzzy finder app (because it's supposed to be interactive and it's faster!), and as a library for my little utility. I like them both for making fun zsh key bindings, so, so easy. [0]: https://github.com/kimono-koans/httm [1]…

Do you have a source for the faster claim? I read back when I was investigating that fzf was still faster despite the Go vs Rust performance debate.

Re: Fzf – a command-line fuzzy finder

#78

I have been really inspired by 'fzf' recently. Wrote a fun little ZFS utility[0] which I intended to just script with 'fzf', but have since found skim[1], or 'sk', and now use it both as my sole fuzzy finder app (because it's supposed to be interactive and it's faster!), and as a library for my little utility. I like them both for making fun zsh key bindings, so, so easy. [0]: https://github.com/kimono-koans/httm [1]…

Do you have a source for the faster claim? I read back when I was investigating that fzf was still faster despite the Go vs Rust performance debate.

That's a good question. I'd be interested in any benchmark you saw. And although it seems like sk has come a long way since 2020[0], it may still be slower reading in a larger file. I really don't know.

But I suppose I'd ask -- faster how?

The linked benchmark really doesn't mean much to me. As an interactive app I judged it on how it felt latency-wise at the CLI. So, I would just try to scroll page-up while find was feeding in the files in my home directory. fzf would sometimes stall on my system (again not scientific) and would occasionally junk up the terminal when it got fed something strange. This could be a problem with fzf or it could have been a problem with how I was using it.

On the other hand, sk at the CLI has been rock solid and very fast. skim as a library needs better docs and has a few other teething issues, but I'm using skim right now, because it feels faster, and because I use it as a library, there is some mental continuity between the two. Recognize and respect fzf in this space, it's just sk is doing it better for me, for now.

[0]: https://github.com/lotabout/skim/issues/317

Re: Fzf – a command-line fuzzy finder

#79

Earlier quoted context omitted.

Seconded. Fzf didn't stick with me, but Ripgrep I use a dozen times an hour . It's incredibly fast, and mostly does exactly what I want.

I think you have to really love the idea of creating an app/script or hot key for a work flow to really start to enjoy using 'fzf'. And for most, I get it, it's "Where to start? Ugh, looks like work." For those that haven't tried yet, and want an entry point, I'd highly recommend you play around with the 'fzf' key bindings and completion scripts for zsh[0] to see what's possible. A little app of mine[1] also has an e…

For me the key to using fzf has been remembering that you can pipe ANYTHING into it. For example, grovelling though a git repo with grep might take multiple tries and careful refinement of search patterns. Or you can

    git log --oneline | fzf
and interactively fuzz your way to the commit you're looking for. Having the ability to just update live with backspace when the search isn't matching makes a tremendous difference.

Re: Fzf – a command-line fuzzy finder

#80
post #57

Earlier quoted context omitted.

It can be useful to let you (fuzzily) pick from a list of things to execute a command. I use it to interact with git, i.e.: - checkout local git branch from curated list of branches fed through fzf - cherry pick commits from the previous (@{-1}) branch, using fzf + preview showing each commit's "diff" - pick recent SHA to git revert - pick files changed from {master,main,blead} - pick files currently uncommitted

Oh jeez, those are great examples. Thanks. I only use it in neovim (telescope), this post and your comment have inspired me to start trying it on the command line.

For further inspiration, there are some interesting scripts making use of fzf here: https://github.com/DanielFGray/fzf-scripts
Post reply on HN