mattmc3/antidote

Command not found: fast-theme

Praful opened this issue · 3 comments

This issue is probably caused by newness to zsh and antidote. Everything seems to be working fine with the three plugins I'm using (autosuggestion, autocomplete and fast-syntax-highlighting).

In my .zshrc file, I have a line

fast-theme forest

When I start a new session (in kitty), I get the following error:

.zshrc:66 command not found: fast-theme

This line is towards the end of my .zshrc, after antidote load.

Once the terminal session starts, I can run the same command (fast-theme ...) without any problems.

If I put the following line in .zshrc just before calling fast-theme, the command works:

source ~/.cache/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-zdharma-continuum-SLASH-fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh

I can see that fpath has ~/.cache/antidote/https-COLON--SLASH--SLASH-github.com-SLASH-zdharma-continuum-SLASH-fast-syntax-highlighting/ in it when .zshrc runs and after the terminal session is available.

Please can you explain why fast-theme command works in an interactive session but not in .zshrc unless I source the fast-syntax-highlighting.plugin.zsh file.

Should I be doing something else?

Thanks

Hey @Praful - thanks for using antidote and for your question. Do you have your dotfiles posted anywhere? I'm not sure I can tell what you have going on from just your description, but I'm interested in what you have in your .zsh_plugins.txt/.zsh_plugins.zsh. I've posted a working example config based on what you described here: https://github.com/getantidote/zdotdir/tree/demo-antidote-issue-100. Have a look and see if that helps you see something in your config that's different.

Screenshot 2023-02-02 at 1 59 36 PM

Thanks @mattmc3 for the quick response and the very helpful sample repo. Looking at that, I saw that I had put deferred in the .zsh_plugins.txt, which I guess deferred setting up the function I wanted! Removing the "defer" fixed the problem :)

I've uploaded my config to https://github.com/Praful/linux-mint.

I looked at your fuller setup when I was setting up antidote earlier today (linked from a reddit thread in which you commented about plugin managers), which I found quite detailed. My Linux knowledge isn't good enough to understand it fully yet but I'm slowly working through it.

Many thanks again.

I saw that I had put deferred in the .zsh_plugins.txt

Oh, yes - defer. I also defer my fast-syntax-highlighting in my own config, and I can see how this would be confusing, especially to a new user. What you are basically doing when you run kind:defer is telling your zsh session to not load that plugin now, but load it later after the rest of the config is done and the prompt is shown. But then you ran fast-theme in your .zshrc, which wasn't possible because you deferred loading fast-syntax-highlighting. Deferring can be awesome and make things seem faster, but it can also cause problems.

If you decide you want to go back to trying to defer, you can in fact do so. You just have to add the romkatv/zsh-defer plugin to your .zsh_plugins.txt file, and then also defer the call to fast-theme. I uploaded a new commit in the demo repo that shows this: getantidote/zdotdir@4d355c6

My Linux knowledge isn't good enough to understand it fully yet but I'm slowly working through it.

Enjoy! It's quite an adventure to learn. I'm glad some of my tooling is part of your journey. Good luck.