Skip to content
Browse files

update themes

  • Loading branch information...
1 parent 2ac2668 commit a06c4f2cd1eb3b9b5f22229c7c709ab5a9c5cdc5 @wfarr committed Aug 1, 2012
Showing with 27 additions and 167 deletions.
  1. +14 −29 templates/zshrc.zsh-template
  2. +13 −138 themes/wfarr.zsh-theme
View
43 templates/zshrc.zsh-template
@@ -1,35 +1,7 @@
-# Path to your oh-my-zsh configuration.
export ZSH=$HOME/.oh-my-zsh
-
-# Set name of the theme to load.
-# Look in ~/.oh-my-zsh/themes/
-# Optionally, if you set this to "random", it'll load a random theme each
-# time that oh-my-zsh is loaded.
export ZSH_THEME="wfarr"
-
-# Example aliases
-alias zshconfig="mate ~/.zshrc"
-alias ohmyzsh="mate ~/.oh-my-zsh"
-
-# Set to this to use case-sensitive completion
-# export CASE_SENSITIVE="true"
-
-# Comment this out to disable weekly auto-update checks
export DISABLE_AUTO_UPDATE="true"
-
-# Uncomment following line if you want to disable colors in ls
-# export DISABLE_LS_COLORS="true"
-
-# Uncomment following line if you want to disable autosetting terminal title.
-# DISABLE_AUTO_TITLE="true"
-
-# Uncomment following line if you want red dots to be displayed while waiting for completion
-COMPLETION_WAITING_DOTS="true"
-
-# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
-# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
-# Example format: plugins=(rails git textmate ruby lighthouse)
-plugins=(brew git github osx)
+export COMPLETION_WAITING_DOTS="true"
source $ZSH/oh-my-zsh.sh
@@ -40,4 +12,17 @@ export EDITOR='vim'
alias reload!='. ~/.zshrc'
alias be='nocorrect bundle exec'
+gitio() {
+ local response=`curl -s -i http://git.io/ -F "url=$1"`
+
+ if [ ($response | grep 'Status: 201 Created') ]; then
+ local link=`echo $response | grep Location | cut -f 2 -d ' '`
+ echo "short url: $link"
+ echo $link | pbcopy
+ else
+ echo "Bad response!"
+ exit 1
+ fi
+}
+
source /opt/github/env.sh
View
151 themes/wfarr.zsh-theme
@@ -1,138 +1,13 @@
-autoload colors && colors
-# cheers, @ehrenmurdick
-# http://github.com/ehrenmurdick/config/blob/master/zsh/prompt.zsh
-
-###
-# This stuff politely borrowed from http://zanshin.net/2011/08/12/oh-my-zsh/
-###
-
-# Colors vary depending on time lapsed.
-ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}"
-ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}"
-ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}"
-ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}"
-
-function git_time_since_commit() {
- if git rev-parse --git-dir > /dev/null 2>&1; then
- # Only proceed if there is actually a commit.
- if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then
- # Get the last commit.
- last_commit=`git log --pretty=format:'%at' -1 2> /dev/null`
- now=`date +%s`
- seconds_since_last_commit=$((now-last_commit))
-
- # Totals
- MINUTES=$((seconds_since_last_commit / 60))
- HOURS=$((seconds_since_last_commit/3600))
-
- # Sub-hours and sub-minutes
- DAYS=$((seconds_since_last_commit / 86400))
- SUB_HOURS=$((HOURS % 24))
- SUB_MINUTES=$((MINUTES % 60))
-
- if [[ -n $(git status -s 2> /dev/null) ]]; then
- if [ "$MINUTES" -gt 30 ]; then
- COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG"
- elif [ "$MINUTES" -gt 10 ]; then
- COLOR="$ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM"
- else
- COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT"
- fi
- else
- COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL"
- fi
-
- if [ "$HOURS" -gt 24 ]; then
- echo "$COLOR(${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m)"
- elif [ "$MINUTES" -gt 60 ]; then
- echo "$COLOR(${HOURS}h${SUB_MINUTES}m)"
- else
- echo "$COLOR(${MINUTES}m)"
- fi
- else
- COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL"
- echo "$COLOR(~)"
- fi
- fi
-}
-
-### END BORROWED WITH LOVE
-
-git_branch() {
- echo $(/usr/bin/git symbolic-ref HEAD 2>/dev/null | awk -F/ {'print $NF'})
-}
-
-git_dirty() {
- st=$(/usr/bin/git status 2>/dev/null | tail -n 1)
- if [[ $st == "" ]]
- then
- echo ""
- else
- if [[ $st == "nothing to commit (working directory clean)" ]]
- then
- echo "on %{$fg_bold[green]%}$(git_prompt_info)%{$reset_color%}"
- else
- echo "on %{$fg_bold[red]%}$(git_prompt_info) $(git_time_since_commit)%{$reset_color%}"
- fi
- fi
-}
-
-git_prompt_info () {
- ref=$(/usr/bin/git symbolic-ref HEAD 2>/dev/null) || return
-# echo "(%{\e[0;33m%}${ref#refs/heads/}%{\e[0m%})"
- echo "${ref#refs/heads/}"
-}
-
-unpushed () {
- /usr/bin/git cherry -v origin/$(git_branch) 2>/dev/null
-}
-
-need_push () {
- if [[ $(unpushed) == "" ]]
- then
- echo " "
- else
- echo " with %{$fg[red]%}unpushed%{$reset_color%} "
- fi
-}
-
-rbenv_prompt(){
- if $(which rbenv &> /dev/null)
- then
- echo "%{$fg_bold[blue]%}$(rbenv version-name)%{$reset_color%}"
- else
- echo ""
- fi
-}
-
-# This keeps the number of todos always available the right hand side of my
-# command line. I filter it to only count those tagged as "+next", so it's more
-# of a motivation to clear out the list.
-todo(){
- if $(which todo.sh &> /dev/null)
- then
- num=$(echo $(todo.sh ls +next | wc -l))
- let todos=num-2
- if [ $todos != 0 ]
- then
- echo "$todos"
- else
- echo ""
- fi
- else
- echo ""
- fi
-}
-
-directory_name(){
- echo "%{$fg_bold[yellow]%}%1/%\/%{$reset_color%}"
-}
-
-export PROMPT=$'\n$(rbenv_prompt) in $(directory_name) $(git_dirty)$(need_push)\n› '
-set_prompt () {
- export RPROMPT="%{$fg_bold[grey]%}$(todo)%{$reset_color%}"
-}
-
-precmd() {
- set_prompt
-}
+if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi
+local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
+
+PROMPT='%{$fg[blue]%}%~\
+$(git_prompt_info) \
+%{$fg[red]%}%(!.#.»)%{$reset_color%} '
+PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
+RPS1='${return_code}'
+
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}("
+ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}○%{$reset_color%}"
+ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}⚡%{$reset_color%}"
+ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[yellow]%})%{$reset_color%}"

0 comments on commit a06c4f2

Please sign in to comment.
Something went wrong with that request. Please try again.