Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
46c70406
Unverified
Commit
46c70406
authored
Jun 07, 2023
by
Carlo Sala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(nvm): add `npx` to lazy trigger list
Closes #11740
parent
115cee17
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
README.md
plugins/nvm/README.md
+1
-1
nvm.plugin.zsh
plugins/nvm/nvm.plugin.zsh
+2
-2
No files found.
plugins/nvm/README.md
View file @
46c70406
...
...
@@ -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:
...
...
plugins/nvm/nvm.plugin.zsh
View file @
46c70406
...
...
@@ -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
\"
\"\$
@
\"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment