zoxide
zoxide copied to clipboard
Support exact match of last component
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.
Agreed, this should be a feature. I'll work on this soon.
As someone who often works on nix
and nixpkgs
, I would like that feature very much.