2020-01-03 03:49:34 -08:00
|
|
|
if [[ ! -d "$ZGEN_DIR" ]]; then
|
|
|
|
git clone https://github.com/tarjoilija/zgen "$ZGEN_DIR"
|
|
|
|
fi
|
2019-08-06 10:56:54 -07:00
|
|
|
source $ZGEN_SOURCE
|
|
|
|
|
|
|
|
if ! zgen saved; then
|
|
|
|
echo "Initializing zgen"
|
|
|
|
|
2019-10-25 13:58:48 -07:00
|
|
|
zgen load hlissner/zsh-autopair autopair.zsh
|
2019-08-06 10:56:54 -07:00
|
|
|
zgen load zsh-users/zsh-history-substring-search
|
|
|
|
zgen load zdharma/history-search-multi-word
|
|
|
|
zgen load zsh-users/zsh-completions src
|
2019-11-26 14:00:28 -08:00
|
|
|
zgen load junegunn/fzf shell
|
2019-08-06 10:56:54 -07:00
|
|
|
|
|
|
|
if [[ -z $SSH_CONNECTION ]]; then
|
|
|
|
zgen load zdharma/fast-syntax-highlighting
|
|
|
|
fi
|
|
|
|
|
|
|
|
zgen save
|
|
|
|
fi
|
|
|
|
|
|
|
|
source $ZDOTDIR/config.zsh
|
2019-12-10 11:51:47 -08:00
|
|
|
if [[ $TERM != dumb ]]; then
|
|
|
|
source $ZDOTDIR/prompt.zsh
|
|
|
|
source $ZDOTDIR/keybinds.zsh
|
|
|
|
source $ZDOTDIR/completion.zsh
|
|
|
|
source $ZDOTDIR/aliases.zsh
|
|
|
|
for file in $XDG_CONFIG_HOME/zsh/rc.d/aliases.*.zsh(N); do
|
|
|
|
source $file
|
|
|
|
done
|
|
|
|
|
|
|
|
##
|
|
|
|
function _cache {
|
|
|
|
command -v "$1" >/dev/null || return 1
|
|
|
|
local cache_dir="$XDG_CACHE_HOME/${SHELL##*/}"
|
|
|
|
local cache="$cache_dir/$1"
|
|
|
|
if [[ ! -f $cache || ! -s $cache ]]; then
|
|
|
|
echo "Caching $1"
|
|
|
|
mkdir -p $cache_dir
|
|
|
|
"$@" >$cache
|
|
|
|
fi
|
|
|
|
source $cache || rm -f $cache
|
|
|
|
}
|
|
|
|
|
|
|
|
# fd > find
|
|
|
|
if command -v fd >/dev/null; then
|
|
|
|
export FZF_DEFAULT_OPTS="--reverse --ansi"
|
|
|
|
export FZF_DEFAULT_COMMAND="fd ."
|
|
|
|
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
|
|
|
|
export FZF_ALT_C_COMMAND="fd -t d . $HOME"
|
2019-08-06 10:56:54 -07:00
|
|
|
fi
|
2019-11-26 14:00:28 -08:00
|
|
|
|
2019-12-10 11:51:47 -08:00
|
|
|
_cache fasd --init posix-alias zsh-{hook,{c,w}comp{,-install}}
|
|
|
|
_cache direnv hook zsh
|
2019-08-06 10:56:54 -07:00
|
|
|
|
|
|
|
|
2019-12-10 11:51:47 -08:00
|
|
|
##
|
|
|
|
autoload -Uz compinit && compinit -u -d $ZSH_CACHE/zcompdump
|
|
|
|
autopair-init
|
2019-12-08 16:27:59 -08:00
|
|
|
|
|
|
|
|
2019-12-10 11:51:47 -08:00
|
|
|
# If you have host-local configuration, this is where you'd put it
|
|
|
|
[ -f ~/.config/zsh/rc ] && source ~/.config/zsh/rc
|
|
|
|
fi
|