asdf: Error when loading completions in zsh

complete:13: command not found: compdef

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 1
  • Comments: 19 (6 by maintainers)

Most upvoted comments

I was having the same problem with oh-my-zsh and the issue was that I was sourcing first the asdf completion ant then the oh-my-zsh.sh file, just changing the order like this solved the problem for me

source $ZSH/oh-my-zsh.sh                                                                                                                                                                                                                                                    
source $HOME/.asdf/asdf.sh                                                                                                                                                                                                                                                  
source $HOME/.asdf/completions/asdf.bash 

@alexlafroscia

which _asdf seems to work fine, but hitting <TAB> still doesn’t do anything

@cLupus

If I run the same command after .zshrc have run, then if works, but when starting a new shell it does not.

I have the same problem. It only works if I source it manually in an active shell window.

Were you able to solve this?

I had the same problem a weeks ago. Moving autocompletion load code to .zshrc solved my issue.

Hope it helps 😃

Add the following to ~/.zshrc

for config_file ($HOME/.asdf/asdf.sh) source $config_file