Permalink
Browse files

fix rbenv

  • Loading branch information...
1 parent 693cf52 commit 10859427f04e5101f359cde8998a300a0b35a135 @holman committed Apr 10, 2012
Showing with 41 additions and 5 deletions.
  1. +22 −0 ruby/completion.zsh
  2. +17 −0 ruby/rbenv.zsh
  3. +1 −1 system/path.zsh
  4. +1 −4 zsh/zshrc.symlink
View
@@ -0,0 +1,22 @@
+# Stolen from
+# https://github.com/sstephenson/rbenv/blob/master/completions/rbenv.zsh
+
+if [[ ! -o interactive ]]; then
+ return
+fi
+
+compctl -K _rbenv rbenv
+
+_rbenv() {
+ local word words completions
+ read -cA words
+ word="${words[2]}"
+
+ if [ "${#words}" -eq 2 ]; then
+ completions="$(rbenv commands)"
+ else
+ completions="$(rbenv completions "${word}")"
+ fi
+
+ reply=("${(ps:\n:)completions}")
+}
View
@@ -0,0 +1,17 @@
+# rehash shims
+rbenv rehash 2>/dev/null
+
+# shell thing
+rbenv() {
+ command="$1"
+ if [ "$#" -gt 0 ]; then
+ shift
+ fi
+
+ case "$command" in
+ shell)
+ eval `rbenv "sh-$command" "$@"`;;
+ *)
+ command rbenv "$command" "$@";;
+ esac
+}
View
@@ -1,3 +1,3 @@
-export PATH="./bin:/usr/local/bin:/usr/local/sbin:$HOME/.sfs:$ZSH/bin:$HOME/.rbenv/bin:$PATH"
+export PATH="./bin:$HOME/.rbenv/bin:/usr/local/bin:/usr/local/sbin:$HOME/.sfs:$ZSH/bin:$PATH"
export MANPATH="/usr/local/man:/usr/local/mysql/man:/usr/local/git/man:$MANPATH"
View
@@ -19,7 +19,4 @@ autoload -U compinit
compinit
# load every completion after autocomplete loads
-for config_file ($ZSH/**/completion.sh) source $config_file
-
-# I guess we need to load rbenv last. Meh.
-eval "$(rbenv init -)"
+for config_file ($ZSH/**/completion.sh) source $config_file

0 comments on commit 1085942

Please sign in to comment.