Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to disable cd-like behavior #852

Closed
rcorre opened this issue Jun 24, 2024 · 3 comments
Closed

Ability to disable cd-like behavior #852

rcorre opened this issue Jun 24, 2024 · 3 comments

Comments

@rcorre
Copy link

rcorre commented Jun 24, 2024

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
Copy link

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

@rcorre
Copy link
Author

rcorre commented Jul 2, 2024

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

@ajeetdsouza
Copy link
Owner

ajeetdsouza commented Jul 4, 2024

Yup, that's the way to go here. You can also alias z='__zoxide_z /' - __zoxide_z is the internal z command that is exposed for use cases exactly like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants