13998bb2cc12d11c16728e4b1db0d2a326ca6607

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge branch 'master' of github.com:robbyrussell/oh-my-zsh

Diff

  1diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
  2index ddef1ad6cf280b2c4ce53af32a77f8e493bab7fc..4a5b175d5b488816d1558ddfceb615d0bcff1b78 100644
  3--- a/oh-my-zsh.sh
  4+++ b/oh-my-zsh.sh
  5@@ -11,7 +11,9 @@ fpath=($ZSH/functions $ZSH/completions $fpath)
  6 
  7 # Load all of the config files in ~/oh-my-zsh that end in .zsh
  8 # TIP: Add files you don't want in git to .gitignore
  9-for config_file ($ZSH/lib/*.zsh) source $config_file
 10+for config_file ($ZSH/lib/*.zsh); do
 11+  source $config_file
 12+done
 13 
 14 # Set ZSH_CUSTOM to the path where your custom config files
 15 # and plugins exists, or else we will use the default custom/
 16@@ -51,7 +53,9 @@ for plugin ($plugins); do
 17 done
 18 
 19 # Load all of your custom configurations from custom/
 20-for config_file ($ZSH_CUSTOM/*.zsh(N)) source $config_file
 21+for config_file ($ZSH_CUSTOM/*.zsh(N)); do
 22+  source $config_file
 23+done
 24 
 25 # Load the theme
 26 if [ "$ZSH_THEME" = "random" ]
 27diff --git a/plugins/autojump/autojump.plugin.zsh b/plugins/autojump/autojump.plugin.zsh
 28index fdce3a246eb97aa5fb7a36e66741bc21f24d87d0..3894ccd2f56c392f004327a5931b6b6a327b02b3 100644
 29--- a/plugins/autojump/autojump.plugin.zsh
 30+++ b/plugins/autojump/autojump.plugin.zsh
 31@@ -3,6 +3,8 @@ if [ $commands[autojump] ]; then # check if autojump is installed
 32     . /usr/share/autojump/autojump.zsh
 33   elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation
 34     . /etc/profile.d/autojump.zsh
 35+  elif [ -f $HOME/.autojump/etc/profile.d/autojump.zsh ]; then # manual user-local installation
 36+    . $HOME/.autojump/etc/profile.d/autojump.zsh
 37   elif [ -f /opt/local/etc/profile.d/autojump.zsh ]; then # mac os x with ports
 38     . /opt/local/etc/profile.d/autojump.zsh
 39   elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump.zsh ]; then # mac os x with brew
 40diff --git a/plugins/rvm/rvm.plugin.zsh b/plugins/rvm/rvm.plugin.zsh
 41index 27f29f2b338cd073d7e4315f867fe748ec81579f..1ab800b0f9c9ee12a63a823b6a4660e5bfa23618 100644
 42--- a/plugins/rvm/rvm.plugin.zsh
 43+++ b/plugins/rvm/rvm.plugin.zsh
 44@@ -4,7 +4,7 @@ alias rubies='rvm list rubies'
 45 alias gemsets='rvm gemset list'
 46 
 47 local ruby18='ruby-1.8.7-p334'
 48-local ruby19='ruby-1.9.2-p180'
 49+local ruby19='ruby-1.9.3-p194'
 50 
 51 function rb18 {
 52 	if [ -z "$1" ]; then
 53@@ -44,3 +44,8 @@ function gems {
 54 		-Ee "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \
 55 		-Ee "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g"
 56 }
 57+
 58+function _rvm_completion {
 59+  source $rvm_path"/scripts/zsh/Completion/_rvm"
 60+}
 61+compdef _rvm_completion rvm
 62diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
 63index 5d0860400a0d83bd98912a7bd1a7470f6031a5b8..a5abb77c3f26a9e0ac6b664f483471090be602e9 100644
 64--- a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
 65+++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
 66@@ -1,46 +1,40 @@
 67-WRAPPER_FOUND=0
 68-for wrapsource in "/usr/bin/virtualenvwrapper.sh" "/usr/local/bin/virtualenvwrapper.sh" "/etc/bash_completion.d/virtualenvwrapper" ; do
 69-  if [[ -e $wrapsource ]] ; then
 70-    WRAPPER_FOUND=1
 71-    source $wrapsource
 72+wrapsource=`which virtualenvwrapper.sh`
 73 
 74-    if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then
 75-      # Automatically activate Git projects' virtual environments based on the
 76-      # directory name of the project. Virtual environment name can be overridden
 77-      # by placing a .venv file in the project root with a virtualenv name in it
 78-      function workon_cwd {
 79-          # Check that this is a Git repo
 80-          PROJECT_ROOT=`git rev-parse --show-toplevel 2> /dev/null`
 81-          if (( $? == 0 )); then
 82-              # Check for virtualenv name override
 83-              ENV_NAME=`basename "$PROJECT_ROOT"`
 84-              if [[ -f "$PROJECT_ROOT/.venv" ]]; then
 85-                  ENV_NAME=`cat "$PROJECT_ROOT/.venv"`
 86-              fi
 87-              # Activate the environment only if it is not already active
 88-              if [[ "$VIRTUAL_ENV" != "$WORKON_HOME/$ENV_NAME" ]]; then
 89-                  if [[ -e "$WORKON_HOME/$ENV_NAME/bin/activate" ]]; then
 90-                      workon "$ENV_NAME" && export CD_VIRTUAL_ENV="$ENV_NAME"
 91-                  fi
 92-              fi
 93-          elif [ $CD_VIRTUAL_ENV ]; then
 94-              # We've just left the repo, deactivate the environment
 95-              # Note: this only happens if the virtualenv was activated automatically
 96-              deactivate && unset CD_VIRTUAL_ENV
 97-          fi
 98-          unset PROJECT_ROOT
 99-      }
100+if [[ -f "$wrapsource" ]]; then
101+  source $wrapsource
102 
103-      # New cd function that does the virtualenv magic
104-      function cd {
105-          builtin cd "$@" && workon_cwd
106-      }
107-    fi
108+  if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then
109+    # Automatically activate Git projects' virtual environments based on the
110+    # directory name of the project. Virtual environment name can be overridden
111+    # by placing a .venv file in the project root with a virtualenv name in it
112+    function workon_cwd {
113+        # Check that this is a Git repo
114+        PROJECT_ROOT=`git rev-parse --show-toplevel 2> /dev/null`
115+        if (( $? == 0 )); then
116+            # Check for virtualenv name override
117+            ENV_NAME=`basename "$PROJECT_ROOT"`
118+            if [[ -f "$PROJECT_ROOT/.venv" ]]; then
119+                ENV_NAME=`cat "$PROJECT_ROOT/.venv"`
120+            fi
121+            # Activate the environment only if it is not already active
122+            if [[ "$VIRTUAL_ENV" != "$WORKON_HOME/$ENV_NAME" ]]; then
123+                if [[ -e "$WORKON_HOME/$ENV_NAME/bin/activate" ]]; then
124+                    workon "$ENV_NAME" && export CD_VIRTUAL_ENV="$ENV_NAME"
125+                fi
126+            fi
127+        elif [ $CD_VIRTUAL_ENV ]; then
128+            # We've just left the repo, deactivate the environment
129+            # Note: this only happens if the virtualenv was activated automatically
130+            deactivate && unset CD_VIRTUAL_ENV
131+        fi
132+        unset PROJECT_ROOT
133+    }
134 
135-    break
136+    # New cd function that does the virtualenv magic
137+    function cd {
138+        builtin cd "$@" && workon_cwd
139+    }
140   fi
141-done
142-
143-if [ $WRAPPER_FOUND -eq 0 ] ; then
144-  print "zsh virtualenvwrapper plugin: Couldn't activate virtualenvwrapper. Please run \`pip install virtualenvwrapper\`."
145+else
146+  print "zsh virtualenvwrapper plugin: Cannot find virtualenvwrapper.sh. Please install with \`pip install virtualenvwrapper\`."
147 fi
148diff --git a/themes/fishy.zsh-theme b/themes/fishy.zsh-theme
149index f9e506cae77d27e5782b4479c4683082bdcf0da0..e9f78a54e426b92a457306049b578bc58b135aab 100644
150--- a/themes/fishy.zsh-theme
151+++ b/themes/fishy.zsh-theme
152@@ -1,7 +1,11 @@
153 # ZSH Theme emulating the Fish shell's default prompt.
154 
155+_fishy_collapsed_wd() {
156+  echo $(pwd | perl -pe "s|^$HOME|~|g; s|/([^/])[^/]*(?=/)|/\$1|g")
157+}
158+
159 local user_color='green'; [ $UID -eq 0 ] && user_color='red'
160-PROMPT='%n@%m %{$fg[$user_color]%}%~%{$reset_color%}%(!.#.>) '
161+PROMPT='%n@%m %{$fg[$user_color]%}$(_fishy_collapsed_wd)%{$reset_color%}%(!.#.>) '
162 PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
163 
164 local return_status="%{$fg_bold[red]%}%(?..%?)%{$reset_color%}"
165diff --git a/themes/jonathan.zsh-theme b/themes/jonathan.zsh-theme
166index 2f0c4b917a18d7023d1bc26d7f3235a58a6ca8a8..9f0f3027163637ebd286a85f4866945c0b487b5b 100644
167--- a/themes/jonathan.zsh-theme
168+++ b/themes/jonathan.zsh-theme
169@@ -1,3 +1,5 @@
170+functions rbenv_prompt_info >& /dev/null || rbenv_prompt_info(){}
171+
172 function theme_precmd {
173     local TERMWIDTH
174     (( TERMWIDTH = ${COLUMNS} - 1 ))