Diff
1diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
2index c2b6049cbcba4db8963673e6093690d6f1721b0e..ddef1ad6cf280b2c4ce53af32a77f8e493bab7fc 100644
3--- a/oh-my-zsh.sh
4+++ b/oh-my-zsh.sh
5@@ -51,7 +51,7 @@ for plugin ($plugins); do
6 done
7
8 # Load all of your custom configurations from custom/
9-for config_file ($ZSH_CUSTOM/*.zsh(.N)) source $config_file
10+for config_file ($ZSH_CUSTOM/*.zsh(N)) source $config_file
11
12 # Load the theme
13 if [ "$ZSH_THEME" = "random" ]
14diff --git a/plugins/jruby/jruby.plugin.zsh b/plugins/jruby/jruby.plugin.zsh
15new file mode 100755
16index 0000000000000000000000000000000000000000..bb7975b1071c2966f68bbf354123982f8397db32
17--- /dev/null
18+++ b/plugins/jruby/jruby.plugin.zsh
19@@ -0,0 +1,4 @@
20+# Aliases
21+alias jrspec='jruby --debug -S rspec --debug'
22+alias jprofile='jruby --profile.api -S rspec'
23+alias jexec='jruby -S'
24diff --git a/plugins/rbenv/rbenv.plugin.zsh b/plugins/rbenv/rbenv.plugin.zsh
25index ae37404cd8328ab621cb4f8ab804cc143efbe9c0..a62dd560209e7a63b782e3043e4300bbbd07a252 100644
26--- a/plugins/rbenv/rbenv.plugin.zsh
27+++ b/plugins/rbenv/rbenv.plugin.zsh
28@@ -1,5 +1,18 @@
29+_homebrew-installed() {
30+ type brew &> /dev/null
31+}
32+
33+_rbenv-from-homebrew-installed() {
34+ brew --prefix rbenv &> /dev/null
35+}
36+
37 FOUND_RBENV=0
38-for rbenvdir in "$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv" ; do
39+rbenvdirs=("$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv")
40+if _homebrew-installed && _rbenv-from-homebrew-installed ; then
41+ rbenvdirs=($(brew --prefix rbenv) "${rbenvdirs[@]}")
42+fi
43+
44+for rbenvdir in "${rbenvdirs[@]}" ; do
45 if [ -d $rbenvdir/bin -a $FOUND_RBENV -eq 0 ] ; then
46 FOUND_RBENV=1
47 export RBENV_ROOT=$rbenvdir
48diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
49index afdad1beaa401818fd4ac4162bc4e7a23afb83ff..a93c8e8633351f5e31904d2c3d681043ced94739 100644
50--- a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
51+++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
52@@ -10,11 +10,9 @@ for wrapsource in "/usr/local/bin/virtualenvwrapper.sh" "/etc/bash_completion.d/
53 # by placing a .venv file in the project root with a virtualenv name in it
54 function workon_cwd {
55 # Check that this is a Git repo
56- GIT_DIR=`git rev-parse --git-dir 2> /dev/null`
57+ PROJECT_ROOT=`git rev-parse --show-toplevel 2> /dev/null`
58 if (( $? == 0 )); then
59- # Find the repo root and check for virtualenv name override
60- GIT_DIR=`readlink -f $GIT_DIR`
61- PROJECT_ROOT=`dirname "$GIT_DIR"`
62+ # Check for virtualenv name override
63 ENV_NAME=`basename "$PROJECT_ROOT"`
64 if [[ -f "$PROJECT_ROOT/.venv" ]]; then
65 ENV_NAME=`cat "$PROJECT_ROOT/.venv"`
66@@ -30,6 +28,7 @@ for wrapsource in "/usr/local/bin/virtualenvwrapper.sh" "/etc/bash_completion.d/
67 # Note: this only happens if the virtualenv was activated automatically
68 deactivate && unset CD_VIRTUAL_ENV
69 fi
70+ unset PROJECT_ROOT
71 }
72
73 # New cd function that does the virtualenv magic
74diff --git a/plugins/yum/yum.plugin.zsh b/plugins/yum/yum.plugin.zsh
75index c9966f1b113fb0283eeca5d6cb4dee9a21bf7f51..69abfc4cec8c6d9586e2b9f991ffe4322c10027d 100644
76--- a/plugins/yum/yum.plugin.zsh
77+++ b/plugins/yum/yum.plugin.zsh
78@@ -5,7 +5,7 @@ alias yp="yum info" # show package info
79 alias yl="yum list" # list packages
80 alias ygl="yum grouplist" # list package groups
81 alias yli="yum list installed" # print all installed packages
82-alias ymc="yum makecache # rebuilds the yum package list
83+alias ymc="yum makecache" # rebuilds the yum package list
84
85 alias yu="sudo yum update" # upgrate packages
86 alias yi="sudo yum install" # install package
87diff --git a/themes/nebirhos.zsh-theme b/themes/nebirhos.zsh-theme
88index c5864d9b8d81641dafea787ef6b4af4573890525..a5a226b69b93e8e81d2479a158a6e182fc8b4d10 100644
89--- a/themes/nebirhos.zsh-theme
90+++ b/themes/nebirhos.zsh-theme
91@@ -6,7 +6,7 @@ if [ -e ~/.rvm/bin/rvm-prompt ]; then
92 RUBY_PROMPT_="%{$fg_bold[blue]%}rvm:(%{$fg[green]%}\$(~/.rvm/bin/rvm-prompt s i v g)%{$fg_bold[blue]%})%{$reset_color%} "
93 else
94 if which rbenv &> /dev/null; then
95- RUBY_PROMPT_="%{$fg_bold[blue]%}rvm:(%{$fg[green]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$fg_bold[blue]%})%{$reset_color%} "
96+ RUBY_PROMPT_="%{$fg_bold[blue]%}rbenv:(%{$fg[green]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$fg_bold[blue]%})%{$reset_color%} "
97 fi
98 fi
99
100diff --git a/themes/steeef.zsh-theme b/themes/steeef.zsh-theme
101index a2583b0287d7cd0ec8f07c7d5fff2863d0b2adf5..312229e9f345d026cbc372eea13b4436ca470eb6 100644
102--- a/themes/steeef.zsh-theme
103+++ b/themes/steeef.zsh-theme
104@@ -81,7 +81,7 @@ add-zsh-hook chpwd steeef_chpwd
105 function steeef_precmd {
106 if [[ -n "$PR_GIT_UPDATE" ]] ; then
107 # check for untracked files or updated submodules, since vcs_info doesn't
108- if [[ ! -z $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then
109+ if git ls-files --other --exclude-standard --directory 2> /dev/null | grep -q "."; then
110 PR_GIT_UPDATE=1
111 FMT_BRANCH="(%{$turquoise%}%b%u%c%{$hotpink%}●${PR_RST})"
112 else
113diff --git a/tools/install.sh b/tools/install.sh
114index 8ca427d2caf3620d141b043ab333a005aeaf47ea..b080be3a115c4d9b6feaa3368bbd7e1c9451e84e 100755
115--- a/tools/install.sh
116+++ b/tools/install.sh
117@@ -5,13 +5,10 @@ then
118 fi
119
120 echo "\033[0;34mCloning Oh My Zsh...\033[0m"
121-which git > /dev/null
122-if [[ $? -eq 0 ]]; then
123- /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
124-else
125+hash git >/dev/null && /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh || {
126 echo "git not installed"
127 exit
128-fi
129+}
130
131 echo "\033[0;34mLooking for an existing zsh config...\033[0m"
132 if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]