From 5c0911c184b012797ef4d0ed2a79d67b6b0976e3 Mon Sep 17 00:00:00 2001 From: Maciej Sypień Date: Sun, 1 Jul 2018 23:12:14 +0200 Subject: update nvm completions with v0.29.0 (#4701) --- plugins/nvm/_nvm | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'plugins/nvm') diff --git a/plugins/nvm/_nvm b/plugins/nvm/_nvm index 1414dcbb1..1eec48b0a 100644 --- a/plugins/nvm/_nvm +++ b/plugins/nvm/_nvm @@ -6,16 +6,23 @@ local -a _1st_arguments _1st_arguments=( 'help:show help' - 'install:download and install a version' + '--version:print out the latest released version of nvm' + 'install:download and install a version in ' 'uninstall:uninstall a version' - 'use:modify PATH to use version' - 'run:run version with given arguments' + 'use:modify PATH to use . Uses .nvmrc if available' + 'exec:run on . Uses .nvmrc if available' + 'run:run `node` on with as arguments. Uses .nvmrc if available' + 'current:list installed versions' 'ls:list installed versions or versions matching a given description' + 'version:resolve the given description to a single local version' + 'version-remote:resolve the given description to a single remote version' 'ls-remote:list remote versions available for install' - 'deactivate:undo effects of NVM on current shell' + 'deactivate:undo effects of `nvm` on current shell' 'alias:show or set aliases' 'unalias:deletes an alias' - 'copy-packages:install global NPM packages to current version' + 'reinstall-packages:reinstall global `npm` packages contained in to current version' + 'unload:unload `nvm` from shell' + 'which:display path to installed node version. Uses .nvmrc if available' ) _arguments -C '*:: :->subcmds' && return 0 @@ -23,4 +30,4 @@ _arguments -C '*:: :->subcmds' && return 0 if (( CURRENT == 1 )); then _describe -t commands "nvm subcommand" _1st_arguments return -fi \ No newline at end of file +fi -- cgit v1.2.3-70-g09d2 From d1e1f1f340518c8db07401a04ba8550624785317 Mon Sep 17 00:00:00 2001 From: Denys Dovhan Date: Wed, 3 Oct 2018 19:01:03 +0300 Subject: nvm: add README (#7202) --- plugins/nvm/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 plugins/nvm/README.md (limited to 'plugins/nvm') diff --git a/plugins/nvm/README.md b/plugins/nvm/README.md new file mode 100644 index 000000000..079cf0009 --- /dev/null +++ b/plugins/nvm/README.md @@ -0,0 +1,9 @@ +# nvm plugin + +This plugin adds autocompletions for [nvm](https://github.com/creationix/nvm) — a Node.js version manager. +It also automatically sources nvm, so you don't need to do it manually in your `.zshrc`. + +To use it, add `nvm` to the plugins array of your zshrc file: +```zsh +plugins=(... nvm) +``` -- cgit v1.2.3-70-g09d2 From 728c8e717435b31cb7db90168e1e7bd27b95e3f5 Mon Sep 17 00:00:00 2001 From: Sascha Bratton Date: Mon, 8 Apr 2019 11:58:27 -0400 Subject: nvm: load nvm script only if command doesn't already exist (#5454) Fixes #5453. --- plugins/nvm/nvm.plugin.zsh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'plugins/nvm') diff --git a/plugins/nvm/nvm.plugin.zsh b/plugins/nvm/nvm.plugin.zsh index 9dde3a266..4bab8e9d7 100644 --- a/plugins/nvm/nvm.plugin.zsh +++ b/plugins/nvm/nvm.plugin.zsh @@ -1,5 +1,8 @@ # Set NVM_DIR if it isn't already defined [[ -z "$NVM_DIR" ]] && export NVM_DIR="$HOME/.nvm" -# Load nvm if it exists -[[ -f "$NVM_DIR/nvm.sh" ]] && source "$NVM_DIR/nvm.sh" +# Try to load nvm only if command not already available +if ! type "nvm" &> /dev/null; then + # Load nvm if it exists + [[ -f "$NVM_DIR/nvm.sh" ]] && source "$NVM_DIR/nvm.sh" +fi -- cgit v1.2.3-70-g09d2