-
Notifications
You must be signed in to change notification settings - Fork 1
/
dot.zshrc
41 lines (37 loc) · 852 Bytes
/
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
# main zshrc loop
autoload -Uz colors
zmodload zsh/terminfo
if [[ $#terminfo -eq 0 ]]
then
TERM=vt100
fi
if [[ $#terminfo -gt 0 && $terminfo[colors] -ge 8 ]]
then
colors
fi
def_rootcmd() {
setopt localoptions nonomatch
if [[ -x =doas ]]
then
rootcmd==doas
else
rootcmd==sudo
fi
}
def_rootcmd
unfunction def_rootcmd
__thiszshrc="${ZDOTDIR:-$HOME}/.zshrc"
export DOTFILES_BASE="$__thiszshrc:A:h"
unset __thiszshrc
setopt extended_glob
echo "$fg[green]starting up shell$reset_color\c"
[[ $V == 1 ]] && echo ":\c"
for script in $DOTFILES_BASE/zsh/rc.*~*~
do
[[ $V == 1 ]] && echo " $script:e\c" || echo ".\c"
. $script
[[ $? -ne 0 ]] && { [[ $V == 1 ]] && echo "\e[$#script:eD$fg[red]$script:e$reset_color\c" || echo "\e[1D$fg[red].$reset_color\c" }
done
[[ $V == 1 ]] && echo "." || echo
unset script rootcmd
# vi: set ts=4 sw=4 ft=zsh: