#471·zoxide

Can't setup completions on ZSH

Author: deluccaCreated Oct 21, 2022Updated Jun 2, 2026

Hey everyone

I'm trying to setup completions on ZSH but not being able to do so. My cdi command works properly (if I type cdi and then Enter if opens a FZF selector as expected), but for some reason the completions are not working.

Here is my ~/.zshrc file: https://pastebin.com/4GM136Tf

Here is what I've already discovered:

  • Even if I use the approach suggested on the readme (rm ~/.zcompdump*; compinit) it doesn't work
  • When I type cd <tab> it opens a FZF selector containing only directories inside my current pwd. This happens because of the plugin "Aloxaf/fzf-tab". Even if I remove it it doesn't work
  • I've already tried to remove everything from my zshrc file, leaving only loading the compinit and the eval from zoxide. It doesn't work. The only thing that changes is that now when I press tab after cd it appears the common tab selection from zsh (without FZF)
  • Here is the output from $_comps[cd]: __zoxide_z_complete
  • If I run __zoxide_z_complete directly from my terminal it opens the FZF selector as expected (that was supposed to be opened when I press tab
  • I tried to change the completion for a different tool. What I did was setting $_comps[zi] = _zoxide_z_complete (zi is my plugin manager). When I do this and I try to open the completion for zi it opens the completion for cd . So, it seems that the problem is indeed related to __zoxide_z_complete, but only when it is attached as completion for some reason

What should I do?