2018-11-10 14:55:37 +00:00
|
|
|
#!/usr/bin/env zsh
|
|
|
|
|
2019-08-27 09:07:51 +00:00
|
|
|
ZSH_CACHE_DIR="$HOME/.cache/dotfiles"
|
|
|
|
if [[ ! -d "$ZSH_CACHE_DIR" ]]; then
|
|
|
|
mkdir -pv "$ZSH_CACHE_DIR"
|
|
|
|
fi
|
|
|
|
|
2019-06-27 11:14:18 +00:00
|
|
|
source "$ZSH_DOTFILES/zplg.zsh"
|
|
|
|
|
|
|
|
plugin completions 'zsh-users/zsh-completions'
|
|
|
|
|
2019-08-26 19:48:48 +00:00
|
|
|
# compinit {{{
|
|
|
|
# note that completion system must be initialized after zsh-completions and
|
|
|
|
# before oh-my-zsh
|
2019-09-24 19:34:15 +00:00
|
|
|
autoload -U compinit
|
|
|
|
|
|
|
|
run_compdump=1
|
|
|
|
# glob qualifiers description:
|
|
|
|
# N turn on NULL_GLOB for this expansion
|
|
|
|
# . match only plain files
|
|
|
|
# m-1 check if the file was modified today
|
|
|
|
# see "Filename Generation" in zshexpn(1)
|
|
|
|
for match in $HOME/.zcompdump(N.m-1); do
|
|
|
|
run_compdump=0
|
|
|
|
break
|
|
|
|
done; unset match
|
|
|
|
|
|
|
|
if (( $run_compdump )); then
|
|
|
|
echo "$0: rebuilding zsh completion dump"
|
|
|
|
# -D flag turns off compdump loading
|
|
|
|
compinit -D
|
|
|
|
compdump
|
|
|
|
else
|
|
|
|
# -C flag disables some checks performed by compinit - they are not needed
|
|
|
|
# because we already have a fresh compdump
|
|
|
|
compinit -C
|
|
|
|
fi
|
|
|
|
unset run_compdump
|
2019-08-26 19:48:48 +00:00
|
|
|
# }}}
|
2019-06-27 11:14:18 +00:00
|
|
|
|
2019-08-26 19:42:07 +00:00
|
|
|
# Oh-My-Zsh {{{
|
2019-06-27 11:14:18 +00:00
|
|
|
|
|
|
|
# disable automatic updates because OMZ is managed by my plugin manager
|
|
|
|
DISABLE_AUTO_UPDATE=true
|
2018-12-03 08:27:28 +00:00
|
|
|
|
2018-11-10 14:55:37 +00:00
|
|
|
# use hyphen-insensitive completion (makes `_` and `-` interchangeable)
|
2019-06-27 11:14:18 +00:00
|
|
|
HYPHEN_INSENSITIVE=true
|
2018-11-10 14:55:37 +00:00
|
|
|
|
|
|
|
# enable command auto-correction
|
2019-06-27 11:14:18 +00:00
|
|
|
ENABLE_CORRECTION=true
|
2018-11-10 14:55:37 +00:00
|
|
|
|
|
|
|
# display red dots while waiting for completion
|
2019-06-27 11:14:18 +00:00
|
|
|
COMPLETION_WAITING_DOTS=true
|
2018-11-10 14:55:37 +00:00
|
|
|
|
|
|
|
# disable marking untracked files under VCS as dirty (this makes repository
|
2019-06-27 11:14:18 +00:00
|
|
|
# status check for large repositories much faster)
|
|
|
|
DISABLE_UNTRACKED_FILES_DIRTY=true
|
2018-11-10 14:55:37 +00:00
|
|
|
|
|
|
|
# command execution time stamp shown in the history
|
2019-06-27 11:14:18 +00:00
|
|
|
HIST_STAMPS=dd.mm.yyyy
|
|
|
|
|
2019-09-11 15:08:00 +00:00
|
|
|
# ls colors are handled by my dotfiles, so disable that part of OMZ to avoid
|
|
|
|
# wasting time
|
|
|
|
DISABLE_LS_COLORS=true
|
|
|
|
|
2019-09-24 19:34:15 +00:00
|
|
|
omz_features=(key-bindings termsupport)
|
2019-06-27 11:14:18 +00:00
|
|
|
omz_plugins=(git extract fasd)
|
|
|
|
|
|
|
|
plugin oh-my-zsh 'robbyrussell/oh-my-zsh' \
|
2019-09-24 19:34:15 +00:00
|
|
|
load='lib/'${^omz_features}'.zsh' \
|
|
|
|
load='plugins/'${^omz_plugins}'/*.plugin.zsh' \
|
2019-06-27 11:14:18 +00:00
|
|
|
before_load='ZSH="$plugin_dir"' \
|
|
|
|
after_load='plugin-cfg-path fpath prepend completions functions' \
|
|
|
|
after_load='plugin-cfg-path fpath prepend plugins/'${^omz_plugins}
|
|
|
|
|
|
|
|
unset omz_plugins
|
|
|
|
|
|
|
|
# }}}
|
2018-11-10 14:55:37 +00:00
|
|
|
|
2019-06-27 11:14:18 +00:00
|
|
|
plugin fzf 'junegunn/fzf' build='./install --bin' \
|
|
|
|
after_load='plugin-cfg-path path prepend bin' \
|
|
|
|
after_load='plugin-cfg-path manpath prepend man'
|
2018-11-10 14:55:37 +00:00
|
|
|
|
2019-06-27 11:14:18 +00:00
|
|
|
plugin alias-tips 'djui/alias-tips'
|
2018-11-10 14:55:37 +00:00
|
|
|
|
2019-06-27 11:14:18 +00:00
|
|
|
FAST_WORK_DIR="$ZSH_CACHE_DIR"
|
2019-09-08 12:48:00 +00:00
|
|
|
if [[ "$TERM" != "linux" ]]; then
|
|
|
|
plugin fast-syntax-highlighting 'zdharma/fast-syntax-highlighting'
|
2019-09-24 19:34:15 +00:00
|
|
|
set-my-syntax-theme() { fast-theme "$ZSH_DOTFILES/my-syntax-theme.ini" "$@"; }
|
2019-09-08 12:48:00 +00:00
|
|
|
fi
|