Live data from Hacker News

Fzf – the basics part 1 – layout

qmacro.org

21–30 of 40 posts

Re: Fzf – the basics part 1 – layout

#21
plocate is a very fast mlocate alternative that uses indexes over trigrams and io_uring for reading the database. With fzf you can have a pretty fast fuzzy search over your entire indexed disk.

    FZF_DEFAULT_COMMAND="plocate ''" \
    fzf --bind "change:reload:plocate {q} || true" \
        --ansi --phony --query "" --preview 'file {}' --bind '?:preview:cat {}'

https://plocate.sesse.net/

I don't actually use it. It's more a fun hack.

Re: Fzf – the basics part 1 – layout

#22
post #14

My favorite ~/.gitconfig [alias] that uses fzf: # Allows you to easily pick what to rebase frbi = "!f() { git rebase -i $(git log --pretty=oneline --color=always | fzf --ansi | cut -d ' ' -f1)^ ; }; f" Then just do: git frbi

love this, shows how simple fzf is to use as well. just gives us a nice way to pick out a line from git log. Beautiful.

Re: Fzf – the basics part 1 – layout

#23
post #2

fzy[1] is a less bloated alternative, written in C. fzf is neat, but it does too much. [1]: https://github.com/jhawthorn/fzy

fzf never struck me as the slightest bit slow. What am I doing wrong? You can configure it with an external previewer that can of cause be arbitrarily slow or bloated but you can hardly fault fzf for that.

Re: Fzf – the basics part 1 – layout

#25
post #14

My favorite ~/.gitconfig [alias] that uses fzf: # Allows you to easily pick what to rebase frbi = "!f() { git rebase -i $(git log --pretty=oneline --color=always | fzf --ansi | cut -d ' ' -f1)^ ; }; f" Then just do: git frbi

Same! I use it for switching between branches:

    sw = !git checkout $(git branch -a --format '%(refname:short)' | sed 's~origin/~~' | sort | uniq | fzf)
Just type `git sw` and fzfuzzy type the branch name you want to go to.

Re: Fzf – the basics part 1 – layout

#28
post #27

Personally, I'm a fan of using fzf with tmux 3.2+ so I get popup windows instead. They're great.

Can you elaborate on that? I use fzf with tmux as well, but I'm not sure what you mean by popup windows. Similar to vim splits?

See https://github.com/junegunn/fzf/pull/1946

Re: Fzf – the basics part 1 – layout

#29
I love fzf as well. I use it with the npm package manager to select the script to run (we have an app with 20+ scripts):

    npmrf () {
        local script
        script=$(cat package.json | jq -r '.scripts | keys[] ' | sort | fzf)  && npm run $script
    }
Another usecase is tracking hours with Clockify. I was frustrated opening up the web everytime, so I wrote a script using fzf, httpie and jq. Love it now. [1]

[1]: https://marcel.is/tracking-hours/

Re: Fzf – the basics part 1 – layout

#30

plocate is a very fast mlocate alternative that uses indexes over trigrams and io_uring for reading the database. With fzf you can have a pretty fast fuzzy search over your entire indexed disk. FZF_DEFAULT_COMMAND="plocate ''" \ fzf --bind "change:reload:plocate {q} || true" \ --ansi --phony --query "" --preview 'file {}' --bind '?:preview:cat {}' https://plocate.sesse.net/ I don't actually use it. It's more a fun ha…

thanks for this, I just replaced my mlocate. absolutely unreal. seems io_uring makes all the difference.
Post reply on HN