Added moonglum.zsh-theme

This commit is contained in:
moonglum 2012-05-21 17:51:15 +02:00
commit 08eedfea07

19
themes/moonglum.zsh-theme Normal file
View file

@ -0,0 +1,19 @@
local smiley="%(?,%{$fg[green]%}☺%{$reset_color%},%{$fg[red]%}☹%{$reset_color%}) "
function git-status() {
if [[ `git rev-parse --git-dir 2>/dev/null` != '' ]]; then
# We are in a git repo
local gitdirty=""
if [[ `git ls-files -m` != "" ]]; then
# There are changes to files
gitdirty="%{$fg[red]%} ✗%{$reset_color%}"
fi
echo ' @' `git symbolic-ref -q HEAD | sed 's/refs\/heads\///'` $gitdirty
fi
}
PROMPT='${smiley}'
RPROMPT='%~$(git-status)'