Live data from Hacker News

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

andrew-quinn.me

81–90 of 292 posts

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

#81
To show off the power of fzf, I should share my fzr ("fzf repl") script:

https://github.com/kbd/setup/blob/master/HOME/bin/fzr

Basically, prefix any jq command (or rg, or anything you can think of) with fzr and it'll give you an interactive interpreter for your query. People have written a number of dedicated jq interactive repls, but not much is needed beyond fzf.

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

#82
post #9

So I might aswell ask here: I want to search for a string using ripgrep, select one of the files from the result list using FZF and then open the selected file with VS code. > rg . | fzf How do I do this on windows (NOT Linux)?? *Note:* Assume I already have ripgrep, FZF & VS Code installed.

Use xonsh in Windows (seriously!)

https://xon.sh/

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

#83
post #9

So I might aswell ask here: I want to search for a string using ripgrep, select one of the files from the result list using FZF and then open the selected file with VS code. > rg . | fzf How do I do this on windows (NOT Linux)?? *Note:* Assume I already have ripgrep, FZF & VS Code installed.

You open Total Commander in that folder, press Alt+F7, put your string into the lower search box and press search. It will give you the list of matching files, with F3 available for quick preview; then you right click the file you need and choose "Open with VS Code" from the context menu. Sadly, you don't get the "context" (the content of actual matches) out of the box, you'll have to resort to double-tapping F3 whil…

I use orthodox file managers heavily (mc, FAR, etc). Your approach was my norm for over 20 years. However, fzf is the first tool I've found that far exceeds the file managers in speed of navigation.

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

#84

Thanks for this. I didn't know about the built-in-cd. For anyone on macOS trying to get Alt-C to work see https://github.com/junegunn/fzf/issues/164 .

If any other alacritty on macos users were looking for a workaround: https://github.com/alacritty/alacritty/issues/93#issuecommen...

Apparently an option_as_alt option should also be introduced in the next release.

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

#86
post #21

jump ( https://github.com/gsamokovarov/jump ) is something I use as I didn’t know about Alt-C. Highly recommended

I use autojump (very similar).

Now combine the two: autojump and fzf. Basically look at all the directories in the jump database and pass that to fzf (sorted by frequency). You'll be amazed at what an improvement that is. I've bound it to Alt-j on my shell. I use it a ton more than Alt-c.

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

#87
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…

Not often, and when that does happen a 'grep .histfile' seems more than adequate for finding these one off's.

Likewise, if you get your directory layout rationalized, good tab completion and disambiguation feels like all you would need.

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

#88
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…

fuzzy matching is honestly vastly superior to any sequential search, the few times where the match is incorrect still feels a better time investment as a user

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

#89
Interesting, I'm of the first kind, who uninstalled it quickly.

I use ctrl-r a lot, though I have no issue remembering exact portions of the commands, but that may just be me.

I'll give it another try.

In the same vein as ripgrep (rg), I recommand the author (and everybody else) to give fd-find (fd) a try as a replacement to find. It's much, much faster (multithreaded search), and has better defaults to use from the shell (doesn't complain about these permissions issues, and `fd abc` is equivalent to `find. -iname 'abc'`.

A few comments here mention it already, but I wanted to recommend it.

Post reply on HN