feat(zsh-patina): add completions (#14296)

This commit is contained in:
mattmc3 authored and GitHub committed 2026-11-25 06:02:51 -08:00
1 parent 799f9a8a8a
commit c8aea70a11
2 files changed
+17

No files matched your search

+3
View File
@@ -4,6 +4,9 @@ Initializes [zsh-patina](https://github.com/michel-kraemer/zsh-patina), a
"blazingly fast Zsh plugin performing syntax highlighting of your command line
while you type 🌈"
The plugin also caches completions for the `zsh-patina` command in
`$ZSH_CACHE_DIR/completions/_zsh-patina`, refreshed each time the plugin loads.
To use it, add `zsh-patina` to the plugins array in your `.zshrc` file:
```zsh
+14
View File
@@ -2,6 +2,20 @@ if (( $+ZSH_HIGHLIGHT_VERSION )) || (( ${plugins[(Ie)zsh-syntax-highlighting]} )
echo '[oh-my-zsh] zsh-patina conflicts with zsh-syntax-highlighting, please enable only one of them'
elif [[ -x ${ZSH_PATINA_BINARY:-$commands[zsh-patina]} ]]; then
eval "$(${ZSH_PATINA_BINARY:-$commands[zsh-patina]} activate)"
# If the completion file doesn't exist yet, we need to autoload it and
# bind it to `zsh-patina`. Otherwise, compinit will have already done that.
if [[ ! -f "$ZSH_CACHE_DIR/completions/_zsh-patina" ]]; then
typeset -g -A _comps
autoload -Uz _zsh-patina
_comps[zsh-patina]=_zsh-patina
fi
zmodload -F zsh/files b:zf_mv
() {
local TMPPREFIX="$ZSH_CACHE_DIR/completions/._zsh-patina"
zf_mv -f -- =( "$1" completion ) "$ZSH_CACHE_DIR/completions/_zsh-patina"
} "${ZSH_PATINA_BINARY:-$commands[zsh-patina]}" &|
else
echo '[oh-my-zsh] zsh-patina not found, please install it from https://github.com/michel-kraemer/zsh-patina'
fi