Closed mustaqimM closed 1 year ago
@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 the compinit
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 the functions
(it outputs a functions source code) command and run the following:
functions -x4 .zinit-compinit
I've highlighted the code essential to the issue at hand.
In the Zsh documentation for completion, here is what compinit
does.
This section describes the use of compinit to initialize completion for the current session when called directly; if you have run compinstall it will be called automatically from your .zshrc.
The issue is you don't initialize the completion system in your .zshrc
. See the completions
section in the README for this.
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
What happened?
Hello, with zinit freshly installed and no changes to
.zshrc
, I'm not getting any completions after runningexec zsh
or starting a new shell. If I install a plugin that has completions like starship by appending:I get completions while in that shell, but with a new shell, I get no completions.
After installing a plugin with completions I get:
And running
zinit completions
show that it's installed.EDIT. It seems if I manually run
zinit compinit
in a shell, then I get back completions.Steps to reproduce
TAB
Relevant output
No response
Screenshots and recordings
No response
Operating System & Version
OS: linux-gnu | Vendor: ubuntu | Machine: x86_64 | CPU: x86_64 | Processor: x86_64 | Hardware: x86_64
Zsh version
zsh 5.9 (x86_64-ubuntu-linux-gnu)
Terminal emulator
tmux-256color
If using WSL on Windows, which version of WSL
None
Additional context
Full
.zshrc
:Code of Conduct