-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_zshrc
65 lines (50 loc) · 1.75 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
# profiling functions
# zmodload zsh/zprof
# for i in $(seq 1 10); do /usr/bin/time /bin/zsh -i -c exit; done
# DO NOT RENAME THIS FILE
# unless you enjoy infinite loops
export DOTFILES="$HOME/.local/share/chezmoi"
# declare an array of our .zsh files
# -U removes duplicate values
typeset -U config_files
config_files=($DOTFILES/*/*.zsh)
# load the exports files
for file in ${(M)config_files:#*/exports.zsh}; do
source "$file"
done
# load the path files
for file in ${(M)config_files:#*/path.zsh}; do
source "$file"
done
# Configure & load the prompt theme, sindresorhus/pure
source $DOTFILES/zsh/prompt.zsh
# load plugins without a plugin manager
# they must first be installed via plugins/install.sh
# update by running update-zsh-plugins
# inspiration taken from https://github.com/mattmc3/zsh_unplugged
ZPLUGINDIR=$HOME/.local/zsh-plugins
source $ZPLUGINDIR/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh
source $ZPLUGINDIR/zsh-completions/zsh-completions.plugin.zsh
# N.B.: Load syntax highlighting *before* history search. Cf. https://github.com/zsh-users/zsh-history-substring-search#usage
source $ZPLUGINDIR/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh
source $ZPLUGINDIR/zsh-history-substring-search/zsh-history-substring-search.plugin.zsh
source $ZPLUGINDIR/zsh-z/zsh-z.plugin.zsh
# load everything but the path and exports files
for file in ${${config_files:#*/path.zsh}:#*/exports.zsh}; do
source "$file"
done
# initialize autocomplete here, otherwise functions won't be loaded
autoload -Uz compinit
compinit
unset config_files
# top secret
if [[ -a $HOME/.localrc ]]
then
source $HOME/.localrc
fi
# Fixes wonky control flow issues
stty -ixon -ixoff
# fzf fuzzy finder
# this goes last, I think
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# zprof