Remix.run Logo
BeetleB 3 days ago

If I'm reading this correctly, this will pass all subdirectories to fzf, which is very different from only directories you've visited.

jvanderbot 3 days ago | parent [-]

The premise is the same: Dump history into fzf and add a grep/awk.

My point was that requiring a new shell (or even history) is a limiting factor here, and either backwards search over commands (as suggested ITT), or just plan fzf directory changes are more functional and already integrated into bash.

robenkleene 3 days ago | parent [-]

`cd foo` is useless in history if you're not already in foo's parent directory. This is the problem Zoxide solves, `z foo` will still do something useful in that case. (Side note about fzf, recursively fuzzy finding subdirectories fine for some use cases, but it doesn't scale as well as Zoxide.)

jvanderbot 3 days ago | parent [-]

Yes, the marginal improvements from changing your entire shell are not to be disregarded. I'll change to asserting that it's entirely possible to do a nice 80/20 without changing shells.

robenkleene 3 days ago | parent [-]

What do you mean? Zoxide isn't a shell, it's just a CLI program. It doesn't involve changing shells, you can see the list of supported shells in the README (it's more comparable to fzf than a shell, it ships with optional shell integrations the same way fzf does).

jvanderbot 3 days ago | parent [-]

How did you get all the way down here and lose the fact that top level comment is about zsh and finding past commands, and also changing directories? Was it not you that brought up zsh?

And I that brought up bash examples to show how it might be done? We've gone around in circles lads back on the bus.

robenkleene 3 days ago | parent | next [-]

To me, the interesting conversation here is between these three workflows:

1. Recursive directory fuzzy-search

2. Searching history for `cd` commands

3. Zoxide-style matching visited directories

Which are all ways to make it easier to traverse directories.

For my part, the thrust of your argument seemed to be advocating for #1, so that's what I was responding to (since this is a thread on #3, I'm mainly focusing on why you'd use that instead of #1 or #2, but all three are workable).

All of these can be implemented in any of the common shells. I didn't see anyone making a case for a specific shell here, I think the mentions of a specific shell are incidental (e.g., what people happen to use).

BeetleB 2 days ago | parent [-]

Indeed - it's not even an either/or. I have both 1 and 3 as keybindings.

BeetleB 3 days ago | parent | prev [-]

He never said he changed shells - just that he uses zsh history. He was likely using zsh anyway.

jvanderbot 3 days ago | parent [-]

My logic (take it or leave it) is that since zsh is not the default distro nearly anywhere (Kali?), a randomly selected person who might read that advice (and subsequent advice ITT), would likely find "Use ZSH" includes a shell change and therefore more learning curve than "add a few lines to .bashrc".

This is getting off topic, pedantic, and (maybe?) argumentative so I'm calling it quits. Cheers.

BeetleB 3 days ago | parent [-]

I believe the default shell in MacOS is zsh, not bash. So lots of folks use zsh by default.