Skip to content

Commit 25e4132

Browse files
committed
add pyenv command completion
1 parent bf53f3a commit 25e4132

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

.zsh/pyenv.zsh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
if [[ ! -o interactive ]]; then
2+
return
3+
fi
4+
5+
compctl -K _pyenv pyenv
6+
7+
_pyenv() {
8+
local words completions
9+
read -cA words
10+
11+
if [ "${#words}" -eq 2 ]; then
12+
completions="$(pyenv commands)"
13+
else
14+
completions="$(pyenv completions ${words[2,-2]})"
15+
fi
16+
17+
reply=(${(ps:\n:)completions})
18+
}

.zshrc

+2
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,5 @@ complete -C '/usr/bin/aws_completer' aws
165165
# -*- k3d completion for zsh -*-
166166
[[ ! -f ~/.zsh/k3d.zsh ]] || source ~/.zsh/k3d.zsh
167167

168+
# -*- pyenv command completion for zsh -*-
169+
[[ ! -f ~/.zsh/pyenv.zsh ]] || source ~/.zsh/pyenv.zsh

0 commit comments

Comments
 (0)