From c91ada631476847a8833d4b43f36eac8c3087023 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Thu, 5 Jan 2017 17:56:32 +0700 Subject: [PATCH] Document NVM_AUTO_USE option --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 777a4dc..67441b3 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,19 @@ export NVM_NO_USE=true antigen bundle lukechilds/zsh-nvm ``` +### Auto use + +If you have lots of projects with an `.nvmrc` file you may find the auto use option helpful. If it's enabled, when you `cd` into a directory with an `.nvmrc` file, `zsh-nvm` will automatically load or install the required node version in `.nvmrc`. You can enable it by exporting the `NVM_AUTO_USE` environment variable and setting it to `true`. It must be set before `zsh-nvm` is loaded. + +If you enable this option and don't have `nvm` loaded in the current session (`NVM_LAZY_LOAD` or `NVM_NO_USE`) it won't work until you've loaded `nvm`. + +For example, if you are using antigen, you would put the following in your `.zshrc`: + +```shell +export NVM_AUTO_USE=true +antigen bundle lukechilds/zsh-nvm +``` + ## Installation ### Using [Antigen](https://github.com/zsh-users/antigen)