46c70406dd0b26bbd61210873ad6c86d9e8ee5da

Author
Carlo Sala <carlosalag@protonmail.com>
Committer
Carlo Sala <carlosalag@protonmail.com>
Date

Message

feat(nvm): add `npx` to lazy trigger list

Closes #11740

Diff

 1diff --git a/plugins/nvm/README.md b/plugins/nvm/README.md
 2index d3fd980be1904c3fb629f9bf88f0642c39fe1570..6830c14d0529eb6e8abd1f16f8199fed6ce672a7 100644
 3--- a/plugins/nvm/README.md
 4+++ b/plugins/nvm/README.md
 5@@ -26,7 +26,7 @@ These settings should go in your zshrc file, before Oh My Zsh is sourced:
 6 #### Lazy startup
 7 
 8 This option will help you to defer nvm's load until you use it to speed-up your zsh startup. This will source
 9-nvm script only when using it, and will create a function for `node`, `npm`, `pnpm`, `yarn`, and the
10+nvm script only when using it, and will create a function for `node`, `npm`, `npx`, `pnpm`, `yarn`, and the
11 command(s) specified by `lazy-cmd` option, so when you call either of them, nvm will be loaded and run with
12 default version. To enable it, you can add this snippet to your zshrc, before Oh My Zsh is sourced:
13 
14diff --git a/plugins/nvm/nvm.plugin.zsh b/plugins/nvm/nvm.plugin.zsh
15index 20697d67d41899ceb59c0f4357856c255c0d4631..31d27541523f6a04c90d22026dce59de867811f9 100644
16--- a/plugins/nvm/nvm.plugin.zsh
17+++ b/plugins/nvm/nvm.plugin.zsh
18@@ -43,8 +43,8 @@ if zstyle -t ':omz:plugins:nvm' lazy; then
19   # Call nvm when first using nvm, node, npm, pnpm, yarn or other commands in lazy-cmd
20   zstyle -a ':omz:plugins:nvm' lazy-cmd nvm_lazy_cmd
21   eval "
22-    function nvm node npm pnpm yarn $nvm_lazy_cmd {
23-      unfunction nvm node npm pnpm yarn $nvm_lazy_cmd
24+    function nvm node npm npx pnpm yarn $nvm_lazy_cmd {
25+      unfunction nvm node npm npx pnpm yarn $nvm_lazy_cmd
26       # Load nvm if it exists in \$NVM_DIR
27       [[ -f \"\$NVM_DIR/nvm.sh\" ]] && source \"\$NVM_DIR/nvm.sh\"
28       \"\$0\" \"\$@\"