Closed tekumara closed 4 years ago
Hey @tekumara,
zoxide always ensures that the last keyword in a query matches the actual directory name, so /home/foo
can be matched with:
h foo
home f
home foo
foo
f o o
/foo
home/f
However, by design, it will not match:
home
home/
/home
IMO, requiring (part of) the name of the directory at the end drastically improves the quality of the results. Usually, if I've forgotten the name of the directory, I just use zi
to find it.
Is there a reason you would want zoxide to match on parent directories?
Even if different from rupa/z that seems fair and workable! It’s probably only really a difference for the first time I’d want to traverse up to a parent. cd
will suffice 😀 It’s a small adjustment on my part and understanding the logic helps. I might have missed the explanation in the doco.
That's alright, do let me know if you think the README could have been clearer!
Btw, you can use zoxide exactly like cd! The following commands would be completely valid and would not even need to access the database:
z
(navigate to home directory)z ..
(navigate to parent directory)z ../..
(navigate two levels up)z -
(navigate to previous directory)z .
(navigate to current directory, which does nothing)More examples - all of the following navigate to /home
:
z /home
z /
followed by z home
z /
followed by z ./home
I'm closing this issue, but feel free to re-open it if you have more questions!
zoxide doesn't match on parent directories, eg:
Whereas rupa/z will find a match when a parent directory matches: