-
Notifications
You must be signed in to change notification settings - Fork 0
/
fattyarrow.zsh-theme
62 lines (54 loc) · 1.42 KB
/
fattyarrow.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
export VIRTUAL_ENV_DISABLE_PROMPT=yes
autoload -U add-zsh-hook
function time_indicator {
psvar[1]=' time: '`date +"%T"`
}
add-zsh-hook precmd time_indicator
function root_indicator {
if [[ $UID -eq 0 ]] then
psvar[2]=' root'
else
psvar[2]=''
fi
}
add-zsh-hook precmd root_indicator
function last_cmd_indicator {
if [[ $? -eq 0 ]] then
psvar[3]=''
else
psvar[3]=' exit: '`echo $?`
fi
}
add-zsh-hook precmd last_cmd_indicator
function git_indicator {
git rev-parse >& /dev/null
if [[ $? -eq 0 ]] then
if [[ -n "$(git status --porcelain)" ]] then
psvar[4]=' git: '`git rev-parse --abbrev-ref HEAD 2> /dev/null`'*'
else
psvar[4]=' git: '`git rev-parse --abbrev-ref HEAD 2> /dev/null`
fi
else
psvar[4]=''
fi
}
add-zsh-hook precmd git_indicator
function virtenv_indicator {
if [[ -z $VIRTUAL_ENV ]] then
psvar[5]=''
else
psvar[5]=' virtualenv: '${VIRTUAL_ENV##*/}
fi
}
add-zsh-hook precmd virtenv_indicator
function nvm_indicator {
if [[ -z $NVM_DIR ]] then
psvar[6]=''
else
psvar[6]=' nvm: '`node -v 2> /dev/null`
fi
}
add-zsh-hook precmd nvm_indicator
PROMPT="
%{$fg[blue]%}%~%{$reset_color%}%{$fg[magenta]%}%(1V.%1v.)%{$fg[red]%}%(2V.%2v.)%(3V.%3v.)%{$fg[cyan]%}%(4V.%4v.)%{$fg[yellow]%}%(5V.%5v.)%{$fg[green]%}%(6V.%6v.)
%{$fg[yellow]%}=> %{$reset_color%}"