Live data from Hacker News

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

andrew-quinn.me

151–160 of 292 posts

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

#151
I wrote a couple of shell tools based on fzf:

https://github.com/vapniks/fzfrepl: Edit commands/pipelines with fzf, and view live output while editing. There's a cool example using ffmpeg, graph2dot & graph-easy for displaying ffmpeg filter graphs.

https://github.com/vapniks/fzf-tool-launcher: Browse & preview contents of files, and launch tools/pipelines to process selected files. You can use fzfrepl in sequence to process each part of a dataprocessing pipeline with different tools.

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

#152

I have ctrl-r and alt-c assigned to macro keys on my keyboard, they're so danged useful. Something else you can try in your `~/.gitconfig` [alias] fza = "!git ls-files -m -o --exclude-standard | fzf -m --print0 | xargs -0 git add" git fza will quickly let you add files if you've changed a lot. I alias `git fza` to `ga` and it gets used a lot Oh, and another useful shortcut is this: export FZF_CTRL_T_COMMAND="mdfind -…

I'm not super familiar with spotlight/mdfind. What are the benefits it offers over using the default `find` command with fzf?

`find` has to traverse the filesystem, which is pretty slow. `mdfind` looks up in an indexed database, which is very fast.

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

#153

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.

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

#154

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.

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.

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

#155

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…

I sometime use a #a-text-comment at the end of long/complex command line incantation. Easy to find using fzf at a later date. Also can provide you with a quick context.

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

#156
post #152

Earlier quoted context omitted.

I'm not super familiar with spotlight/mdfind. What are the benefits it offers over using the default `find` command with fzf?

`find` has to traverse the filesystem, which is pretty slow. `mdfind` looks up in an indexed database, which is very fast.

Good to know! Thanks

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

#157

I also like a Ctrl+T for finding a file in the current directory. For example: bundle exec rspec

i use it a lot but want an accompanying binding just for directories

edit: okay done

http://i.imgur.com/n12DYUu.png

Two examples in case you have a preference w/ or w/o the preview:

    fzf_insert_directory_preview() {
      local dir
      dir=$(find . -type d -not -path '*/\.*' | fzf --height 40% --reverse --preview 'tree -C {} | head -200')
      if [[ -n $dir ]]; then
        READLINE_LINE="${READLINE_LINE}${dir}"
        READLINE_POINT=$((${#READLINE_LINE}))
      fi
    }

    fzf_insert_directory() {
      local dir
      dir=$(find . -type d -not -path '*/\.*' | fzf --height 40% --reverse)
      if [[ -n $dir ]]; then
        READLINE_LINE="${READLINE_LINE}${dir}"
        READLINE_POINT=$((${#READLINE_LINE}))
      fi
    }

    bind -x '"\ey": fzf_insert_directory_preview' # alt-y
    bind -x '"\et": fzf_insert_directory' # alt-t
http://ix.io/4rtn/sh

Sent from a LLM

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

#158

Earlier quoted context omitted.

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…

I sometime use a #a-text-comment at the end of long/complex command line incantation. Easy to find using fzf at a later date. Also can provide you with a quick context.

So scrappy and simple-I love it!

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

#159

Earlier quoted context omitted.

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

How would you compare this to, say, McFly? https://github.com/cantino/mcfly

Intrigued by local-directory-first feature of McFly (It brings up commands you previously executed in that folder first). I tried it for a bit. But there was noticeable lag compared to FZF and also the UI was a bit shaky.

Went back to FZF (in Zsh).

I have a seven year zsh history. That may be a contributing factor for the issues ?

Post reply on HN