This is my full .zshrc:
export ZSH="/Users/butters/.oh-my-zsh"
source $ZSH/oh-my-zsh.sh
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh
plugins=(
git
bundler
dotenv
osx
zake
zsh-syntax-highlighting
zsh-autosuggestions
)
It seems that only when source $ZSH/oh-my-zsh.sh is placed above the rest, my custom plugins work but all the other plugins such as osx stop working. When I placed it below the rest, osx works but zsh-syntax-highlighting and zsh-autosuggestions stop working.
There are three problems in your setup:
plugins is an array used by $ZSH/oh-my-zsh.sh. You need to initialize the former before calling the latter. Just initializing plugins by itself doesn't do anything special in plain Zsh (apart from creating a plain old array).zsh-syntax-highlighting and zsh-autosuggestions mention explicitly in their documentation that they should be sourced after any other plugins.source a plugin, then you do not need to add it to Oh-My-Zsh's plugins array.So, therefore, for your setup, this is the correct way to do things:
ZSH=~/.oh-my-zsh
plugins=(
git
bundler
dotenv
osx
zake
)
source $ZSH/oh-my-zsh.sh
source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With