1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-11 00:10:08 +00:00
ohmyzsh/plugins/mise/mise.plugin.zsh

28 lines
680 B
Bash
Raw Normal View History

# TODO: 2024-01-03 remove rtx support
local __mise=mise
if (( ! $+commands[mise] )); then
if (( $+commands[rtx] )); then
__mise=rtx
else
return
fi
fi
# Load mise hooks
eval "$($__mise activate zsh)"
# Hook mise into current environment
eval "$($__mise hook-env -s zsh)"
# If the completion file doesn't exist yet, we need to autoload it and
# bind it to `mise`. Otherwise, compinit will have already done that.
if [[ ! -f "$ZSH_CACHE_DIR/completions/_$__mise" ]]; then
typeset -g -A _comps
autoload -Uz _$__mise
_comps[$__mise]=_$__mise
fi
# Generate and load mise completion
$__mise completion zsh >| "$ZSH_CACHE_DIR/completions/_$__mise" &|
unset __mise