zoxide icon indicating copy to clipboard operation
zoxide copied to clipboard

Support exact match of last component

Open markcho opened this issue 1 year ago • 2 comments

I've been a long time user of autojump but recently made the switch to zoxide.

One pain point I have right now is that I can't specify an exact match of the last component.

For example, I have the following directories:

~/somedir/foo
~/somedir/foo-bar
~/somedir/foo-baz
...

Where foo is a prefix to a lot of other dirs.

In autojump, I increased the weight of ~/somedir/foo so that j foo always resolve to this dir. But with zoxide, when calling z foo, the frecency algorithm will prefer other foo- dir if I've visited that more recently.

Would it be possible to support exact match of last component if / is specified like z foo/? Currently, this is used to cd foo/ if foo/ exists, otherwise it matches some other dir like ~/somedir/foo/subdir. It would be useful to have z foo/ match the last component exactly if cd foo/ is not a match.

markcho avatar Apr 20 '23 23:04 markcho

Agreed, this should be a feature. I'll work on this soon.

ajeetdsouza avatar Apr 21 '23 08:04 ajeetdsouza

As someone who often works on nix and nixpkgs, I would like that feature very much.

K900 avatar Apr 07 '24 15:04 K900