Skip to content

Instantly share code, notes, and snippets.

@mba811
Created October 13, 2020 05:14
Show Gist options
  • Save mba811/99cc194ae386c8c8abd7b74497557fc0 to your computer and use it in GitHub Desktop.
Save mba811/99cc194ae386c8c8abd7b74497557fc0 to your computer and use it in GitHub Desktop.
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}")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment