715be61966acecb4d30953e3dd4c9d8a3f8637eb

Author
Clement Girault <sub@transatmedia.com>
Committer
Clement Girault <sub@transatmedia.com>
Date

Message

New theme, Read contents for further customising.

Diff

This diff is truncated to protect this page.

  1diff --git a/themes/wedisagree.zsh-theme b/themes/wedisagree.zsh-theme
  2new file mode 100644
  3index 0000000000000000000000000000000000000000..7cb27934dad51edbf31035070fe91309c8827e7b
  4--- /dev/null
  5+++ b/themes/wedisagree.zsh-theme
  6@@ -0,0 +1,107 @@
  7+# On a mac with snow leopard, for nicer terminal colours:
  8+
  9+# - Install SIMBL: http://www.culater.net/software/SIMBL/SIMBL.php
 10+# - Download'Terminal-Colours': http://bwaht.net/code/TerminalColours.bundle.zip
 11+# - Place that bundle in ~/Library/Application\ Support/SIMBL/Plugins (create that folder if it doesn't exist)
 12+# - Open Terminal preferences. Go to Settings -> Text -> More
 13+# - Change default colours to your liking.
 14+# 
 15+# Here are the colours from Textmate's Monokai theme:
 16+# 
 17+# Black: 0, 0, 0
 18+# Red: 229, 34, 34
 19+# Green: 166, 227, 45
 20+# Yellow: 252, 149, 30
 21+# Blue: 196, 141, 255
 22+# Magenta: 250, 37, 115
 23+# Cyan: 103, 217, 240
 24+# White: 242, 242, 242
 25+
 26+# Thanks to Steve Losh: http://stevelosh.com/blog/2009/03/candy-colored-terminal/
 27+
 28+# The prompt
 29+
 30+PROMPT='%{$fg[magenta]%}[%c] %{$reset_color%}'
 31+
 32+# The right-hand prompt
 33+
 34+RPROMPT='${time} %{$fg[magenta]%}$(git_prompt_info)%{$reset_color%}$(git_prompt_status)%{$reset_color%}'
 35+
 36+# Add this at the start of RPROMPT to include rvm info showing ruby-version@gemset-name
 37+# %{$fg[yellow]%}$(~/.rvm/bin/rvm-prompt)%{$reset_color%} 
 38+
 39+# local time, color coded by last return code
 40+time_enabled="%(?.%{$fg[green]%}.%{$fg[red]%})%*%{$reset_color%}"
 41+time_disabled="%{$fg[green]%}%*%{$reset_color%}"
 42+time=$time_enabled
 43+
 44+ZSH_THEME_GIT_PROMPT_PREFIX=" ☁  %{$fg[red]%}"
 45+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
 46+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%} ☂" # Ⓓ
 47+ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" # ⓣ
 48+ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%} ☀" # Ⓞ
 49+
 50+ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%} ✚" # ⓐ ⑃
 51+ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%} ⚡"  # ⓜ ⑁
 52+ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖" # ⓧ ⑂
 53+ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%} ➜" # ⓡ ⑄
 54+ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%} ♒" # ⓤ ⑊
 55+
 56+# More symbols to choose from:
 57+# ☀ ✹ ☄ ♆ ♀ ♁ ♐ ♇ ♈ ♉ ♚ ♛ ♜ ♝ ♞ ♟ ♠ ♣ ⚢ ⚲ ⚳ ⚴ ⚥ ⚤ ⚦ ⚒ ⚑ ⚐ ♺ ♻ ♼ ☰ ☱ ☲ ☳ ☴ ☵ ☶ ☷
 58+# ✡ ✔ ✖ ✚ ✱ ✤ ✦ ❤ ➜ ➟ ➼ ✂ ✎ ✐ ⨀ ⨁ ⨂ ⨍ ⨎ ⨏ ⨷ ⩚ ⩛ ⩡ ⩱ ⩲ ⩵  ⩶ ⨠ 
 59+# ⬅ ⬆ ⬇ ⬈ ⬉ ⬊ ⬋ ⬒ ⬓ ⬔ ⬕ ⬖ ⬗ ⬘ ⬙ ⬟  ⬤ 〒 ǀ ǁ ǂ ĭ Ť Ŧ
 60+
 61+# Determine if we are using a gemset.
 62+function rvm_gemset() {
 63+    GEMSET=`rvm gemset list | grep '=>' | cut -b4-`
 64+    if [[ -n $GEMSET ]]; then
 65+        echo "%{$fg[yellow]%}$GEMSET%{$reset_color%}|"
 66+    fi 
 67+}
 68+
 69+# Determine the time since last commit. If branch is clean,
 70+# use a neutral color, otherwise colors will vary according to time.
 71+function git_time_since_commit() {
 72+    if git rev-parse --git-dir > /dev/null 2>&1; then
 73+        # Only proceed if there is actually a commit.
 74+        if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then
 75+            # Get the last commit.
 76+            last_commit=`git log --pretty=format:'%at' -1 2> /dev/null`
 77+            now=`date +%s`
 78+            seconds_since_last_commit=$((now-last_commit))
 79+
 80+            # Totals
 81+            MINUTES=$((seconds_since_last_commit / 60))
 82+            HOURS=$((seconds_since_last_commit/3600))
 83+           
 84+            # Sub-hours and sub-minutes
 85+            DAYS=$((seconds_since_last_commit / 86400))
 86+            SUB_HOURS=$((HOURS % 24))
 87+            SUB_MINUTES=$((MINUTES % 60))
 88+            
 89+            if [[ -n $(git status -s 2> /dev/null) ]]; then
 90+                if [ "$MINUTES" -gt 30 ]; then
 91+                    COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG"
 92+                elif [ "$MINUTES" -gt 10 ]; then
 93+                    COLOR="$ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM"
 94+                else
 95+                    COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT"
 96+                fi
 97+            else
 98+                COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL"
 99+            fi
100+
101+            if [ "$HOURS" -gt 24 ]; then
102+                echo "($(rvm_gemset)$COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}|"
103+            elif [ "$MINUTES" -gt 60 ]; then
104+                echo "($(rvm_gemset)$COLOR${HOURS}h${SUB_MINUTES}m%{$reset_color%}|"
105+            else