Skip to content

Zoxide completion doesn't work when relying only on Ez-Compinit #5

@mbeko

Description

@mbeko

I noticed that the following Zoxide completion stopped working when I started to use Ez-compinit:

cd foo<SPACE><TAB>  # show interactive completions

To activate Zoxide, I have this in my .zshrc:

eval "$(zoxide init zsh --cmd cd)"

Since I'm not very knowledgeable about Zsh completion, I asked AI, and it explained that this line in the Zoxide initialisation checks if the completion system is fully active:

[[ "${+functions[compdef]}" -ne 0 ]] && \compdef __zoxide_z_complete cd

Because Ez-compinit is holding the system in a deferred state, this checks fails, and the completion for cd isn't loaded.

It suggested to trigger Compinit after loading Antidote and before initialising Zoxide like this:

autoload -Uz compinit
compinit

Indeed, that solved the problem. If you think the analysis is correct, I suggest to mention this special case in the readme file. Right now, it says one can just load this plugin, and forget about calling Compinit. It's confusing for people without the necessary knowledge when this main premise fails.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions