zsh-z: Don't z into subdirectories
Assume I have a directory structure like:
/foo
/foo/bar
/foo/baz
/foobar
/foo
is my main folder from which I cd into bar
and baz
on a regular basis. When I run z foo
, it will now jump me to /foo/bar
since it is the folder I currently use the most. But I find this counter-intuitive and would prefer to land in /foo
.
A solution to this is to only match the actual directory’s name, ignoring all of the parent directories.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 35 (21 by maintainers)
@piegamesde @peterjuras I’m happy enough with how the new, alternate behavior works that I’ve merged it onto the
master
branch, so you may go back to using that, but be sure to setZSHZ_UNCOMMON=1
in your.zshrc
to make it kick in.Thanks very much, both of you, for helping to improve ZSH-z.
I’m still working on this – I haven’t forgotten. Be well.
Yes, I see what you mean. I’ll work on this for a few days and see what I can come up with.
Honestly, I don’t really care if
/foo
is chosen over/home/me/foo
or not. My problem is that – following your example – I typez foo
and end up in/home/me/foo/a
(because I use that folder really often).