Live data from Hacker News

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

andrew-quinn.me

101–110 of 292 posts

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

#101
post #93

Earlier quoted context omitted.

I also had a rather noticeable delay when launching atuin. As it turns out, this was because it checked for an update every time it launched! You can disable that update check: add a ` update_check = false` to your `~/.config/atuin/config.toml` [1]. That made the delay pretty much disappear for me. [1]: https://atuin.sh/docs/config/#update_check

What? I don't expect any tool to interact with the network if it's not made specifically for this (curl, netcat, etc). This would betray my expectations, I find it unacceptable.

It's one of our key features

> backup and sync encrypted shell history

But it's up to you. You can disable any sync features by installing with `--no-default-features --features client` set. Your application won't have any networking features built into the binary then

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

#103
post #57

Earlier quoted context omitted.

I wanted to like atuin. The idea is great. But it just could not match the instant search that ctrl-r with fzf offers sadly. There is always a noticeable delay that annoyed me and made me revert back to fzf for search. For me another issue was that I needed to do more keystrokes for the same behaviour (search a previously ran command and execute it). Fuzzy shell history search is just one of those mind-blowing things…

I also had a rather noticeable delay when launching atuin. As it turns out, this was because it checked for an update every time it launched! You can disable that update check: add a ` update_check = false` to your `~/.config/atuin/config.toml` [1]. That made the delay pretty much disappear for me. [1]: https://atuin.sh/docs/config/#update_check

We actually fixed the delay issue, but since you disabled update checking you wouldn't have known to update!

It was quite annoying so we're sorry for that

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

#104

Am I the only one that tried fzf as a replacement to the default Ctrl+R behavior, then switched back? I'm perfectly satisfied with the default Ctrl+R functionality, to the point that fzf seemed to add visual clutter without any value. I guess I was never let down by inverse search. Context: I'm using Linux and doing SWE and SRE work, and constantly live in the terminal.

Not a hard choice. So far I stick to the vanilla C-r, same as you.

But I also remember that I can C-r /fzf/ and it will search back to the command:

   source /usr/share/doc/fzf/examples/key-bindings.bash
which will instantly upgrade my search capabilities, if I'm stuck. Which doesn't really happen that much.

I think the main part of my vanilla C-r experience is that I trained myself to remember commands differently. I somehow remember exact char-to-char tokens, like the "/fzf/" substring above. Or for a more extreme example "ose -p d" when I try to find:

    docker compose -p devenv exec myservice /bin/sh
Weirdly, I kinda know that if used "se -p d" instead (shorter) it would land me on a wrong command (so, not shorter).

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

#105

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…

Something I've always wanted from my shell history is to be able to record relative filepaths as their absolute equivalent in the history, is that supported in atuin?. If you do a lot of data munging on the CLI, you end up with a lot of commands like `jq 'complicated_selector' data.json`, which if I want to remember the selector is good, but if I want to remember which data I ran it on is not so good. I could do it w…

Technically. For every command you run, atuin stores the current directory, the time, the duration, the exit code, a session id and your user/host name.

With the current directory you should be able to get the absolute path from your relative paths

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

#106
post #57

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…

I wanted to like atuin. The idea is great. But it just could not match the instant search that ctrl-r with fzf offers sadly. There is always a noticeable delay that annoyed me and made me revert back to fzf for search. For me another issue was that I needed to do more keystrokes for the same behaviour (search a previously ran command and execute it). Fuzzy shell history search is just one of those mind-blowing things…

As I put in a child reply, that delay should be fixed.

But if you can't get past the double-enter, then I understand.

I think there was some work to fix that, I'll check up on it. Thanks for the reminder

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

#107

I have `,fv` running `nvim $(fzf)` and it's actually a little annoying because afterwards I can't find the filename that I had open. I wish there were some way to expand it into my history.

You can: Help for bash 'history -s args': The args are added to the end of the history list as a single entry

Thank you. I must find the equivalent zsh command.

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

#108
I recently setup something simple, but I've been falling in love with it - `goto`. Not as in the funny programming thing, with the even funnier `comefrom` variant in intercal, but as a simple shell script.

My issue is that at work, I tend to work with a lot of projects and repos, and I work a whole lot in a couple repos. And honestly, even if its short, typing `cd ~/Pro/an/main_` becomes old after 2000 times or more. And then there are ~80 - 90 repos in ~/Projects/terraform, and a couple dozen legacy repos in ~/Projects/chef, a dozen different config repos in ~/Projects/config, an automatically rotating scratchpad in ~/Stuff, ... I don't know if it's a messy workstation, or I'm just dealing with a boatload of stuff.

That's why I wrote goto. goto works in 2ish phases. The first phase just uses fzf -1 to give me a selection of the broad strokes I tend to navigate to. In case there is a prettier way to make fzf give me a static list of choices, let me know. It's basically:

    DESTINATION=$( echo "ansible\nterraform\nchef\nconfigs\n..." | fzf -1 "$1" )
This way I can either launch goto to get a list of 6-7 things I can select with arrows, by typing, or I can just be like `goto tf` and it directly selects `terraform`.

After that, it's a big switch-case selecting where to `cd` to, as well as possibly doing some normal init things. `ansible` as a destination for example just CDs and that's it.

`terraform` on the other hand does a bit more:

    case terraform)
        DESTINATION2=$( ls ~/Projects/terraform | fzf -1 "$2" )
        cd "$DESTINATION2"
        git pull --rebase
        # more stuff
    ;;
This way I can either say `goto`, select `terraform`, select a project and get moved there. Or I go `goto terraform` and type `prj2 foo` and usually fzf gives me the right thing, or I can be like `goto tf 'p2 fo'` and it drops me into the right place. Or something like `goto config infra-logaggregation` (or rather, `goto c ilg`). Or `goto stuff ticket-id` to get into some older scratchpad.

I'll just have to consider if I want to stick with ohmyzshs alias of g == git, which I don't really use much. Then I could achieve the entirely readable `g c ilg` to go where I need to, hah.

All of this is then wrapped into an alias, which basically aliases `goto` to be `source ~/goto`.

IDK, thanks for listening to my TED-talk on how to use fzf to juggle way too many hats at once. It's just saved me a lot of keystrokes getting around and mashing incomprehensible spells into the shell so coworkers are confused is always fun.

Post reply on HN