Zsh plugins not found

Hi,

I have two boxes with Manjaro KDE. The installation is similar, the uniformity is supported with dotfiles and chezmoi. I use oh-my-zsh, the same set of plugins on both boxes. Today I added three plugins to my .zshrc. Added them to the plugins=(...) declaration, nothing more. On one box everything’s fine, on another the new plugins aren’t found:

[oh-my-zsh] plugin 'zsh-256color' not found
[oh-my-zsh] plugin 'zsh-autosuggestions' not found
[oh-my-zsh] plugin 'zsh-syntax-highlighting' not found

Since the systems are supposed to be equivalent, I’m at a loss. Where to start my research?

If the installation is only “similar”, you need to install these plugins.

The plugins=() are is specific for oh-my-zsh and it does not load the plugins from the /usr/share/zsh/plugins directory.

E.g.

$ pacman -Fx /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh
usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh is owned by extra/zsh-autosuggestions 0.7.0-3

It is then loaded by the following line in your .zshrc:

source '/usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh'

Thanks! I don’t quite get it, though.

The ~/.zshrc file is shared, and it’s relevant parts look like this:

plugins=(
    git python docker systemd sudo vi-mode
    mise
    zsh-256color zsh-autosuggestions zsh-syntax-highlighting
)
...
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

Why there’s just one source ... line I can’t tell, it just worked. Up to a point, as I discovered today :blush:

I did a bit of search. Do I have to add this to my .zshrc?

source /usr/share/oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source /usr/share/oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source /usr/share/oh-my-zsh/custom/plugins/zsh-256color/zsh-256color.plugin.zsh


Apparently, so. Why such trouble? And irregularity, too (zsh-256color.plugin.zsh).

UPD

Now on my troubled box it’s even better:

[oh-my-zsh] plugin 'zsh-256color' not found
[oh-my-zsh] plugin 'zsh-autosuggestions' not found
[oh-my-zsh] plugin 'zsh-syntax-highlighting' not found
/home/alexey/.zshrc:source:193: no such file or directory: /usr/share/oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
/home/alexey/.zshrc:source:194: no such file or directory: /usr/share/oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
/home/alexey/.zshrc:source:195: no such file or directory: /usr/share/oh-my-zsh/custom/plugins/zsh-256color/zsh-256color.plugin.zsh

Sure enough:

/usr/share/oh-my-zsh/custom/plugins> ls
example

Where are the plugins? I just reinstalled oh-my-zsh-git, still nothing.

Do you have set $ZSH_CUSTOM variable? If you have set it (usually it’s ~/.oh-my-zsh/custom) simply put them in $ZSH_CUSTOM/plugins dir.

Or remove them from plugins=(...) part and source directly:

source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source $HOME/.zsh/myplugin.zsh

Zsh plugins aren’t dark magic, these are simple zsh scripts which you sourcing in your .zshrc – Oh My ZSH just overcomplicate things :wink:

Zsh plugins aren’t dark magic, these are simple zsh scripts which you sourcing in your .zshrc – Oh My ZSH just overcomplicate things

It turned out, that on my “good” box I installed hyprdots project first. Specifically by running install.sh script, like its README says. Instead of murdering my zsh configuration, those scripts correctly added the required plugins, miraculously. One can see the surgery. If it isn’t dark magic, what is it, then?

Probably, the scripts’ author respected some convention, so I should add something similar to my dotfiles machinery…

~> echo $ZSH_CUSTOM
/usr/share/oh-my-zsh/custom

Ohh - hyperdots - that is real showoff - like a pimped :pickup_truck: - and then some.

The ‘normal’ method of adding zsh plugins is your ~/.oh-my-zsh/custom folder.

When installing from the repo or adding from custom PKGBUILD you may need to source the relevant script.

Ohh - hyperdots - that is real showoff - like a pimped :pickup_truck: - and then some.

I wouldn’t beg to disagree. Nevertheless, I got impressed with the fact that his script runs nicely against Arch Linux oh-my-zsh-git package, which I happened to use already. For the time being, I adopted it into my dotfiles. I don’t like the solution, but it will serve me while I read about how to manage Oh My Zsh painlessly, which is no small task, as I already see :blush:

Managing your zsh is fairly easy - but mixing in hyprdots adds some headache to the mix.

At least it did for me … I am sure everything makes total sense for the creator … I couldn’t make heads from tails from it - it looks nice - even spectacular - but using it daily - I couldn’t.

I find the initial warning - quite accurate and very relevant - don’t mix in hyprdots on your primary workstation.

The installation script is designed for a minimal Arch Linux install, but may work on some Arch-based distros. While installing HyDE alongside another DE/WM should work, due to it being a heavily customized setup, it will conflict with your GTK/Qt theming, Shell, SDDM, GRUB, etc. and is at your own risk.

Yes and not. You are lucky that author of hyprdots uses same plugins as you, configure one of required variables and add plugins via script.

Nice, but overcomplicated for me and definitely not universal solution for all (because whole repo just follow author configs – if you have something other – you’ll lose it)