dotfiles/home/private_dot_config/zsh/dot_zshrc

65 lines
1.4 KiB
Text
Raw Normal View History

2023-02-20 10:10:52 -06:00
#!/usr/bin/env zsh
2023-02-17 09:26:31 -06:00
#
# .zshrc - Zsh file loaded on interactive shell sessions.
#
#
# Profiling
#
# Load zprof first if we need to profile.
[[ ${ZPROFRC:-0} -eq 0 ]] || zmodload zsh/zprof
alias zprofrc="ZPROFRC=1 zsh"
#
# Options
#
# Set general Zsh options needed for config.
setopt extended_glob
#
# Lazy-load functions
#
# Autoload functions directory and its subdirs.
for funcdir in $ZDOTDIR/functions $ZDOTDIR/functions/*(N/); do
fpath=($funcdir $fpath)
autoload -Uz $fpath[1]/*(.:t)
done
unset funcdir
#
# Pre-antidote
#
# Be sure to set any supplemental completions directories before compinit is run.
fpath=(${ZDOTDIR}/completions(-/FN) $fpath)
#
# antidote
#
[[ -d ${ZDOTDIR:-~}/.antidote ]] ||
git clone https://github.com/mattmc3/antidote ${ZDOTDIR:-~}/.antidote
# Set the name of the static .zsh plugins file antidote will generate.
zsh_plugins=${ZDOTDIR:-~}/.zsh_plugins.zsh
# Ensure you have a .zsh_plugins.txt file where you can add plugins.
[[ -f ${zsh_plugins:r}.txt ]] || touch ${zsh_plugins:r}.txt
# Lazy-load antidote.
fpath+=(${ZDOTDIR:-~}/.antidote/functions)
autoload -Uz $fpath[-1]/antidote
# Generate static file in a subshell when .zsh_plugins.txt is updated.
if [[ ! $zsh_plugins -nt ${zsh_plugins:r}.txt ]]; then
(antidote bundle <${zsh_plugins:r}.txt >|$zsh_plugins)
fi
# Source your static plugins file.
source $zsh_plugins
2023-05-04 09:51:43 -05:00
(( $+commands[todo] )) && is-tty || todo show -s