-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
68 lines (46 loc) · 1.43 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#####
ADD_TO_PATH=()
#####
# machine-specific zshrcs
[ -f "$ZDOTDIR/zshrcs/$(uname -s)-pre.zsh" ] && . "$ZDOTDIR/zshrcs/$(uname -s)-pre.zsh"
[ -f "$ZDOTDIR/zshrcs/$(uname -s)-$(uname -n)-pre.zsh" ] && . "$ZDOTDIR/zshrcs/$(uname -s)-$(uname -n)-pre.zsh"
#####
# path
for dir in $ADD_TO_PATH; do
if [ -d $1 ] && [[ ":${PATH}:" != *":$1:"* ]]; then
export PATH=${PATH}:$dir
fi
done
#####
# misc
if type nvim > /dev/null; then
export EDITOR=nvim
export VISUAL=nvim
fi
setopt autocd
PROMPT='%n@%~ %# '
#####
# aliases
[ -f $ZDOTDIR/aliases ] && . $ZDOTDIR/aliases
#####
# history
setopt hist_ignore_all_dups inc_append_history
HISTFILE=$ZDOTDIR/histfile
HISTSIZE=2048
SAVEHIST=2048
####
# completions
zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*'
autoload -Uz +X compinit && compinit
zstyle ':completion:*' completer _complete _ignored _correct
zstyle :compinstall filename "$ZDOTDIR/.zshrc"
#####
# antibody
if [[ ! -f $ZDOTDIR/zsh_plugins.sh && $(type antibody) && -f $ZDOTDIR/zsh_plugins.txt ]]; then
antibody bundle < $ZDOTDIR/zsh_plugins.txt > $ZDOTDIR/zsh_plugins.sh
fi
[[ -f "$ZDOTDIR/zsh_plugins.sh" ]] && . "$ZDOTDIR/zsh_plugins.sh"
#####
# machine-specific zshrcs
[ -s "$ZDOTDIR/zshrcs/$(uname -s)-post.zsh" ] && . "$ZDOTDIR/zshrcs/$(uname -s)-post.zsh"
[ -s "$ZDOTDIR/zshrcs/$(uname -s)-$(uname -n)-post.zsh" ] && . "$ZDOTDIR/zshrcs/$(uname -s)-$(uname -n)-post.zsh"