mattmc3 / zephyr

:wind_face: A Zsh framework as nice as a cool summer breeze
MIT License
122 stars 13 forks source link

mattmc3/zephyr/plugins/completion/completion.plugin.zsh:56: command not found: run-compinit #18

Closed radiosilence closed 7 months ago

radiosilence commented 8 months ago

All of a sudden I'm getting errors on my terminal on initialisation.

It seems to be that on completion.plugin.zsh, if manual mode is not enabled it's calling a function called run-compinit.

In completion/plugins/run-compinit, the lines that wrap this in a function were commented out 7 months ago.

How is this supposed to work?

Thanks!

mattmc3 commented 8 months ago

Hey @radiosilence! Thanks for the bug report. I use Zephyr as my daily driver, and I've not seen any issues like that recently. The commented # function run-compinit { might seem weird, but its normal for autoload functions, which don't require a function definition - the name of the file serves as the definition.

You wouldn't happen to have your dotfiles published somewhere, would you? If not, can you post the actual errors you're getting?

One thing to check - make sure you clear any completion cache you have with this command so you can start fresh:

setopt extended_glob
rm -ri ${XDG_CACHE_HOME:-$HOME/.cache}/{zephyr,zsh}/zcompdump*(N)
RobertBeilich commented 8 months ago

I'm currently in the process of rebuilding my config and stumbled upon a similar error. Had not all of my setops in yet, to reevaluate them, but zephyr requires setop extended_glob to be set.

Minimal non-working example: .zshrc

export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache"
export ZDOTDIR="$XDG_CONFIG_HOME/zsh"

if [[ ! -f ${XDG_DATA_HOME}/antidote/antidote.zsh ]]; then
  command git clone https://github.com/mattmc3/antidote.git "${XDG_DATA_HOME}/antidote"
fi

zsh_plugins=${ZDOTDIR}/.zsh_plugins
if [[ ! ${zsh_plugins}.zsh -nt ${zsh_plugins}.txt ]]; then
  (
    source "${XDG_DATA_HOME}/antidote/antidote.zsh"
    envsubst <${zsh_plugins}.txt | antidote bundle >|$zsh_plugins.zsh
  )
fi
source ${zsh_plugins}.zsh

.zsh_plugins.txt

mattmc3/zephyr path:plugins/completion

Enabling the extended_glob option (before sourcing antidote) fixes it.

mattmc3 commented 7 months ago

Thank you @RobertBeilich. Great find. I pushed a commit that adds extended_glob in the bootstrap.zsh file since it's a critical Zsh option required for most anything Zephyr does.