-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzsh_theme
37 lines (32 loc) · 1.17 KB
/
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
PROMPT='%{$fg[cyan]%}%n%{$reset_color%} on %{$fg[red]%}%M%{$reset_color%} $(check_git_prompt_info)
$ '
RPROMPT='%{$fg[cyan]%}%~%b%{$reset_color%}'
# ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%}"
# ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%})"
ZSH_THEME_GIT_PROMPT_PREFIX=""
ZSH_THEME_GIT_PROMPT_SUFFIX=")"
# Text to display if the branch is dirty
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}"
# Text to display if the branch is clean
ZSH_THEME_GIT_PROMPT_CLEAN=""
# Git sometimes goes into a detached head state. git_prompt_info doesn't
# return anything in this case. So wrap it in another function and check
# for an empty string.
function check_git_prompt_info() {
if git rev-parse --git-dir > /dev/null 2>&1; then
if [[ -z $(git_prompt_info) ]]; then
echo "(%{$fg[magenta]%}detached-head%{$reset_color%})"
else
echo "($(git_prompt_info)"
fi
fi
}
# Determine if we are using a gemset.
function rvm_gemset() {
if hash rvm 2>/dev/null; then
GEMSET=`rvm gemset list | grep '=>' | cut -b4-`
if [[ -n $GEMSET ]]; then
echo "%{$fg[yellow]%}$GEMSET%{$reset_color%}|"
fi
fi
}