Live data from Hacker News

Fzf – a command-line fuzzy finder

github.com

31–40 of 93 posts

Re: Fzf – a command-line fuzzy finder

#31

An awesome use case for fzf is to use it as a selector for a bunch of lines of text. So we have a script that gets the latest docker images and then we pipe it to fzf allowing you to select which one of them you want to use. Just a small thing to add on to the awesomeness that is fzf!

I wrote a small "selector" script to use fzf or dmenu depending on whether a TTY is available. So if I am running a script involving selection outside of a terminal I get the dmenu GUI, but inside a terminal I get fzf.

Re: Fzf – a command-line fuzzy finder

#32
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.

> delta

I don’t understand what it does. Is it like an alternative diff or is it a patching utility based on a specifically formatted file?

Re: Fzf – a command-line fuzzy finder

#33
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.

I'll give that a shot. Thank you.

Re: Fzf – a command-line fuzzy finder

#34

If you still don't know how useful fzf is, you should start with integrating fzf and ctrl+r (reverse search).

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.

There are instructions for enabling it in the package manager docs: apt-cache show fzf

Re: Fzf – a command-line fuzzy finder

#36
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.

> delta I don’t understand what it does. Is it like an alternative diff or is it a patching utility based on a specifically formatted file?

As far as git's concerned it's a pager - like `less` for example - that pages through `git diff` (for example) output.

It formats that output, and then might typically be chained into `less` for actual paging.

[I co-maintain, just issue triage really, a similar alternative called `diff-so-fancy`.]

Re: Fzf – a command-line fuzzy finder

#38
post #36

Earlier quoted context omitted.

> delta I don’t understand what it does. Is it like an alternative diff or is it a patching utility based on a specifically formatted file?

As far as git's concerned it's a pager - like `less` for example - that pages through `git diff` (for example) output. It formats that output, and then might typically be chained into `less` for actual paging. [I co-maintain, just issue triage really, a similar alternative called `diff-so-fancy`.]

Thanks

Re: Fzf – a command-line fuzzy finder

#39

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?

Re: Fzf – a command-line fuzzy finder

#40

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

Just to spread some credit/karma around a bit: if you use VS Code's "Find in Files" feature, you use ripgrep. It's why it's so fast.
Post reply on HN