Live data from Hacker News

So you've installed `fzf` – now what?

andrew-quinn.me

211–220 of 292 posts

Re: So you've installed `fzf` – now what?

#211

I love fuzzy shell history. Game changer in terms of shell productivity. I use atuin[0] instead of fzf as I find the experience a bit nicer and it has history backups built in (disclaimer, I am a maintainer) Some of our users still prefer fzf because they are used to how it fuzzy finds, but we're running an experiment with skim[1] which allows us to embed the fuzzy engine without much overhead - hopefully giving them…

Fuzzy history is nice, but the real game changer for me was the ability to pretty much stop remembering paths in big projects. The default keybindings provide the Ctrl-T shortcut to insert a path/filename on the command line using fuzzy search and Alt-C to fuzzy-cd. No more tedious completion - just search + enter.

I've got this in my profile:

  export CDPATH="$HOME:$HOME/code/:$(ls -d $HOME/work/*/| tr \\n :)"
so regardless of my cwd I can cd into pretty much any project I'd want to.

Re: So you've installed `fzf` – now what?

#212

Earlier quoted context omitted.

Yes. It's a shell hook, it's expected for you to add it to your bash/zsh .rc yourself. How else can it work?

Packages can place init scripts into /etc/profile.d and those get autoloaded by shells.

That is not where interactive shell confs should go, or it'll get loaded in non interactive contexts as well, which you usually don't want.

Re: So you've installed `fzf` – now what?

#213

The article is a pretty helpful collection of examples, and I appreciate it. The intro irks me, though: > Software engineers are, if not unique, then darn near unique in the ease with which we can create tools to improve our own professional lives; this however can come at a steep cost over time for people who constantly flit back and forth between different tools without investing the time to learn their own kit in…

A woodworker needs a supply of dry wood and can't just TDD, or undo/redo their way to a table. Ditto for other fields.

Re: So you've installed `fzf` – now what?

#214
This article makes things more complicated than they need to be:

> vi $(find . '/' | fzf): For finding random config files

Instead you can just use:

> vi **

** is the real gamechanger here. You can use it with ssh, too. I managed about 500 SSH hosts. ssh ** will find hosts via /etc/hosts and .sshconfig

Re: So you've installed `fzf` – now what?

#215

have no need for this, plenty fast without it. these two have been sufficient for all my needs: ctrl + r for most things history | grep for searching when i forget the exact command or want to see related commands. I don't want pull downs, pull ups, drop downs, expanded hamburger menu, hot dogs, another set of key strokes to remember how i started some service last month.

[deleted]

Re: So you've installed `fzf` – now what?

#216

Earlier quoted context omitted.

Thank you!! Why on earth isn't that the default. It always seemed weird that with multiple bash windows open, the commands from most of them weren't added to the history.

I often have three or more terminals open, doing different tasks in each; I also often have cycles of work where I'll repeat the last three commands again (three up-arrows and a return). This breaks if one terminal's commands get inserted into another terminal's history.

My solution is I immediately record the commands, but do not load them. That way new terminals get all the history, but old terminals keep their flow.

Re: So you've installed `fzf` – now what?

#217

Earlier quoted context omitted.

If that's your use case, here's another game changer (one line bashrc change to make bash_history changes immediately, rather than upon shell exit, e.g. when you end your tmux session): https://web.archive.org/web/20090815205011/http://www.cuberi...

Thank you!! Why on earth isn't that the default. It always seemed weird that with multiple bash windows open, the commands from most of them weren't added to the history.

It is very useful just be careful when switching between shells and hitting the up arrow to get the previous command, as you may get something from another shell.

Re: So you've installed `fzf` – now what?

#218
Surprised Ctrl+T didn't get a mention. Maybe that's a zsh-only thing, but it's basically the same as his vim $(fzf) example, except I only have to type vim and then Ctrl+T.

I use this all the time when I'm running unit tests from the command line for instance. Helps me quickly get the path to the file I want without needing to remember the details of the folder structure. Just Ctrl+T -> tests/GLPage will yield me tests/long_path/GoddamnLoginPageTests.foo

Re: So you've installed `fzf` – now what?

#219

I love fuzzy shell history. Game changer in terms of shell productivity. I use atuin[0] instead of fzf as I find the experience a bit nicer and it has history backups built in (disclaimer, I am a maintainer) Some of our users still prefer fzf because they are used to how it fuzzy finds, but we're running an experiment with skim[1] which allows us to embed the fuzzy engine without much overhead - hopefully giving them…

It's not only a zsh thing, works in bash too.

I liked the way he covered just one function though, which at least might be starters for such operations, and are fully operational, and probably caters for better workflows for most, than without fzf.

Funny thing: I try to stop using Ctrl-R from fzf at the moment, and rather use the one that ships with smenu.

Re: So you've installed `fzf` – now what?

#220

Earlier quoted context omitted.

Same thing with Emacs with Projectile. I can't believe people still using a tree view of a deeply nested project and clicking though directories and finally finding a file. I am not willing to type more than a few characters for any file in the project. Fuzzy finding with quick narrowing FTW.

I've seen a number of projects with hundreds of "index.js" files.

So you type a few more characters and narrow it down. Space separated snippets will match any part of the path.
Post reply on HN