Use zplug to manage local plugins

This commit is contained in:
Paweł Płazieński 2024-09-08 12:55:43 +02:00
parent d54841dc9e
commit 86f8470be0
2 changed files with 39 additions and 30 deletions

View File

@ -1,26 +0,0 @@
# vim: ft=zsh
export ZPLUG_ROOT=${ZPLUG_ROOT:-/usr/share/zplug}
if [[ ! -f "${ZPLUG_ROOT}/init.zsh" ]]; then
return
fi
source ${ZPLUG_ROOT}/init.zsh
zplug "plugins/git", from:oh-my-zsh
zplug "plugins/sudo", from:oh-my-zsh
zplug "plugins/command-not-found", from:oh-my-zsh
zplug "zsh-users/zsh-syntax-highlighting"
zplug "zsh-users/zsh-autosuggestions"
zplug "zsh-users/zsh-history-substring-search"
zplug "zsh-users/zsh-completions"
zplug "junegunn/fzf", use:"shell/*.zsh"
if ! zplug check --verbose; then
printf "Install? [y/N]: "
if read -q; then
echo
zplug install
fi
fi
zplug load

43
zshrc
View File

@ -263,8 +263,43 @@ precmd_functions=(store_last_return_value $precmd_functions)
zmodload zsh/complist zmodload zsh/complist
#---------------------------------- Partials ------------------------------------ #---------------------------------- Plugins ------------------------------------
export ZPLUG_ROOT=${ZPLUG_ROOT:-$ZDOTDIR/zplug}
export ZPLUG_VERSION=${ZPLUG_VERSION:-2.4.2}
if [[ ! -d "$ZPLUG_ROOT" ]]; then
ZPLUG_PARENT=$(dirname "$ZPLUG_ROOT")
if [[ ! -w "$ZPLUG_PARENT" ]]; then
echo "ZPLUG_ROOT, which is $ZPLUG_ROOT doesn't exists and cannot be created" >&2
return
fi
printf "zplug not installed, clone to ${ZPLUG_ROOT}? [y/N]: "
if read -q; then
echo
git clone https://github.com/zplug/zplug -b "$ZPLUG_VERSION" $ZPLUG_ROOT
fi
fi
source ${ZPLUG_ROOT}/init.zsh
zplug "plugins/git", from:oh-my-zsh
zplug "plugins/sudo", from:oh-my-zsh
zplug "plugins/command-not-found", from:oh-my-zsh
zplug "zsh-users/zsh-syntax-highlighting"
zplug "zsh-users/zsh-autosuggestions"
zplug "zsh-users/zsh-history-substring-search"
zplug "zsh-users/zsh-completions"
zplug "junegunn/fzf", use:"shell/*.zsh"
zplug "$ZDOTDIR/zsh.d", from:local
if ! zplug check --verbose; then
printf "Install? [y/N]: "
if read -q; then
echo
zplug install
fi
fi
zplug load
for partial in ${ZDOTDIR}/zsh.d/*.zsh; do
source $partial
done