2

The zshcompsys man-page says:

INITIALIZATION

If the system was installed completely, it should be enough to call the shell function compinit from your initialization file; see the next section. However, the function compinstall can be run by a user to configure various aspects of the completion system.

zsh can't find the commands though:

genesis% compinit
zsh: command not found: compinit
genesis% compinstall
zsh: command not found: compinstall
genesis% echo $PATH
/home/ravi/bin:/home/ravi/.gem/ruby/2.4.0/bin:/home/ravi/bin:/home/ravi/.gem/ruby/2.4.0/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/local/heroku/bin:/home/ravi/.cabal/bin:/home/ravi/.local/share/fzf/bin:/usr/local/heroku/bin:/home/ravi/.cabal/bin
genesis%

I'm lead to ask this question because when starting zsh I get:

tmuxinator.zsh:20: command not found: compdef

How do I get zsh to find these completion commands?

6

This is the same issue I got on my mac. I am using zsh shell.

Zsh Compdef error

Compdef is basically a function used by zsh for load the auto-completions. The completion system needs to be activated. If you’re using something like oh-my-zsh then this is already taken care of, otherwise you’ll need to add the following to your ~/.zshrc

autoload -Uz compinit
compinit

Completion functions can be registered manually by using the compdef function directly like this compdef . But compinit need to be autoloaded in context before using compdef.

6

Answer to the question as asked

Access these commands by running:

$ autoload -Uz compinstall && compinstall

It will load a guided wizard, I quit as soon as I had the option to Save and exit.

Then reload the shell:

$ exec zsh

More general answer

It appears that the new user configuration was not run.

Run it by:

$ autoload -Uz zsh-newuser-install && zsh-newuser-install -f

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.