diff options
author | Robby Russell <robby@planetargon.com> | 2013-12-02 23:18:31 -0800 |
---|---|---|
committer | Robby Russell <robby@planetargon.com> | 2013-12-02 23:18:31 -0800 |
commit | 1badb744bf12935273db4adb2eb327908be5bc5e (patch) | |
tree | d34ea97e2d69a704a5d90261e3073f109291684c | |
parent | 1c185f0055573376a302aaa2467982e5c0db1385 (diff) | |
parent | bcd5b3b52b35a458df87b204119eb18a264a580b (diff) | |
download | zsh-1badb744bf12935273db4adb2eb327908be5bc5e.tar.gz zsh-1badb744bf12935273db4adb2eb327908be5bc5e.tar.bz2 zsh-1badb744bf12935273db4adb2eb327908be5bc5e.zip |
Merge pull request #948 from excepttheweasel/master
Added peepcode theme
-rw-r--r-- | themes/peepcode.zsh-theme | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/themes/peepcode.zsh-theme b/themes/peepcode.zsh-theme new file mode 100644 index 000000000..ca2a8862f --- /dev/null +++ b/themes/peepcode.zsh-theme @@ -0,0 +1,44 @@ +# +# Based on Geoffrey Grosenbach's peepcode zsh theme from +# https://github.com/topfunky/zsh-simple +# + +git_repo_path() { + git rev-parse --git-dir 2>/dev/null +} + +git_commit_id() { + git rev-parse --short HEAD 2>/dev/null +} + +git_mode() { + if [[ -e "$repo_path/BISECT_LOG" ]]; then + echo "+bisect" + elif [[ -e "$repo_path/MERGE_HEAD" ]]; then + echo "+merge" + elif [[ -e "$repo_path/rebase" || -e "$repo_path/rebase-apply" || -e "$repo_path/rebase-merge" || -e "$repo_path/../.dotest" ]]; then + echo "+rebase" + fi +} + +git_dirty() { + if [[ "$repo_path" != '.' && `git ls-files -m` != "" ]]; then + echo " %{$fg_bold[grey]%}✗%{$reset_color%}" + fi +} + +git_prompt() { + local cb=$(current_branch) + if [ -n "$cb" ]; then + local repo_path=$(git_repo_path) + echo " %{$fg_bold[grey]%}$cb %{$fg[white]%}$(git_commit_id)%{$reset_color%}$(git_mode)$(git_dirty)" + fi +} + +local smiley="%(?,%{$fg[green]%}☺%{$reset_color%},%{$fg[red]%}☹%{$reset_color%})" + +PROMPT=' +%~ +${smiley} %{$reset_color%}' + +RPROMPT='%{$fg[white]%} $(~/.rvm/bin/rvm-prompt)$(git_prompt)%{$reset_color%}' |