aboutsummaryrefslogtreecommitdiff
path: root/zshrc.d/prompt
blob: 72cbf44e6a4e5f0ed673d9a158cc07bc71538a1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# vim: ft=zsh

# Disable default prompt
command -v prompt >/dev/null && prompt off

[ $UID -eq 0 ] && NCOLOR="red" || NCOLOR="green"
PROMPT="%(?..%{$fg_bold[yellow]%}EXIT: %?
)%{$fg_bold[$NCOLOR]%}%n@%m:%{$fg_bold[blue]%}%1~%{$fg_bold[$NCOLOR]%}%(!.#.$)%{$reset_color%} "
unset NCOLOR

if [ -e /usr/share/git/git-prompt.sh ]; then
	source /usr/share/git/git-prompt.sh
	export GIT_PS1_SHOWCOLORHINTS=y
	export GIT_PS1_SHOWDIRTYSTATE=y
	export GIT_PS1_SHOWUNTRACKEDFILES=y
	export GIT_PS1_SHOWUPSTREAM="auto"
	export GIT_PS1_STATESEPARATOR=""
	export GIT_PS1_SHOWUPSTREAM=y
	export GIT_PS1_DESCRIBE_STYLE="branch"
	RPROMPT='$(__git_ps1 "%s")'
fi