-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathair.zsh-theme
32 lines (26 loc) · 953 Bytes
/
air.zsh-theme
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
local resetColor="%{$reset_color%}"
local dir="%{$fg[cyan]%}%c$resetColor$resetColor"
local time="%{$fg[blue]%}%D{[%H:%M:%S]}$resetColor"
local icon="%{$fg[blue]%}➜$resetColor"
REPOSIRORY_PROMPT_PREFIX="(%{$fg[blue]%}"
REPOSIRORY_PROMPT_SUFFIX="$resetColor) "
function print_branch() {
if [ "$1" = '' ]; then
echo ''
else
[[ $2 = '' ]] && CHANGES=" *" || CHANGES=""
echo "$REPOSIRORY_PROMPT_PREFIX$1$CHANGES$REPOSIRORY_PROMPT_SUFFIX"
fi
}
function git_prompt() {
arcadia=`pwd | grep 'arcadia'`
if [[ $arcadia == '' ]]; then
branch=`git_current_branch`
[[ $branch != '' ]] && changes=`git status | grep 'nothing to commit, working directory clean'`
else
branch=`arc info | grep 'branch:' | sed 's/branch: //'`
changes=`arc status | grep 'nothing to commit, working directory clean'`
fi
print_branch $branch $changes
}
PROMPT='$icon $time $dir $(git_prompt)'