diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 0d27c2b..7ca05da 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -56,7 +56,7 @@ for plugin in "${(@s/ /)ZSH_PLUGIN_DIST}"; do [[ -n "${plugin}" ]] && source "${plugin}" done unset plugin -source "${ZSH_PLUGIN_SOURCE}" +[[ -n "${ZSH_PLUGIN_SOURCE}" ]] && source "${ZSH_PLUGIN_SOURCE}" # Fuzzy finder, . export FZF_CTRL_R_OPTS="--layout=reverse" diff --git a/.config/zsh/plugins.zsh b/.config/zsh/plugins.zsh index 8fcee0b..825b6de 100644 --- a/.config/zsh/plugins.zsh +++ b/.config/zsh/plugins.zsh @@ -14,10 +14,12 @@ local -a _my_plugins=( # Must come after zsh-syntax-highlighting zsh-users/zsh-history-substring-search ) + if ! command -v fzf > /dev/null; then # Don't load these plugins if fzf was not found _my_plugins=(${_my_plugins:#Aloxaf/fzf-tab}) fi + if [[ "$HOST" == "steuerbeamter" ]]; then # Don't load these plugins on slow computers _my_plugins=(${_my_plugins:#zsh-users/zsh-autosuggestions}) @@ -40,10 +42,11 @@ if [[ -f /etc/gentoo-release ]]; then fi export ZSH_PLUGIN_DIST="${_my_plugins_dist}" # Arrays can not be exported -zmodload zsh/stat -zmodload zsh/datetime +# If there are plugins not handled by the package manager, use antibody +if [[ -n ${_my_plugins} ]] && command -v antibody > /dev/null; then + zmodload zsh/stat + zmodload zsh/datetime -if command -v antibody > /dev/null; then local plugin_cache_dir="$(antibody home)" export ZSH_PLUGIN_SOURCE="${plugin_cache_dir}/antibody-plugins.zsh"