fix(zsh): update plugin handling
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
.cache
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
|
|
||||||
|
_here="$(dirname -- "$(readlink -f -- "${HOME}/.zshrc")")"
|
||||||
|
|
||||||
###########
|
###########
|
||||||
# Options #
|
# Options #
|
||||||
###########
|
###########
|
||||||
@@ -12,8 +15,8 @@ setopt INTERACTIVECOMMENTS
|
|||||||
###################
|
###################
|
||||||
# Ref: https://zsh.sourceforge.io/Doc/Release/Parameters.html
|
# Ref: https://zsh.sourceforge.io/Doc/Release/Parameters.html
|
||||||
|
|
||||||
path+=("${HOME}/.local/bin")
|
path=("${HOME}/.local/bin" "${path[@]}")
|
||||||
fpath+=("${HOME}/.zsh_functions")
|
fpath=("${_here}/.zsh_functions" "${fpath[@]}")
|
||||||
export PATH
|
export PATH
|
||||||
export MAIL="/var/spool/mail/$USER"
|
export MAIL="/var/spool/mail/$USER"
|
||||||
export MAILCHECK=60
|
export MAILCHECK=60
|
||||||
@@ -100,14 +103,31 @@ fi
|
|||||||
# Plugins #
|
# Plugins #
|
||||||
###########
|
###########
|
||||||
|
|
||||||
# Bootstrap
|
if [[ ! -d "${_here}/.cache" ]]; then
|
||||||
if [[ ! -d ~/.antidote ]]; then
|
mkdir "${_here}/.cache"
|
||||||
git clone --depth=1 https://github.com/mattmc3/antidote.git ~/.antidote
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Plugins are declared in ~/.zsh_plugins.txt
|
_antidote="${_here}/.cache/.antidote"
|
||||||
source ~/.antidote/antidote.zsh
|
_plugins="${_here}/.zsh_plugins.txt"
|
||||||
antidote load
|
_plugins_cache="${_here}/.cache/.zsh_plugins.zsh"
|
||||||
|
|
||||||
|
if [[ ! -d "$_antidote" ]]; then
|
||||||
|
git clone --depth=1 https://github.com/mattmc3/antidote.git "$_antidote"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -f "${_plugins}" ]]; then
|
||||||
|
touch "${_plugins}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fpath=("${_antidote}/functions" "${fpath[@]}")
|
||||||
|
autoload -Uz antidote
|
||||||
|
|
||||||
|
if [[ ! "${_plugins_cache}" -nt "${_plugins}" ]]; then
|
||||||
|
antidote bundle <"${_plugins}" >"${_plugins_cache}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# shellcheck source=.cache/.zsh_plugins.zsh
|
||||||
|
source "${_plugins_cache}"
|
||||||
|
|
||||||
#############
|
#############
|
||||||
# Functions #
|
# Functions #
|
||||||
@@ -174,7 +194,6 @@ alias ssh='ssh_with_title'
|
|||||||
##########
|
##########
|
||||||
# Prompt #
|
# Prompt #
|
||||||
##########
|
##########
|
||||||
# eval "$(starship init zsh)"
|
|
||||||
|
|
||||||
autoload -Uz promptinit
|
autoload -Uz promptinit
|
||||||
promptinit
|
promptinit
|
||||||
|
|||||||
@@ -40,8 +40,6 @@ SYMLINKS=(
|
|||||||
".xinitrc"
|
".xinitrc"
|
||||||
".xinit-scripts"
|
".xinit-scripts"
|
||||||
".zshrc"
|
".zshrc"
|
||||||
".zsh_functions"
|
|
||||||
".zsh_plugins.txt"
|
|
||||||
".p10k.zsh"
|
".p10k.zsh"
|
||||||
".gtkrc-2.0"
|
".gtkrc-2.0"
|
||||||
".config/tmux"
|
".config/tmux"
|
||||||
|
|||||||
Reference in New Issue
Block a user