-
Notifications
You must be signed in to change notification settings - Fork 0
/
.colors
44 lines (34 loc) · 814 Bytes
/
.colors
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
if test -n "$ZSH_VERSION"; then
autoload colors
if [[ "$terminfo[colors]" -gt 8 ]]; then
colors
fi
fi
if [[ ! -z $reset_color ]]; then
for COLOR in RED GREEN YELLOW BLUE MAGENTA CYAN BLACK WHITE; do
eval COLOR_$COLOR='$fg_no_bold[${(L)COLOR}]'
eval COLOR_BOLD_$COLOR='$fg_bold[${(L)COLOR}]'
done
eval COLOR_RESET='$reset_color'
fi
export CHAR_OK=✔
export CHAR_ERROR=✗
export CHAR_STARTER=❯
function _title() {
echo -n "$2${COLOR_CYAN}${CHAR_STARTER} $@${COLOR_RESET}"
}
function _info() {
echo -n "$2${COLOR_BLUE}i${COLOR_RESET} $1"
}
function _success() {
echo -n "$2${COLOR_GREEN}${CHAR_OK}${COLOR_RESET} $1"
}
function _fail() {
echo -n "$2${COLOR_RED}${CHAR_ERROR}${COLOR_RESET} $1"
}
function _cr() {
echo -ne "\r\033[0K"
}
function _nl() {
echo -ne "\n"
}