-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.prompt.zshrc
More file actions
31 lines (25 loc) · 754 Bytes
/
.prompt.zshrc
File metadata and controls
31 lines (25 loc) · 754 Bytes
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
# From http://d.hatena.ne.jp/mollifier/20090814/p1
autoload -Uz vcs_info
zstyle ':vcs_info:*' formats '%b'
zstyle ':vcs_info:*' actionformats '%b|%a'
# Set initial color
# ZSHFG=`expr $RANDOM / 128`
ZSHFG=$((196 + ($RANDOM % 20)))
precmd () {
# Set git info into 1v
psvar=()
LANG=en_US.UTF-8 vcs_info
[[ -n "$vcs_info_msg_0_" ]] && psvar[1]="$vcs_info_msg_0_"
# Reset at max
if [ $ZSHFG -ge 216 ]
then
ZSHFG=196
fi
# Increment it
ZSHFG=`expr $ZSHFG + 1`
# Define prompt with new color at each prompt
# See: http://zsh.sourceforge.net/Doc/Release/Functions.html#index-precmd
RPROMPT="%F{240}%* %f%F{$ZSHFG}%~% %(!.#.)%f%1(v|%F{240} %1v%f|)"
PROMPT="%F{$ZSHFG}$%f "
}
SPROMPT="%B%F{256}%K{200}%r ? %f%k%}%b n,y,a,e :"