]> src.twobees.de Git - dotfiles.git/blob - stow/oh-my-zsh/.oh-my-zsh/plugins/nvm/README.md
initial
[dotfiles.git] / stow / oh-my-zsh / .oh-my-zsh / plugins / nvm / README.md
1 # nvm plugin
2
3 This plugin adds autocompletions for [nvm](https://github.com/nvm-sh/nvm) — a Node.js version manager.
4 It also automatically sources nvm, so you don't need to do it manually in your `.zshrc`.
5
6 To use it, add `nvm` to the plugins array of your zshrc file:
7
8 ```zsh
9 plugins=(... nvm)
10 ```
11
12 ## Settings
13
14 If you installed nvm in a directory other than `$HOME/.nvm`, set and export `NVM_DIR` to be the directory
15 where you installed nvm.
16
17 These settings should go in your zshrc file, before Oh My Zsh is sourced:
18
19 - **`NVM_HOMEBREW`**: if you installed nvm via Homebrew, in a directory other than `/usr/local/opt/nvm`, you
20   can set `NVM_HOMEBREW` to be the directory where you installed it. For example, on Apple Silicon-based Macs,
21   [Homebrew is installed in `/opt/homebrew`](https://docs.brew.sh/Installation). To get the directory where
22   nvm has been installed, regardless of chip architecture, use `NVM_HOMEBREW=$(brew --prefix nvm)`.
23
24 - **`NVM_LAZY`**: if you want the plugin to defer the load of nvm to speed-up the start of your zsh session,
25   set `NVM_LAZY` to `1`. This will source nvm script only when using it, and will create a function for `node`,
26   `npm`, `pnpm`, `yarn`, and the command(s) specified by `NVM_LAZY_CMD`, so when you call either of them,
27   nvm will be loaded and run with default version.
28
29 - **`NVM_LAZY_CMD`**: if you want additional command(s) to trigger lazy loading of nvm, set `NVM_LAZY_CMD` to
30   the command or an array of the commands.
31
32 - **`NVM_AUTOLOAD`**: if `NVM_AUTOLOAD` is set to `1`, the plugin will automatically load a node version when
33   if finds a [`.nvmrc` file](https://github.com/nvm-sh/nvm#nvmrc) in the current working directory indicating
34   which node version to load.