ZSH compatible with root

This commit is contained in:
Geoffrey Frogeye 2019-04-22 20:37:23 +02:00
parent 5fb77e7d47
commit a14512b585

View file

@ -16,10 +16,22 @@ mkdir -p $ADOTDIR
typeset -a ANTIGEN_CHECK_FILES=(~/.config/shell/zshrc) typeset -a ANTIGEN_CHECK_FILES=(~/.config/shell/zshrc)
source ~/.local/share/zsh/antigen.zsh # Don't work with trysource, why? 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 # This is better to have them installed as system since we can use them as root
antigen bundle zsh-users/zsh-autosuggestions # pacman -S zsh-autosuggestions zsh-history-substring-search zsh-syntax-highlighting zsh-completions --needed
antigen bundle zsh-users/zsh-history-substring-search 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 antigen apply
@ -111,8 +123,7 @@ bindkey -M vicmd 'k' history-substring-search-up
bindkey -M vicmd 'j' history-substring-search-down bindkey -M vicmd 'j' history-substring-search-down
# Autocompletion # Autocompletion
autoload -Uz compinit promptinit autoload -Uz promptinit
compinit
promptinit promptinit
# Color common prefix # Color common prefix