Live data from Hacker News

Fzf – a command-line fuzzy finder

github.com

41–50 of 93 posts

Re: Fzf – a command-line fuzzy finder

#41

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 software, that scares me. I save habitually, and not only when I'm actually ready to build the result.

Re: Fzf – a command-line fuzzy finder

#43

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…

entr comes with an option to interrupt the command in case of files change, by default it will wait for the command to finish.

Re: Fzf – a command-line fuzzy finder

#44
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 my workflow, but I couldn't see the value that would justify the overhead of having to learn a different tool.

Re: Fzf – a command-line fuzzy finder

#46

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…

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

Re: Fzf – a command-line fuzzy finder

#47

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…

You're looking for a "hold-period" after a change in files are detected before triggering the action.

This is called "debounce" in `watchexec` a similar program to `entr`

Re: Fzf – a command-line fuzzy finder

#48

Earlier quoted context omitted.

This is one of the first things I install on a new machine after oh-my-zsh

I'm not trying to troll you or be annoying or get off my lawn kinda thing right, but seriously, what the fuck is the point of oh-my-zsh? I still use ksh these days (actually, the openbsd version, even on linux) and it behaves EXACTLY the same way as a bash shell to the uninitiated (ctrl+r, fc -l, etc etc etc).. I have some little shell functions that I use for things, like 'git_branch()' which I use with some aliases…

For me, the few plugins I use have really good/sane defaults so any configuration is minimal (can't even remember configuring any of them, tbh, lol). Mostly I use oh-my-zsh not to improve zsh itself [besides the aussiegeek theme :^)], but to make zsh work more harmoniously with other programs - tmux, git, rg, etc.

Re: Fzf – a command-line fuzzy finder

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

I failed a bunch of times to find a terminal differ that could display diffs and especially merges with convenience comparable to graphical tools like Meld, KDiff of Idea's built-in merger. So far the best I could dig up is `icdiff` for side-by-side diffs, and some Emacs mode that Magit uses, for three-way merges (the latter is not a terminal util really, just faster sometimes than going to Meld).

Re: Fzf – a command-line fuzzy finder

#50

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?

entr is written in C, watchexec is written in Rust.

There's another one that I've used that is written in go: https://github.com/cespare/reflex

I am inclined to use watchexec next time I need one, because like go, I can read it more easily than c, but also because I looked at the web page and GitHub repo and it seems worth trying. For instance, it shows how to use it as a library instead of just as a command-line tool. https://watchexec.github.io/

Post reply on HN