mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-04-03 04:20:01 +02:00
feat: add fnox plugin w/ optional mise integration
This commit is contained in:
parent
52d93f18d6
commit
0e570d7dcd
2 changed files with 46 additions and 0 deletions
20
plugins/fnox/fnox.plugin.zsh
Normal file
20
plugins/fnox/fnox.plugin.zsh
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
if (( ! $+commands[fnox] )); then
|
||||
# if we don't have fnox at all just bail out
|
||||
return
|
||||
fi
|
||||
|
||||
if (( ! $+commands[mise] )); then
|
||||
# if we have fnox but not mise, source its activation directly
|
||||
eval "$(fnox activate zsh)"
|
||||
fi
|
||||
|
||||
# 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/_fnox" ]]; then
|
||||
typeset -g -A _comps
|
||||
autoload -Uz _fnox
|
||||
_comps[fnox]=_fnox
|
||||
fi
|
||||
|
||||
# Generate and load completions
|
||||
fnox completion zsh >| "$ZSH_CACHE_DIR/completions/_fnox" &|
|
||||
Loading…
Add table
Add a link
Reference in a new issue