pyenv.zsh 298 B

123456789101112131415161718
  1. if [[ ! -o interactive ]]; then
  2. return
  3. fi
  4. compctl -K _pyenv pyenv
  5. _pyenv() {
  6. local words completions
  7. read -cA words
  8. if [ "${#words}" -eq 2 ]; then
  9. completions="$(pyenv commands)"
  10. else
  11. completions="$(pyenv completions ${words[2,-2]})"
  12. fi
  13. reply=(${(ps:\n:)completions})
  14. }