summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlo Sala <carlosalag@protonmail.com>2023-06-07 18:43:47 +0200
committerCarlo Sala <carlosalag@protonmail.com>2023-06-07 18:43:47 +0200
commit46c70406dd0b26bbd61210873ad6c86d9e8ee5da (patch)
tree40977853e9f485a879eee1be62e6c3fb20339e40
parent115cee17015e4b5665e16dc4fd15c53e06a22f9a (diff)
downloadzsh-46c70406dd0b26bbd61210873ad6c86d9e8ee5da.tar.gz
zsh-46c70406dd0b26bbd61210873ad6c86d9e8ee5da.tar.bz2
zsh-46c70406dd0b26bbd61210873ad6c86d9e8ee5da.zip
feat(nvm): add `npx` to lazy trigger list
Closes #11740
-rw-r--r--plugins/nvm/README.md2
-rw-r--r--plugins/nvm/nvm.plugin.zsh4
2 files changed, 3 insertions, 3 deletions
diff --git a/plugins/nvm/README.md b/plugins/nvm/README.md
index d3fd980be..6830c14d0 100644
--- a/plugins/nvm/README.md
+++ b/plugins/nvm/README.md
@@ -26,7 +26,7 @@ These settings should go in your zshrc file, before Oh My Zsh is sourced:
#### Lazy startup
This option will help you to defer nvm's load until you use it to speed-up your zsh startup. This will source
-nvm script only when using it, and will create a function for `node`, `npm`, `pnpm`, `yarn`, and the
+nvm script only when using it, and will create a function for `node`, `npm`, `npx`, `pnpm`, `yarn`, and the
command(s) specified by `lazy-cmd` option, so when you call either of them, nvm will be loaded and run with
default version. To enable it, you can add this snippet to your zshrc, before Oh My Zsh is sourced:
diff --git a/plugins/nvm/nvm.plugin.zsh b/plugins/nvm/nvm.plugin.zsh
index 20697d67d..31d275415 100644
--- a/plugins/nvm/nvm.plugin.zsh
+++ b/plugins/nvm/nvm.plugin.zsh
@@ -43,8 +43,8 @@ if zstyle -t ':omz:plugins:nvm' lazy; then
# Call nvm when first using nvm, node, npm, pnpm, yarn or other commands in lazy-cmd
zstyle -a ':omz:plugins:nvm' lazy-cmd nvm_lazy_cmd
eval "
- function nvm node npm pnpm yarn $nvm_lazy_cmd {
- unfunction nvm node npm pnpm yarn $nvm_lazy_cmd
+ function nvm node npm npx pnpm yarn $nvm_lazy_cmd {
+ unfunction nvm node npm npx pnpm yarn $nvm_lazy_cmd
# Load nvm if it exists in \$NVM_DIR
[[ -f \"\$NVM_DIR/nvm.sh\" ]] && source \"\$NVM_DIR/nvm.sh\"
\"\$0\" \"\$@\"