-
Notifications
You must be signed in to change notification settings - Fork 0
/
zshrc
72 lines (59 loc) · 1.36 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
68
69
70
71
72
# zmodload zsh/zprof
#
# Brew zsh completions
typeset -U fpath
if type brew &>/dev/null
then
fpath=("$(brew --prefix)/share/zsh/site-functions" $fpath)
fi
# Load completions functions
# man zshbuiltins (for autoload); man zshcompsys (for completion system)
autoload -U compinit
autoload -U bashcompinit
# Generate a menu of matches when globbing (rather than auto-inserting all matches)
setopt GLOB_COMPLETE
setopt PROMPT_SUBST
setopt NO_NOMATCH
# Improve usefulness of run-help. See `man zshcontrib`
if hash run-help 2>/dev/null; then
unalias run-help
fi
autoload run-help
DOTFILES=$HOME/.dotfiles
# Set name of the theme to load.
ZSH_THEME="dcloud"
EDITOR='vim'
if type nvim &>/dev/null
then
EDITOR='nvim'
fi
export EDITOR
# Adapted from https://github.com/holman/dotfiles/
typeset -U config_files
config_files=($DOTFILES/zsh/**/*.zsh)
# load config files
for file in ${config_files}
do
source $file
done
# Personal environmental variables
if [[ -a ~/.localrc ]]
then
source ~/.localrc
fi
autoload -U promptinit; promptinit
prompt pure
# (re)build & initialize completions, only once every 24 hours
# Do this late since plugins, e.g. wd.zsh, may edit fpath
# man zshcompsys
() {
setopt extendedglob local_options
if [[ -n ${ZDOTDIR:-$HOME}/.zcompdump(#qN.mh+24) ]]; then
compinit
bashcompinit
else
compinit -C
bashcompinit -C
fi
}
# zprof