-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
69 lines (51 loc) · 1.24 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
# Startup file for Zsh interactive shells
##
## Fail-safe against non-interactive shells
##
# Rely on 'interactive' option to be set
[[ -o interactive ]] || return
##
## Disable keyboard input while runcoms are loaded
##
stty -icanon -echo
##
## Set and export the name of the current shell
##
export D__SHELL=zsh
##
## Source the box-specific '.pre.*sh' files
##
[ -f ~/.pre.zsh -a -r ~/.pre.zsh ] && source ~/.pre.zsh
[ -f ~/.pre.sh -a -r ~/.pre.sh ] && source ~/.pre.sh
##
## Source all *.zsh and *.sh files in ~/.runcoms dir, sorted
#. alphanumerically
##
# If 'nullglob' option is unset, set it and remember to restore it after
[[ -o G ]] || {
set -G
restore_nullglob=(set +G)
}
## Globbing sorts entries alphanumerically; so the files are sourced in the
#. order of their names.
#
for script_path in ~/.config/shell/*(D); do case $script_path in
*.zsh | *.sh) source "$script_path" ;;
esac done
unset script_path
# Restore state of 'nullglob' option
$restore_nullglob
unset restore_nullglob
##
## Source the box-specific '.post.*sh' files
##
[ -f ~/.post.zsh -a -r ~/.post.zsh ] && source ~/.post.zsh
[ -f ~/.post.sh -a -r ~/.post.sh ] && source ~/.post.sh
##
## Re-enable keyboard input
##
stty icanon echo
##
## Graceful exit
##
true