mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-10-24 14:03:50 +08:00
feat(rbenv): provide completion for rbenv command (#12891)
Ref https://github.com/rbenv/rbenv/#shell-completions
This commit is contained in:
@@ -3,6 +3,8 @@
|
|||||||
The primary job of this plugin is to provide `rbenv_prompt_info` which can be added to your theme to include Ruby
|
The primary job of this plugin is to provide `rbenv_prompt_info` which can be added to your theme to include Ruby
|
||||||
version and gemset information into your prompt.
|
version and gemset information into your prompt.
|
||||||
|
|
||||||
|
Additionally, this plugin provides completion for the `rbenv` command. See also <https://github.com/rbenv/rbenv/#shell-completions>.
|
||||||
|
|
||||||
Some functionality of this plugin will not work unless you also have the rbenv plugin *gemset* installed.
|
Some functionality of this plugin will not work unless you also have the rbenv plugin *gemset* installed.
|
||||||
https://github.com/jf/rbenv-gemset
|
https://github.com/jf/rbenv-gemset
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,13 @@ if [[ $FOUND_RBENV -ne 1 ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $FOUND_RBENV -eq 1 ]]; then
|
if [[ $FOUND_RBENV -eq 1 ]]; then
|
||||||
|
rbenv_completions="${commands[rbenv]:A:h:h}/completions"
|
||||||
|
if [[ -f "$rbenv_completions/_rbenv" ]]; then
|
||||||
|
fpath+=("$rbenv_completions")
|
||||||
|
autoload -Uz _rbenv
|
||||||
|
compdef _rbenv rbenv
|
||||||
|
fi
|
||||||
|
|
||||||
eval "$(rbenv init --no-rehash - zsh)"
|
eval "$(rbenv init --no-rehash - zsh)"
|
||||||
|
|
||||||
alias rubies="rbenv versions"
|
alias rubies="rbenv versions"
|
||||||
@@ -65,4 +72,4 @@ else
|
|||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
unset FOUND_RBENV rbenvdirs dir
|
unset FOUND_RBENV rbenvdirs dir rbenv_completions
|
||||||
|
|||||||
Reference in New Issue
Block a user