-
Notifications
You must be signed in to change notification settings - Fork 4
/
dot_zshrc
68 lines (54 loc) · 1.77 KB
/
dot_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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env zsh
if [[ "$ZPROF" = true ]]; then
zmodload zsh/zprof
fi
source $HOME/.zsh/init.zsh
source $HOME/.zsh/exports.zsh
# Set the root name of the plugins files (.txt and .zsh) antidote will use.
zsh_plugins=$HOME/.zsh/plugins
# Ensure the .zsh_plugins.txt file exists so you can add plugins.
[[ -f ${zsh_plugins}.txt ]] || touch ${zsh_plugins}.txt
# Lazy-load antidote from its functions directory.
fpath=(/path/to/antidote/functions $fpath)
autoload -Uz antidote
# Generate a new static file whenever .zsh_plugins.txt is updated.
if [[ ! ${zsh_plugins}.zsh -nt ${zsh_plugins}.txt ]]; then
antidote bundle <${zsh_plugins}.txt >|${zsh_plugins}.zsh
fi
# Source your static plugins file.
source ${zsh_plugins}.zsh
source $HOME/.zsh/evals.zsh
source $HOME/.zsh/history.zsh
source $HOME/.zsh/stack.zsh
source $HOME/.zsh/keys.zsh
source $HOME/.zsh/aliases.zsh
#source $HOME/.zsh/gpg-agent.zsh
# load base16 themes if on terminal
if [[ -n $DISPLAY ]]; then
# base16 theme
base16_gruvbox-dark-hard
fi
if [[ "$ZPROF" = true ]]; then
exit_hook() {
print "zprof for process $$"
zprof
while read input; do
done
exit 0
}
add-zsh-hook zshexit exit_hook
fi
# emacs(tramp): disable zsh line editor because zsh uses
# left-hand side and right-hand side prompts in parallel
# see: TRAMP does not connect to the remote host at
# https://www.gnu.org/software/emacs/manual/html_node/tramp/Frequently-Asked-Questions.html
if [[ $TERM == "dumb" ]]; then
unsetopt zle && PS1='$ ' && return
fi
# initialize completion
if [[ -n ${ZDOTDIR}/.zcompdump(#qN.mh+24) ]]; then
compinit
else
compinit -C
fi
_approximate # enable approximate matches for completion