Skip to content

Commit

Permalink
fix rbenv
Browse files Browse the repository at this point in the history
  • Loading branch information
holman committed Apr 10, 2012
1 parent 693cf52 commit 1085942
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 5 deletions.
22 changes: 22 additions & 0 deletions ruby/completion.zsh
Original file line number Diff line number Diff line change
@@ -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}")
}
17 changes: 17 additions & 0 deletions ruby/rbenv.zsh
Original file line number Diff line number Diff line change
@@ -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
}
2 changes: 1 addition & 1 deletion system/path.zsh
Original file line number Diff line number Diff line change
@@ -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"
5 changes: 1 addition & 4 deletions zsh/zshrc.symlink
Original file line number Diff line number Diff line change
Expand Up @@ -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.