No completions from plugins #515
-
What happened?Hello, with zinit freshly installed and no changes to zinit ice as"command" from"gh-r" \
atclone"./starship init zsh > init.zsh; ./starship completions zsh > _starship" \
atpull"%atclone" src"init.zsh"
zinit light starship/starship I get completions while in that shell, but with a new shell, I get no completions. After installing a plugin with completions I get: Installed 1 completions. They are stored in the $INSTALLED_COMPS array. And running EDIT. It seems if I manually run Steps to reproduce
Relevant outputNo response Screenshots and recordingsNo response Operating System & VersionOS: linux-gnu | Vendor: ubuntu | Machine: x86_64 | CPU: x86_64 | Processor: x86_64 | Hardware: x86_64 Zsh versionzsh 5.9 (x86_64-ubuntu-linux-gnu) Terminal emulatortmux-256color If using WSL on Windows, which version of WSLNone Additional contextFull ### Added by Zinit's installer
if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then
print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f"
command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit"
command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \
print -P "%F{33} %F{34}Installation successful.%f%b" || \
print -P "%F{160} The clone has failed.%f%b"
fi
source "$HOME/.local/share/zinit/zinit.git/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
# Load a few important annexes, without Turbo
# (this is currently required for annexes)
zinit light-mode for \
zdharma-continuum/zinit-annex-as-monitor \
zdharma-continuum/zinit-annex-bin-gem-node \
zdharma-continuum/zinit-annex-patch-dl \
zdharma-continuum/zinit-annex-rust
### End of Zinit's installer chunk
# Load starship theme
# line 1: `starship` binary as command, from github release
# line 2: starship setup at clone(create init.zsh, completion)
# line 3: pull behavior same as clone, source init.zsh
zinit ice as"command" from"gh-r" \
atclone"./starship init zsh > init.zsh; ./starship completions zsh > _starship" \
atpull"%atclone" src"init.zsh"
zinit light starship/starship Code of Conduct
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
This is a configuration issue and not a bug. Furthermore, it isn't related to zinit either, but how to use Zsh. As you have observed, completions work when you run It calls the functions -x4 .zinit-compinit I've highlighted the code essential to the issue at hand. In the Zsh documentation for completion, here is what
The issue is you don't initialize the completion system in your I'd recommend using turbo mode. All you need to do is add the following snippet to the end of your zshrc. zi for \
atload"zicompinit; zicdreplay" \
blockf \
lucid \
wait \
@zsh-users/zsh-completions |
Beta Was this translation helpful? Give feedback.
@mustaqimM,
This is a configuration issue and not a bug. Furthermore, it isn't related to zinit either, but how to use Zsh.
As you have observed, completions work when you run
zinit compinit
. If we look at the code for thecompinit
command, it runs the following code:It calls the
.zinit-compinit
function, so let us look at what it does. To do this, you can use thefunctions
(it outputs a functions source code) command and run the following:I've highlighted the code essential to the issue at hand.
In the Zsh documentation for completion, here is what
compinit
does.