Closed KAGEYAM4 closed 7 months ago
This is intended behaviour, z
first acts as a cd
command and falls back to jumping to another directory.
You can work around this by deliberately not using the full directory name, e.g. z fo
.
This is intended behaviour,
z
first acts as acd
command and falls back to jumping to another directory.You can work around this by deliberately not using the full directory name, e.g.
z fo
.
Do you think the above scenario would be useful, consider this case -> when we type something on the command line and hit TAB
, then we are trying to auto-complete using what's present in current-directory -
z
then sr
then <TAB>
which triggers autocomplete and the final result z src/
, this indicates that user wants to cd into subdirectory because of explicit /
character.z src
and don't used <TAB>
then he knows what he wants to cd into is not in current-directory so it's not gonna autocomplete or is might be some other directory with same name could be in current directory but he explicitly dosen't hit <TAB>
so he wants to use autojump
feature of zeoxide
. I understand where you're coming from, but any "smart" feature that is based on heuristics can (by definition) never be perfect. While there will always be small use-cases that don't work as expected, it will work correctly most of the time.
I'd encourage you to try it for a few days and see if you get used to it. Otherwise, one can easily create a custom z
command without this behaviour. For example, on zsh:
eval "$(zoxide init zsh --no-cmd)"
function z() {
cd "$(zoxide query -- "$@")"
}
Thank you.
From the readme->
But if there is a directory named
foo
in current directory, it jumps to that instead ofhighest ranked directory matching foo