Live data from Hacker News

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

andrew-quinn.me

61–70 of 292 posts

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

#61
post #50

I’ve never used fzf before and live in a shell all day, but the capabilities shown in the article doesn’t seem very useful to me. Am I missing something? For Ctrl+R, how many times are people running similar variants of commands that they 1) don’t know what they typed and 2) didn’t think to simplify their workflow to not be running duplicated commands? For Alt+C, are peoples’ file and directory layouts such a mess th…

> For Alt+C, are peoples’ file and directory layouts such a mess that they need to search entire directory trees to find what they’re looking for?

Have you ever joined a new project? Usually they're both messy and you don't know where anything is.

Besides, even now with plenty of familiarity in my current legacy code base I can use fzf to type filenames or directories without typing the full path.

Ctrl+R is great for those repeat commands in your shell history that you want to use right now but don't want to add to your .bashrc, like repeatedly running a script with some arguments. I think the value of searching your history is self evident.

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

#62

Fantastic article. I was exactly in the situation the article describes, I installed it, then, didn't find a use case. But that's because Ubuntu doesn't come with completion enabled by default. You have to add in your bashrc: if [ -e /usr/share/doc/fzf/examples/key-bindings.bash ]; then source /usr/share/doc/fzf/examples/key-bindings.bash fi The fzf and ubuntu docs don't mention you have to. Couldn't find easily how…

Thanks fore sharing. I was also lost reading this article, because I installed with apt (Debian). After searching for "fzf + Ctrl+R" I found about the keybindings part.

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

#63

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?

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

#64
post #50

I’ve never used fzf before and live in a shell all day, but the capabilities shown in the article doesn’t seem very useful to me. Am I missing something? For Ctrl+R, how many times are people running similar variants of commands that they 1) don’t know what they typed and 2) didn’t think to simplify their workflow to not be running duplicated commands? For Alt+C, are peoples’ file and directory layouts such a mess th…

For Ctrl+R, suppose you ran 'curl' against a bunch of API endpoints on a single domain name 2 months ago. I can now easily find one without knowing too much detail by fuzzy searching curl+part_of_domain_name+part_of_path.

For Alt+C, yes files and directories are often a huge mess. It may be no fault of your own. Maybe you're working with a giant legacy codebase or digging into node_modules. Now you can type 'vim Alt+C', to find and immediately open whatever you're looking for.

Of course this can all be done other ways, but it's very convenient and very fast when paired with ripgrep especially.

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

#65
post #50

I’ve never used fzf before and live in a shell all day, but the capabilities shown in the article doesn’t seem very useful to me. Am I missing something? For Ctrl+R, how many times are people running similar variants of commands that they 1) don’t know what they typed and 2) didn’t think to simplify their workflow to not be running duplicated commands? For Alt+C, are peoples’ file and directory layouts such a mess th…

I use Ctrl+R profusely. I don't like hitting up to cycle through recent commands.

Also sometimes I want to run something I haven't run in several days.

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

#66
post #61
post #50

I’ve never used fzf before and live in a shell all day, but the capabilities shown in the article doesn’t seem very useful to me. Am I missing something? For Ctrl+R, how many times are people running similar variants of commands that they 1) don’t know what they typed and 2) didn’t think to simplify their workflow to not be running duplicated commands? For Alt+C, are peoples’ file and directory layouts such a mess th…

> For Alt+C, are peoples’ file and directory layouts such a mess that they need to search entire directory trees to find what they’re looking for? Have you ever joined a new project? Usually they're both messy and you don't know where anything is. Besides, even now with plenty of familiarity in my current legacy code base I can use fzf to type filenames or directories without typing the full path. Ctrl+R is great for…

>Have you ever joined a new project?

Shouldn't your new team members work to help onboard you instead? Shouldn't you get ample training in your job?

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

#69
post #38

Earlier quoted context omitted.

The default install script asks if you want to install key bindings and adds that to your bashrc. How did you install fzf?

apt install? There's no way I'm integrating a core tool like that with a crude "curl | zsh" hack. How and when would it get updated? Am I expected to stick that in an Ansible playbook?

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?
Post reply on HN