mattmc3 / antidote

https://getantidote.github.io - the cure to slow zsh plugin management
MIT License
855 stars 21 forks source link

Local completion not working for asdf (as a newbie) #182

Closed gsevla closed 3 months ago

gsevla commented 4 months ago

Hey fellows!

I'm new in this zsh plugin manager thing so it can be just a misunderstanding from my part, but I'm just trying to source it and add completions to fpath as documented here: https://asdf-vm.com/guide/getting-started.html#:~:text=Add%20the%20following%20to%20~/.zshrc,see%20ohmyzsh/ohmyzsh%238837.

So I'm using it in my zsh_plugins.txt:

/home/MY_USER/.asdf kind:zsh
/home/MY_USER/.asdf path:completions kind:fpath
mattmc3/zephyr path:plugins/completion

asdf is sourced for sure because I can use it, but completion is simply not working and I can't figure out why... what am I doing wrong?

For now I'm avoiding envsubst just for sanity reasons, so consider MY_USER as my username...

gsevla commented 4 months ago

So... I have moved mattmc3/zephyr path:plugins/completion to the end of the file and now it works. I would like to know why if someone can explain to me.

My .zsh_plugins.txt:

### Sourcing
/home/MY_USER/.asdf kind:zsh

### Completion
/home/MY_USER/.asdf path:completions kind:fpath
#mattmc3/zephyr path:plugins/completion <<<< it was here

### Prompt
sindresorhus/pure

### Framework
belak/zsh-utils path:history
belak/zsh-utils path:utility
belak/zsh-utils path:editor

### Final Plugins
mattmc3/zephyr path:plugins/completion <<<< now I moved it to here
zsh-users/zsh-autosuggestions
zsh-users/zsh-history-substring-search

I'm doing everything based on example file by the way.

mattmc3 commented 3 months ago

There's a section in the docs that goes over this: https://getantidote.github.io/completions

Essentially, whenever compinit is run, whatever completions paths your fpath variable contains is locked-in. If you add completions later, you've already run compinit and they don't get picked up. Depending on which completions plugin you use, you will likely need to load it towards the end of your config.

These popular ones do it that way: