diff --git a/config/shell/zshrc b/config/shell/zshrc index eedb84b..df47943 100644 --- a/config/shell/zshrc +++ b/config/shell/zshrc @@ -16,10 +16,22 @@ mkdir -p $ADOTDIR typeset -a ANTIGEN_CHECK_FILES=(~/.config/shell/zshrc) source ~/.local/share/zsh/antigen.zsh # Don't work with trysource, why? -antigen bundle zsh-users/zsh-completions -antigen bundle zsh-users/zsh-syntax-highlighting -antigen bundle zsh-users/zsh-autosuggestions -antigen bundle zsh-users/zsh-history-substring-search + +# This is better to have them installed as system since we can use them as root +# pacman -S zsh-autosuggestions zsh-history-substring-search zsh-syntax-highlighting zsh-completions --needed +function plugin() { + if [ -d "/usr/share/licenses/$2" ] + then + trysource "/usr/share/zsh/plugins/$2/$2.zsh" + # It's ok if it fails + else + antigen bundle "$1/$2" + fi +} +plugin zsh-users zsh-completions +plugin zsh-users zsh-syntax-highlighting +plugin zsh-users zsh-autosuggestions +plugin zsh-users zsh-history-substring-search antigen apply @@ -111,8 +123,7 @@ bindkey -M vicmd 'k' history-substring-search-up bindkey -M vicmd 'j' history-substring-search-down # Autocompletion -autoload -Uz compinit promptinit -compinit +autoload -Uz promptinit promptinit # Color common prefix