From 08eedfea07eca8697cac81fc4f6c4458d19e3f9c Mon Sep 17 00:00:00 2001 From: moonglum Date: Mon, 21 May 2012 17:51:15 +0200 Subject: [PATCH] Added moonglum.zsh-theme --- themes/moonglum.zsh-theme | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 themes/moonglum.zsh-theme diff --git a/themes/moonglum.zsh-theme b/themes/moonglum.zsh-theme new file mode 100644 index 000000000..d262b64d2 --- /dev/null +++ b/themes/moonglum.zsh-theme @@ -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)' \ No newline at end of file