zoxide
zoxide copied to clipboard
smart autocomplete from zsh
Context
I tried using zoxide as replacament for cd using init --cmd cd
and I found a few differences that are annoying after a few years of using the default zsh cd syntax.
Imagine I have the following directories:
xp-foo-bar
xp-infra-charts
xp-infra-drone
xp-infra-terraform
xp-tf-infra-ips
xp-something-else
In zsh cd, if I type infra
and hit tab
, it will autocomplete the common part, which is -infra-
(but it's not as useful) but if I hit tab again, it will show the options (and let me navigate it) only for the matching part.
I think it goes kind of hand in hand of what zoxide proposes for smart navigation, as sometimes I have too many directories and I only remember part of the name.
In this case I was just using zoxide to start populating some data/directories into database, but the navigation of unknown directories to zoxide become poorer.
Another example would be "cd something<TAB>", it would check that there's only 1 matching something
and autocomplete, on tab, the whole directory for me.
Expectations
cd infra<TAB>
would list all the directories in the current level matching infra on its name
cd something<TAB>
would autofill xp-something-else
for me.
Actual Results
cd infra<TAB>
do nothing
cd something<TAB>
do nothing
Notes
I tried the compinit
as mentioned on several issues:
- compinit before
- compinit after
- autoload compinit
Nothing helped.
Versions
zsh 5.9 (x86_64-apple-darwin23.0) zoxide 0.9.4 fzf 0.43.0 (brew) omz master (15ffbdd) macOS 14.3.1 23D60 arm64
Seems related to https://github.com/ajeetdsouza/zoxide/issues/712
seeing the same behavior. I use the substring matching from zsh completion pretty heavily so its a shame this doesn't work in zoxide
.
@ajeetdsouza is it expected that zoxide
can't autocomplete substrings after pressing tab like the base cd
command? or is this just a misconfiguration on our part? would love if zoxide
could just inherit all completion zstyles that cd
uses