d2cf10c29f2ebcbdbcc70ed3569aa3333d70d00d
- Author
- Ilya <68309482+Str1kez@users.noreply.github.com>
- Committer
- GitHub <noreply@github.com>
- Date
Message
feat(procs): add completions plugin (#12406)
Diff
1diff --git a/plugins/procs/README.md b/plugins/procs/README.md
2new file mode 100644
3index 0000000000000000000000000000000000000000..f1e663d9b6d4f2e6bfe598cfac94daa2b09d2e15
4--- /dev/null
5+++ b/plugins/procs/README.md
6@@ -0,0 +1,9 @@
7+# procs
8+
9+This plugin provides completion for [procs](https://github.com/dalance/procs).
10+
11+To use it, add `procs` to the plugins array in your zshrc file.
12+
13+```
14+plugins=(... procs)
15+```
16diff --git a/plugins/procs/procs.plugin.zsh b/plugins/procs/procs.plugin.zsh
17new file mode 100644
18index 0000000000000000000000000000000000000000..332985bf96ba8c6c64556d57da76284c5b944e51
19--- /dev/null
20+++ b/plugins/procs/procs.plugin.zsh
21@@ -0,0 +1,13 @@
22+if (( ! $+commands[procs] )); then
23+ return
24+fi
25+
26+# If the completion file doesn't exist yet, we need to autoload it and
27+# bind it to `minikube`. Otherwise, compinit will have already done that.
28+if [[ ! -f "$ZSH_CACHE_DIR/completions/_procs" ]]; then
29+ typeset -g -A _comps
30+ autoload -Uz _procs
31+ _comps[procs]=_procs
32+fi
33+
34+procs --gen-completion-out zsh >| "$ZSH_CACHE_DIR/completions/_procs" &|