summaryrefslogtreecommitdiff
path: root/zsh/pnpm.zsh
diff options
context:
space:
mode:
authorSkladnayazebra <skladnayazebra@gmail.com>2025-11-27 12:24:35 +0500
committerSkladnayazebra <skladnayazebra@gmail.com>2025-11-27 12:24:35 +0500
commite01551c7d3c294af1b0964596eaa27f5a272f40f (patch)
tree3b8c96b2c180a4f294ecab560f8d021867e59759 /zsh/pnpm.zsh
parent88e657e3f3d83c36613db35fdf9a77fd8d8e69cc (diff)
Add pnpm autocomp
Diffstat (limited to 'zsh/pnpm.zsh')
-rw-r--r--zsh/pnpm.zsh28
1 files changed, 28 insertions, 0 deletions
diff --git a/zsh/pnpm.zsh b/zsh/pnpm.zsh
new file mode 100644
index 0000000..ad44e82
--- /dev/null
+++ b/zsh/pnpm.zsh
@@ -0,0 +1,28 @@
+#compdef pnpm
+###-begin-pnpm-completion-###
+if type compdef &>/dev/null; then
+ _pnpm_completion () {
+ local reply
+ local si=$IFS
+
+ IFS=$'\n' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" SHELL=zsh pnpm completion-server -- "${words[@]}"))
+ IFS=$si
+
+ if [ "$reply" = "__tabtab_complete_files__" ]; then
+ _files
+ else
+ _describe 'values' reply
+ fi
+ }
+ # When called by the Zsh completion system, this will end with
+ # "loadautofunc" when initially autoloaded and "shfunc" later on, otherwise,
+ # the script was "eval"-ed so use "compdef" to register it with the
+ # completion system
+ if [[ $zsh_eval_context == *func ]]; then
+ _pnpm_completion "$@"
+ else
+ compdef _pnpm_completion pnpm
+ fi
+fi
+###-end-pnpm-completion-###
+