ajeetdsouza / zoxide

A smarter cd command. Supports all major shells.
MIT License
20.29k stars 518 forks source link

Ability to disable cd-like behavior #852

Closed rcorre closed 17 hours ago

rcorre commented 1 week ago

I asked about this in a discussion a while back:

If I type z foo and there is a local directory named "foo", it will cd to that local directory, even if there is a directory named "foo" in the database with a higher weight. Is there a way to disable this behavior, and have z always select an entry from the database?

It seems like there's not a way to disable this by default. Would that be a reasonable option? I don't use z as cd, I specifically use z when I want to get to somewhere not in the current directory.

jonasreiher commented 3 days ago

A workaround is z / foo. This restricts your search to the database and / just includes everything there.

rcorre commented 2 days ago

Thanks! alias z='z /' does seem to make it work as I'd like.

ajeetdsouza commented 17 hours ago

Yup, that's the way to go here.