-
I use many different apps that ship with their shell completions file for zsh. I just wanted to ask where exactly should i place all these files. If i am not mistaken it goes in the fpath directory which in my case is - |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Wait - don't manually move files. That's not how The way Zsh's # contents of ${ZDOTDIR:-$HOME}/.zsh_plugins.txt
# regular plugins get added to fpath automatically, in addition to being sourced
zsh-users/zsh-autosuggestions
# you can also use the fpath annotation to add locations to your fpath
zsh-users/zsh-completions kind:fpath path:src
# if you have a local folder with completions, you can add that too
/path/to/my/zsh/completions kind:fpath
# oh-my-zsh plugins get complicated because they often call functions that don't
# actually exist until after compinit is called. It's a chicken-and-egg issue. You
# need the plugin in fpath, but not sourced until after compinit.
# OMZ plugin you won't actually source until later
ohmyzsh/ohmyzsh path:plugins/rails kind:fpath
# now use a compinit plugin
belak/zsh-utils path:completion
# finally, load any plugins that required compinit to already exist
ohmyzsh/ohmyzsh path:plugins/rails See: |
Beta Was this translation helpful? Give feedback.
Wait - don't manually move files. That's not how
fpath
works. You don't drop files in a specialfpath
location - instead, you modify thefpath
array and add the directories you need. And antidote can do that for you with thekind:fpath
notation.The way Zsh's
compinit
completions work is yourfpath
array has to be fully built prior to runningcompinit
. That's not an antidote thing, just how Zsh works. So, with that in mind, you want to load your plugins prior to runningcompinit
where possible.