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

[Feature Request] Exclude current directory from candidates #139

Closed
0xC0FFEE opened this issue Jan 9, 2021 · 1 comment · Fixed by #173
Closed

[Feature Request] Exclude current directory from candidates #139

0xC0FFEE opened this issue Jan 9, 2021 · 1 comment · Fixed by #173

Comments

@0xC0FFEE
Copy link

0xC0FFEE commented Jan 9, 2021

Thanks for writing this plugin!

Often the following situation happens to me: I want to switch to the folder foo, so I run z foo. However I realize that I'm in the wrong folder (cded into /a/foo, however I wanted to go to /b/foo). In z.lua I could re-run z foo and the current working directory would be excluded from the candidates, so I'd navigate to /b/foo. In zoxide this is not the case, so re-running z foo is basically a nop. Instead I've to run zi foo and select the correct folder.

FWICT there should be no use-case to cd into the current working directory again, so changing this behavior to cd into the next best match should not break any existing use-cases.

@ajeetdsouza
Copy link
Owner

Agreed, this should be default behaviour. If a user wants to cd into the same directory (for example, I sometimes need to do this when the directory I'm in has been deleted and recreated by a testing script), they can just use z ..

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

Successfully merging a pull request may close this issue.

2 participants