2020-01-17 01:22:50 -08:00
|
|
|
[ -d "$ZGEN_DIR" ] || git clone https://github.com/tarjoilija/zgen "$ZGEN_DIR"
|
|
|
|
source $ZGEN_SOURCE
|
2019-08-06 10:56:54 -07:00
|
|
|
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
|
2020-01-17 01:22:50 -08:00
|
|
|
[ -z "$SSH_CONNECTION" ] && zgen load zdharma/fast-syntax-highlighting
|
2019-08-06 10:56:54 -07:00
|
|
|
zgen save
|
|
|
|
fi
|
|
|
|
|
|
|
|
source $ZDOTDIR/config.zsh
|
2019-12-10 11:51:47 -08:00
|
|
|
if [[ $TERM != dumb ]]; then
|
|
|
|
source $ZDOTDIR/keybinds.zsh
|
|
|
|
source $ZDOTDIR/completion.zsh
|
|
|
|
source $ZDOTDIR/aliases.zsh
|
|
|
|
|
|
|
|
##
|
|
|
|
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-12-10 11:51:47 -08:00
|
|
|
_cache fasd --init posix-alias zsh-{hook,{c,w}comp{,-install}}
|
2019-08-06 10:56:54 -07:00
|
|
|
|
2020-01-17 01:22:50 -08:00
|
|
|
## Auto-generated by my nix config
|
2020-01-12 15:17:17 -08:00
|
|
|
source $ZDOTDIR/extra.zshrc
|
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
|
2020-01-12 15:17:17 -08:00
|
|
|
[ -f ~/.zshrc ] && source ~/.zshrc
|
2019-12-10 11:51:47 -08:00
|
|
|
fi
|