mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-29 04:53:17 +02:00
add nvmng plugin
This adds the nvmng plugin, which loads nvm with the flag --fast-reuse, which is exposed by nvm-ng. This is a hard fork of nvm which contains patches that accelerate load time for nvm, to get back to a more smooth behavior of your shell. Signed-off-by: Tobias Gurtzick <magic@wizardtales.com>
This commit is contained in:
parent
7ed82b4df6
commit
b811acde9d
2 changed files with 31 additions and 0 deletions
26
plugins/nvmng/_nvm
Normal file
26
plugins/nvmng/_nvm
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#compdef nvm
|
||||
#autoload
|
||||
|
||||
[[ -f "$NVM_DIR/nvm.sh" ]] || return 0
|
||||
|
||||
local -a _1st_arguments
|
||||
_1st_arguments=(
|
||||
'help:show help'
|
||||
'install:download and install a version'
|
||||
'uninstall:uninstall a version'
|
||||
'use:modify PATH to use version'
|
||||
'run:run version with given arguments'
|
||||
'ls:list installed versions or versions matching a given description'
|
||||
'ls-remote:list remote versions available for install'
|
||||
'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'
|
||||
)
|
||||
|
||||
_arguments -C '*:: :->subcmds' && return 0
|
||||
|
||||
if (( CURRENT == 1 )); then
|
||||
_describe -t commands "nvm subcommand" _1st_arguments
|
||||
return
|
||||
fi
|
||||
5
plugins/nvmng/nvmng.plugin.zsh
Normal file
5
plugins/nvmng/nvmng.plugin.zsh
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
# 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" --fast-reuse
|
||||
Loading…
Add table
Add a link
Reference in a new issue