-
Notifications
You must be signed in to change notification settings - Fork 22
/
zshrc
71 lines (56 loc) · 1.59 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
#
# .zshrc - How I configure zsh
#
# This is just a skeleton; the real heavy lifting is done by various
# compartmentalized scripts, which are all sourced by this file. Inspired by
# Zach Holman's dotfiles organization.
#
# Author
# Jake Zimmerman <[email protected]>
#
# Usage
# This file requires that many helper files are in place for it to work
# correctly. Read the README for more information.
#
# load a module robustly by skipping all remaining modules if any module fails
# to load
load_module() {
if [ -n "$ABORTED" ]; then
return
fi
module="$1"
if [ -f "$module" ]; then
source $module
if [ "$?" != "0" ]; then
echo "Module $module failed to load. Exiting."
export ABORTED=1
return
fi
fi
}
# Make sure we are running interactively, else stop
[ -z "$PS1" ] && return
# Hacks to override things before starting
load_module ~/.util/before.sh
# Load utility colors
load_module ~/.util/colors.sh
# Remind the user to update and provide mechanism for updating easily
#load_module ~/.util/auto-update.sh
# zsh-specific settings
load_module ~/.util/misc.zsh
# host-specific settings. This file changes per host according to rcm.
load_module ~/.util/host.sh
# Host-independent aliases
load_module ~/.util/aliases.sh
# host-specific zsh settings.
load_module ~/.util/host.zsh
# miscellaneous, shell-agnostic settings
load_module ~/.util/misc.sh
# prompt settings
load_module ~/.util/prompt.zsh
# Hacks to override things after finishing
load_module ~/.util/after.sh
# load helper functions
for module in ~/.util/functions/*.sh; do
load_module $module
done