Remix.run Logo
bjackman 4 days ago

Does anyone know if zoxide has any fancy logic to ignore strings that appear in common prefixes?

For example I have a big ~/src dir where I keep all my code checkouts. If I type 'z src' intending to go to ~/src/foo/bar/src, will it be clever enough to realise that I am referring to the second instance of the string 'src'?

I currently use a Fish port of the original 'z'. It does ignore the common prefix of _all_ matches (so if I only ever used it within my ~/src tree, the problem would disappear) but after that binary exclusion it works exclusively on frecency.

neobrain 4 days ago | parent | next [-]

Adding to the other answer: You can also pass multiple keywords to zoxide and they are expected to match in order. So in your example, `z foo src` would reliably cd into `~src/foo/bar/src` even if `src/foo` has a higher visit frequency.

bjackman 4 days ago | parent [-]

Ok what about when I have this

~/src/linux/linux

~/src/linux/stable

And I want to go to the first one? It doesn't have a unique sequence of keywords in it :/

Unless it recognises that if I type "z lin lin" I want the one where it appears twice?

I'm beginning to think my directory structure might just be toxic haha

neobrain 4 days ago | parent | next [-]

You can think of it as replacing the space between words as wildcards, so `z lin lin` would indeed work to select the first one!

rkomorn 4 days ago | parent | prev | next [-]

> I'm beginning to think my directory structure might just be toxic haha

Some tools have a hard time solving some problems when the problem is us.

I_complete_me 3 days ago | parent | prev | next [-]

Here's an idea that might work for you. Rename ~/src/linux_/ or something like that.

styluss 3 days ago | parent | prev [-]

lacy https://crates.io/crates/lacy might be what you want

ShinTakuya 4 days ago | parent | prev [-]

As far as I'm aware it keeps a history of the frequency you visit each directory so yes it will select the one you've visited more often (assuming you don't always start at the base one and work your way down).

bjackman 4 days ago | parent [-]

No the issue is that the one I want _isnt_ the most recent. Because 90% of the directories I visit contain the string 'src'