zoxide icon indicating copy to clipboard operation
zoxide copied to clipboard

unable to use autocompletion with z

Open SamDc73 opened this issue 3 years ago • 4 comments

the auto completeion is invoked form the cd command not form the z database/directories

for example when i'm on the home directory z tab should show me directories from the zioxide database, but instead it is showing me the home directories .

I'm using zsh on fedora 35: zsh 5.8.1 (x86_64-redhat-linux-gnu) zoxide v0.8.0 fzf 0.29.0 (Fedora)

my zsh plugins :

fzf-tab
zsh-syntax-highlighting
zsh-history-substring-search.plugin
sudo
dirhistory
fzf-marks.plugin
cheat
colored-man-pages.plugin
qoutes
fancy-ctrl-z

SamDc73 avatar Apr 25 '22 16:04 SamDc73

To clarify -- are you loading zoxide at the end of your .zshrc file? And are you calling compinit before that?

The following two lines should be at the end of your .zshrc:

autoload -Uz compinit && compinit
eval "$(zoxide init zsh)"

ajeetdsouza avatar Apr 26 '22 15:04 ajeetdsouza

To clarify -- are you loading zoxide at the end of your .zshrc file? And are you calling compinit before that?

The following two lines should be at the end of your .zshrc:

autoload -Uz compinit && compinit
eval "$(zoxide init zsh)"

i tried what you said with no luck :(

ghost avatar Apr 28 '22 02:04 ghost

I notice the same symptoms (Zoxide’s tab completion in Zsh is no longer working) after upgrading Zoxide from 0.7.9 to 0.8.1.

eigengrau avatar May 22 '22 19:05 eigengrau

I couldn't make it work, so i switched to z.lua , hope this problem will be fixed soon

ghost avatar May 24 '22 17:05 ghost

I am seeing the same problem: z <Tab> behaves like cd <Tab>, counterintuitively, rather than outputting the list of zoxide matches (namely the most navigated directories, more or less).

gennaro-tedesco avatar Aug 20 '22 02:08 gennaro-tedesco

That's because z also functions as a cd command. @SamDc73 I'm just reading your issue again and it appears to be the same thing, so I'm just clarifying this here:

  • z <tab> should show cd completions.
  • z foo<tab> should also show cd completions.
  • z foo<space><tab> should show zoxide's completions.

The reason the completion system works this way is so that you can use z to enter local directories as well as directories anywhere on your filesystem. The README contains a GIF of this.

ajeetdsouza avatar Aug 20 '22 04:08 ajeetdsouza

Thank you for clarifying: you are right, it makes sense. So the actual zoxide completion is triggered with z foo<space><tab>:)!

gennaro-tedesco avatar Aug 20 '22 09:08 gennaro-tedesco

Closing since @SamDc73 seems to have had the same problem. Do let me know if this is not the case.

ajeetdsouza avatar Aug 20 '22 09:08 ajeetdsouza