You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+11
Original file line number
Diff line number
Diff line change
@@ -108,6 +108,17 @@ Performance comparison:
108
108
( _zsh_nvm_lazy_load; ) 0.01s user 0.01s system 168% cpu 0.012 total
109
109
```
110
110
111
+
#### Extra commands to trigger lazy loading
112
+
By default lazy loading nvm is triggered by running the `nvm`, `node`, `npm` commands or any installed npm global binaries.
113
+
If you want to trigger the lazy loading via extra arbitrary commands you can define `NVM_LAZY_LOAD_EXTRA_COMMANDS` and set it to an array of commands as strings.
114
+
This can be usefull if programs are not in the above list of binaries but do depend on the availability of `node`, e.g. a vim plugin.
115
+
116
+
```shell
117
+
export NVM_LAZY_LOAD_EXTRA_COMMANDS=('vim')
118
+
vim --version
119
+
#node is now loaded
120
+
```
121
+
111
122
### Don't autoload node
112
123
113
124
By default when `nvm` is loaded it'll automatically run `nvm use default` and load your default `node` version along with `npm` and any global modules. You can disable this behaviour by exporting the `NVM_NO_USE` environment variable and setting it to `true`. It must be set before `zsh-nvm` is loaded.
0 commit comments