10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
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
|
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
WORDCHARS="*?[];!#~"
local grep=""
local grep_color="auto"
local ls=""
local ls_color="auto"
local ls_on_cd="yes"
local ls_on_init="no"
local simple_prompt="no"
if [ "$terminfo[colors]" = 16777216 ]; then
local color_cwd="#209060"
local color_host="#176945"
local color_suffix="#29bc7d"
local color_vcs="#43d696"
local color_vcs_braces="#29bc7d"
else
local color_cwd="29"
local color_host="23"
local color_suffix="36"
local color_vcs="78"
local color_vcs_braces="36"
fi
local color_jobs="yellow"
local color_status="red"
bindkey -v
# history-incremental-search-backward is much more useful than
# _history-complete-*
bindkey "^R" history-incremental-search-backward
# Add a few other emacs bindings for convenience, as it's sometimes quicker to
# use those than to switch between modes.
|
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
|
}
;;
*)
__update_terminal_cwd() {}
;;
esac
if [ "$simple_prompt" = yes ]; then
set_prompt() {
local branch
[ -n "$1" ] && branch="%F{black}%B(%b%F{cyan}$1%F{black}%B)%b%f"
set_prompt() {
if [ -n "$1" ]; then
local branch="%F{$color_vcs_braces}(%F{$color_vcs}$1"
branch+="%F{$color_vcs_braces})"
fi
PS1="%m:%c$branch%B%(!.#.$)%b "
PS2="%B>%b "
RPS1="%(1j.%F{yellow}%j%f.)%(?..%(1j. .)%F{red}%?%f)"
RPS2="%(1_.%F{black}%B(%_%)%b%f.)"
}
else
set_prompt() {
local branch
[ -n "$1" ] && branch="%F{36}(%F{78}$1%F{36})"
PS1="%F{23}%m %F{29}%c$branch%F{36}%(!.#.>)%f "
PS2="%B>%b "
RPS1="%(1j.%F{yellow}%j%f.)%(?..%(1j. .)%F{red}%?%f)"
RPS2="%(1_.%F{black}%B(%_%)%b%f.)"
}
PS1="%F{$color_host}%m %F{$color_cwd}%c$branch"
PS1+="%F{$color_suffix}%(!.#.>)%f "
PS2="%B>%b "
RPS1="%(1j.%F{$color_jobs}%B%j%b%f.)%(?..%(1j. .)"
RPS1+="%F{$color_status}%B%?%b%f)"
RPS2="%(1_.%F{black}%B(%_%)%b%f.)"
}
fi
set_prompt
__precmd() {
__update_terminal_cwd
local branch=$(fossil branch current 2>/dev/null)
|