Live data from Hacker News

Fzf – a command-line fuzzy finder

github.com

81–90 of 93 posts

Re: Fzf – a command-line fuzzy finder

#82

Earlier quoted context omitted.

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 differenc…

Yep. Awesome.

Re: Fzf – a command-line fuzzy finder

#83
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`.]

Diff so fancy is great too! I go back and forth between it and delta at times by leaving delta as the default diff tool and adding a git alias for the following:

    dsf = "!f() { [ -z \"$GIT_PREFIX\" ] || cd \"$GIT_PREFIX\" && git diff --color \"$@\" | diff-so-fancy  | less --tabs=4 -RFXS; }; f"

Re: Fzf – a command-line fuzzy finder

#84
post #58

It has replaced vim’s “open file” and “switch to buffer” for me. I occasionally use it in the command line, by expanding *. Not that often as in Vim, but very useful. I still need to find a satisfactory way to do “find in files” with vim. I use a custom script to call ag and it’s enough, but a bit clunky at times.

If you're using fzf.vim ( https://github.com/junegunn/fzf.vim ) then you can use :Rg or :Ag. This will run ripgrep or silver-searcher and present the results in a fuzzy finder window.

Wait. What. Just tried that. It worked. I must have missed it when I installed the plugin. Thanks a lot! I can now remove a bunch of stuff from my config file :)

Re: Fzf – a command-line fuzzy finder

#85

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.

Did not know that! I've always thought to myself how lightning fast find in files in vscode was. It all makes sense now.

Re: Fzf – a command-line fuzzy finder

#86

Earlier quoted context omitted.

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…

Skim is effectively dead. fzf continues to receive new features and improvements. One of the stated goals of skim is that it will be option-compatible with fzf.

Unfortunately that's only superficially true at this point. I recently removed sk support from a project because I was tired of special-casing for it. (ZFSBootMenu).

Re: Fzf – a command-line fuzzy finder

#88

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…

Do you have to be very careful when you save files if you're using that? I can imagine having it start a build that then spews tons of errors just because you saved a file that's only one of many changes you wanted to make, could become irritating more than anything else. Also, what happens when you change a file in the middle of a build that it started? I can see how it could be helpful, but with the way I write sof…

I have the same workflow as you. It is not that hard to write ‘make test’ when you want to run your tests.

I think there’s something I don’t understand about GP:s workflow and needs.

Re: Fzf – a command-line fuzzy finder

#89
post #17

Earlier quoted context omitted.

Have started using kubectl lately, and would be interested to know how you use fzf. I’m finding I have to do a lot to copying and pasting of pod names in between commands.

You can do a fair amount of stuff with k9s, which is a nice tool. But if you need to to do something more specialized you can pipe the output of a kubectl command into fzf and then use the ‘describe’ sub command on the selected item returned by fzf. Basically when you need to interact in someway then run a command on the output fzf can be great.

Ahh, I actually didnt know about that 'describe' command. That helps a lot to get some search terms. Thanks!

Re: Fzf – a command-line fuzzy finder

#90

Earlier quoted context omitted.

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…

Skim is effectively dead. fzf continues to receive new features and improvements. One of the stated goals of skim is that it will be option-compatible with fzf. Unfortunately that's only superficially true at this point. I recently removed sk support from a project because I was tired of special-casing for it. (ZFSBootMenu).

This is a shame if you're correct. Interested -- and since you're well placed -- what functionality am I missing out on re: fzf?
Post reply on HN