-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
47 lines (38 loc) · 1.35 KB
/
.zshrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
if [[ $INSIDE_EMACS == 'vterm' ]] \
&& [[ -n ${EMACS_VTERM_PATH} ]] \
&& [[ -f ${EMACS_VTERM_PATH}/etc/emacs-vterm-zsh.sh ]]; then
source ${EMACS_VTERM_PATH}/etc/emacs-vterm-zsh.sh
fi
export ZIM_HOME=$XDG_CACHE_HOME/zim
# Extra completions
local COMPLETION_EXTRA=${ZIM_HOME}/modules/completion-extra
if [[ ! -d $COMPLETION_EXTRA ]]; then
mkdir -p $COMPLETION_EXTRA/src
fi
for f in _{rustup,cargo}; do
[[ ! -f $COMPLETION_EXTRA/src/$f ]] && \
case $f in
_rustup)
rustup completions zsh > $COMPLETION_EXTRA/src/$f
;;
_cargo)
rustup completions zsh cargo > $COMPLETION_EXTRA/src/$f
;;
esac
done
# Download zimfw plugin manager if missing.
if [[ ! -e ${ZIM_HOME}/zimfw.zsh ]]; then
curl -fsSL --create-dirs -o ${ZIM_HOME}/zimfw.zsh \
https://github.com/zimfw/zimfw/releases/latest/download/zimfw.zsh
fi
# Install missing modules, and update ${ZIM_HOME}/init.zsh if missing or outdated.
if [[ ! ${ZIM_HOME}/init.zsh -nt ${ZDOTDIR:-${HOME}}/.zimrc ]]; then
source ${ZIM_HOME}/zimfw.zsh init -q
fi
# Initialize modules.
source ${ZIM_HOME}/init.zsh
# Completion
zstyle ':zim:completion' dumpfile "${ZSH_CACHE_DIR}/.zcompdump"
zstyle ':completion::complete:*' cache-path "${ZSH_CACHE_HOME}/.zcompcache"
# pacman
zstyle ':zim:pacman' helpers 'aur'