Unverified Commit 0232ac4b authored by Marc Cornellà's avatar Marc Cornellà Committed by GitHub
Browse files

Merge branch 'master' into master

parents afb02876 ebc700be
......@@ -12,7 +12,7 @@ _mix_does_task_list_need_generating () {
}
_mix_generate () {
mix --help | grep -v 'iex -S' | tail -n +2 | cut -d " " -f 2 > .mix_tasks
mix help | grep -v 'iex -S' | tail -n +2 | cut -d " " -f 2 > .mix_tasks
}
_mix () {
......
# Mix plugin
This plugin adds completions for the [Elixir's Mix build tool](https://hexdocs.pm/mix/Mix.html).
To use it, add `mix` to the plugins array in your zshrc file:
```zsh
plugins=(... mix)
```
## Supported Task Types
| Task Type | Documentation |
|-------------------------|----------------------------------------------------------|
| Elixir | [Elixir Lang](https://elixir-lang.org/) |
| Phoenix v1.2.1 and below| [Phoenix](https://hexdocs.pm/phoenix/1.2.1/Phoenix.html) |
| Phoenix v1.3.0 and above| [Phoenix](https://hexdocs.pm/phoenix/Phoenix.html) |
| Ecto | [Ecto](https://hexdocs.pm/ecto/Ecto.html) |
| Hex | [Hex](https://hex.pm/) |
| Nerves | [Nerves](https://nerves-project.org/) |
......@@ -21,7 +21,19 @@ _1st_arguments=(
'deps.unlock:Unlock the given dependencies'
'deps.update:Update the given dependencies'
'do:Executes the tasks separated by comma'
'ecto.create:Create Ecto database'
'ecto.drop:Drop the storage for the given repository'
'ecto.dump:Dumps the current environment’s database structure'
'ecto.gen.migration:Generates a migration'
'ecto.gen.repo:Generates a new repository'
'ecto.load:Loads the current environment’s database structure'
'ecto.migrate:Runs Ecto migration'
'ecto.migrations:Displays the up / down migration status'
'ecto.rollback:Reverts applied migrations'
'escript.build:Builds an escript for the project'
'firmware:Nerves - Build a firmware image for the selected target platform'
'firmware.burn:Nerves - Writes the generated firmware image to an attached SDCard or file'
'firmware.image:Nerves - Create a firmware image file that can be copied byte-for-byte'
'help:Print help information for tasks'
'hex:Print hex help information'
'hex.config:Read or update hex config'
......@@ -39,6 +51,11 @@ _1st_arguments=(
'local.phoenix:Updates Phoenix locally'
'local.phx:Updates the Phoenix project generator locally'
'local.rebar:Install rebar locally'
'nerves.artifact:Create an artifact for a specified Nerves package'
'nerves.artifact.get:Nerves get artifacts'
'nerves.info:Prints Nerves system information'
'nerves.new:Create a new Nerves application'
'nerves.release.init:Prepare a new Nerves project for use with releases'
'new:Create a new Elixir project'
'phoenix.digest:Digests and compress static files'
'phoenix.gen.channel:Generates a Phoenix channel'
......
# Mosh Plugin
This plugin allows SSH tab completion for [mosh](https://mosh.org/) hostnames.
To use it, add `mosh` to the plugins array in your zshrc file:
```
plugins=(... mosh)
```
## Introduction
# mvn plugin
The [mvn plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/mvn) provides many
[useful aliases](#aliases) as well as completion for the `mvn` command.
The mvn plugin provides many [useful aliases](#aliases) as well as completion for
the [Apache Maven](https://maven.apache.org/) command (`mvn`).
Enable it by adding `mvn` to the plugins array in your zshrc file:
```zsh
......@@ -10,25 +10,49 @@ plugins=(... mvn)
## Aliases
The plugin aliases mvn to a function that calls `mvnw` (the [Maven Wrapper](https://github.com/takari/maven-wrapper))
if it's found, or the mvn command otherwise.
| Alias | Command |
|:---------------------|:------------------------------------------------|
| `mvncie` | `mvn clean install eclipse:eclipse` |
| `mvn!` | `mvn -f <root>/pom.xml` |
| `mvnag` | `mvn archetype:generate` |
| `mvnboot` | `mvn spring-boot:run` |
| `mvnc` | `mvn clean` |
| `mvncd` | `mvn clean deploy` |
| `mvnce` | `mvn clean eclipse:clean eclipse:eclipse` |
| `mvnci` | `mvn clean install` |
| `mvncie` | `mvn clean install eclipse:eclipse` |
| `mvncini` | `mvn clean initialize` |
| `mvncist` | `mvn clean install -DskipTests` |
| `mvncisto` | `mvn clean install -DskipTests --offline` |
| `mvne` | `mvn eclipse:eclipse` |
| `mvncv` | `mvn clean verify` |
| `mvnd` | `mvn deploy` |
| `mvnp` | `mvn package` |
| `mvnc` | `mvn clean` |
| `mvncom` | `mvn compile` |
| `mvncp` | `mvn clean package` |
| `mvnct` | `mvn clean test` |
| `mvnt` | `mvn test` |
| `mvnag` | `mvn archetype:generate` |
| `mvn-updates` | `mvn versions:display-dependency-updates` |
| `mvntc7` | `mvn tomcat7:run` |
| `mvnjetty` | `mvn jetty:run` |
| `mvncv` | `mvn clean verify` |
| `mvncvst` | `mvn clean verify -DskipTests` |
| `mvnd` | `mvn deploy` |
| `mvndocs` | `mvn dependency:resolve -Dclassifier=javadoc` |
| `mvndt` | `mvn dependency:tree` |
| `mvne` | `mvn eclipse:eclipse` |
| `mvnjetty` | `mvn jetty:run` |
| `mvnp` | `mvn package` |
| `mvns` | `mvn site` |
| `mvnsrc` | `mvn dependency:sources` |
| `mvndocs` | `mvn dependency:resolve -Dclassifier=javadoc` |
| `mvnt` | `mvn test` |
| `mvntc` | `mvn tomcat:run` |
| `mvntc7` | `mvn tomcat7:run` |
| `mvn-updates` | `mvn versions:display-dependency-updates` |
## mvn-color
It's a function that wraps the mvn command to colorize it's output. You can use it in place
of the `mvn` command. For example: instead of `mvn test`, use `mvn-color test`.
Since [Maven 3.5.0](https://maven.apache.org/docs/3.5.0/release-notes.html) the mvn command
has colored output, so this function will be soon removed from the plugin.
### Known bugs
It has a bug where it will swallow mvn prompts for user input, _e.g._ when using
`archetype:generate`. See [#5052](https://github.com/robbyrussell/oh-my-zsh/issues/5052).
# mvn-color based on https://gist.github.com/1027800
BOLD=$(tput bold)
UNDERLINE_ON=$(tput smul)
UNDERLINE_OFF=$(tput rmul)
TEXT_BLACK=$(tput setaf 0)
TEXT_RED=$(tput setaf 1)
TEXT_GREEN=$(tput setaf 2)
TEXT_YELLOW=$(tput setaf 3)
TEXT_BLUE=$(tput setaf 4)
TEXT_MAGENTA=$(tput setaf 5)
TEXT_CYAN=$(tput setaf 6)
TEXT_WHITE=$(tput setaf 7)
BACKGROUND_BLACK=$(tput setab 0)
BACKGROUND_RED=$(tput setab 1)
BACKGROUND_GREEN=$(tput setab 2)
BACKGROUND_YELLOW=$(tput setab 3)
BACKGROUND_BLUE=$(tput setab 4)
BACKGROUND_MAGENTA=$(tput setab 5)
BACKGROUND_CYAN=$(tput setab 6)
BACKGROUND_WHITE=$(tput setab 7)
RESET_FORMATTING=$(tput sgr0)
# Calls ./mvnw if found, otherwise execute the original mvn
mvn-or-mvnw() {
if [ -x ./mvnw ]; then
echo "executing mvnw instead of mvn"
./mvnw "$@"
else
command mvn "$@"
fi
}
# Wrapper function for Maven's mvn command.
# Wrapper function for Maven's mvn command. Based on https://gist.github.com/1027800
mvn-color() {
local BOLD=$(echoti bold)
local TEXT_RED=$(echoti setaf 1)
local TEXT_GREEN=$(echoti setaf 2)
local TEXT_YELLOW=$(echoti setaf 3)
local TEXT_BLUE=$(echoti setaf 4)
local TEXT_WHITE=$(echoti setaf 7)
local RESET_FORMATTING=$(echoti sgr0)
(
# Filter mvn output using sed. Before filtering set the locale to C, so invalid characters won't break some sed implementations
unset LANG
LC_CTYPE=C mvn "$@" | sed -e "s/\(\[INFO\]\)\(.*\)/${TEXT_BLUE}${BOLD}\1${RESET_FORMATTING}\2/g" \
LC_CTYPE=C mvn "$@" | sed \
-e "s/\(\[INFO\]\)\(.*\)/${TEXT_BLUE}${BOLD}\1${RESET_FORMATTING}\2/g" \
-e "s/\(\[DEBUG\]\)\(.*\)/${TEXT_WHITE}${BOLD}\1${RESET_FORMATTING}\2/g" \
-e "s/\(\[INFO\]\ BUILD SUCCESSFUL\)/${BOLD}${TEXT_GREEN}\1${RESET_FORMATTING}/g" \
-e "s/\(\[WARNING\]\)\(.*\)/${BOLD}${TEXT_YELLOW}\1${RESET_FORMATTING}\2/g" \
-e "s/\(\[ERROR\]\)\(.*\)/${BOLD}${TEXT_RED}\1${RESET_FORMATTING}\2/g" \
......@@ -37,37 +33,86 @@ mvn-color() {
)
}
# Override the mvn command with the colorized one.
#alias mvn="mvn-color"
# either use orignal mvn or the mvn wrapper
alias mvn="mvn-or-mvnw"
# Run mvn against the pom found in a project's root directory (assumes a git repo)
alias 'mvn!'='mvn -f $(git rev-parse --show-toplevel 2>/dev/null || echo ".")/pom.xml'
# aliases
alias mvncie='mvn clean install eclipse:eclipse'
alias mvnag='mvn archetype:generate'
alias mvnboot='mvn spring-boot:run'
alias mvnc='mvn clean'
alias mvncd='mvn clean deploy'
alias mvnce='mvn clean eclipse:clean eclipse:eclipse'
alias mvnci='mvn clean install'
alias mvncie='mvn clean install eclipse:eclipse'
alias mvncini='mvn clean initialize'
alias mvncist='mvn clean install -DskipTests'
alias mvncisto='mvn clean install -DskipTests --offline'
alias mvne='mvn eclipse:eclipse'
alias mvnce='mvn clean eclipse:clean eclipse:eclipse'
alias mvncv='mvn clean verify'
alias mvnd='mvn deploy'
alias mvnp='mvn package'
alias mvnc='mvn clean'
alias mvncom='mvn compile'
alias mvncp='mvn clean package'
alias mvnct='mvn clean test'
alias mvnt='mvn test'
alias mvnag='mvn archetype:generate'
alias mvn-updates='mvn versions:display-dependency-updates'
alias mvntc7='mvn tomcat7:run'
alias mvntc='mvn tomcat:run'
alias mvnjetty='mvn jetty:run'
alias mvncv='mvn clean verify'
alias mvncvst='mvn clean verify -DskipTests'
alias mvnd='mvn deploy'
alias mvndocs='mvn dependency:resolve -Dclassifier=javadoc'
alias mvndt='mvn dependency:tree'
alias mvne='mvn eclipse:eclipse'
alias mvnjetty='mvn jetty:run'
alias mvnp='mvn package'
alias mvns='mvn site'
alias mvnsrc='mvn dependency:sources'
alias mvndocs='mvn dependency:resolve -Dclassifier=javadoc'
alias mvnt='mvn test'
alias mvntc='mvn tomcat:run'
alias mvntc7='mvn tomcat7:run'
alias mvn-updates='mvn versions:display-dependency-updates'
function listMavenCompletions {
local file new_file
local -a profiles POM_FILES
# Root POM
POM_FILES=(~/.m2/settings.xml)
# POM in the current directory
if [[ -f pom.xml ]]; then
local file=pom.xml
POM_FILES+=("${file:A}")
fi
# Look for POM files in parent directories
while [[ -n "$file" ]] && grep -q "<parent>" "$file"; do
# look for a new relativePath for parent pom.xml
new_file=$(grep -e "<relativePath>.*</relativePath>" "$file" | sed -e 's/.*<relativePath>\(.*\)<\/relativePath>.*/\1/')
# if <parent> is present but not defined, assume ../pom.xml
if [[ -z "$new_file" ]]; then
new_file="../pom.xml"
fi
# if file doesn't exist break
file="${file:h}/${new_file}"
if ! [[ -e "$file" ]]; then
break
fi
POM_FILES+=("${file:A}")
done
# Get profiles from found files
for file in $POM_FILES; do
[[ -e $file ]] || continue
profiles+=($(sed 's/<!--.*-->//' "$file" | sed '/<!--/,/-->/d' | grep -e "<profile>" -A 1 | grep -e "<id>.*</id>" | sed 's?.*<id>\(.*\)<\/id>.*?-P\1?'))
done
reply=(
# common lifecycle
clean process-resources compile process-test-resources test-compile test integration-test package verify install deploy site
clean initialize process-resources compile process-test-resources test-compile test package verify install deploy site
# integration testing
pre-integration-test integration-test
# common plugins
deploy failsafe install site surefire checkstyle javadoc jxr pmd ant antrun archetype assembly dependency enforcer gpg help release repository source eclipse idea jetty cargo jboss tomcat tomcat6 tomcat7 exec versions war ear ejb android scm buildnumber nexus repository sonar license hibernate3 liquibase flyway gwt
......@@ -270,7 +315,11 @@ function listMavenCompletions {
cobertura:cobertura
-Dtest=$(if [ -d ./src/test/java ] ; then find ./src/test/java -type f -name '*.java' | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dtest=\1?' ; fi)
-Dit.test=$(if [ -d ./src/test/java ] ; then find ./src/test/java -type f -name '*.java' | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dit.test=\1?' ; fi)
);
$profiles
)
}
compctl -K listMavenCompletions mvn
compctl -K listMavenCompletions mvn mvnw
compctl -K listMavenCompletions mvn-color
compctl -K listMavenCompletions mvn-or-mvnw
File mode changed from 100755 to 100644
# Nanoc plugin
This plugin adds some aliases and autocompletion for common [Nanoc](https://nanoc.ws) commands.
To use it, add `nanoc` to the plugins array in your zshrc file:
```zsh
plugins=(... nanoc)
```
## Aliases
| Alias | Command | Description |
|-------|-----------------------|-----------------------------------------------------------------------------------|
| n | `nanoc` | Main Nanoc command |
| nco | `nanoc compile` | Compile all items of the current site |
| ncs | `nanoc create-site` | Create a new site at the given path. The site will use the filesystem data source |
| nd | `nanoc deploy` | Deploy the compiled site to the destination (specified with `--target`) |
| np | `nanoc prune` | Remove files not managed by Nanoc from the output directory |
| nv | `nanoc view` | Start the static web server (on port 3000 and all IP addresses, unless specified) |
#compdef nanoc
#autoload
# nanoc zsh completion - based on the homebrew zsh completion
# requires the 'nanoc' gem to be installed
local -a _1st_arguments
_1st_arguments=(
'autocompile:start the autocompiler'
'check:run issue checks'
'compile:compile items of this site'
'create-item:create an item'
'create-layout:create a layout'
'create-site:create a site'
'deploy:deploy the compiled site'
'help:show help'
'prune:remove files not managed by nanoc from the output directory'
'shell:open a shell on the Nanoc environment'
'show-data:show data in this site'
'show-plugins:show all available plugins'
'show-rules:describe the rules for each item'
'update:update the data stored by the data source to a newer version'
'validate-css:validate the site’s CSS'
'validate-html:validate the site’s HTML'
'validate-links:validate links in site'
'view:start the web server that serves static files'
'watch:start the watcher'
)
local expl
......@@ -31,13 +24,68 @@ local -a pkgs installed_pkgs
_arguments \
'(--color)--color[enable color]' \
'(--debug)--debug[enable debugging]' \
'(--env)--env[set environment]' \
'(--help)--help[show the help message and quit]' \
'(--no-color)--no-color[disable color]' \
'(--verbose)--verbose[make nanoc output more detailed]' \
'(--verbose)--verbose[make output more detailed]' \
'(--version)--version[show version information and quit]' \
'(--warn)--warn[enable warnings]' \
'*:: :->subcmds' && return 0
case "$state" in
subcmds)
case $words[1] in
check)
_arguments \
'(--preprocess)--preprocess[run preprocessor]'
;;
compile)
_arguments \
'(--diff)--diff[generate diff]'
;;
compile)
_arguments \
'(--diff)--diff[generate diff]'
;;
create-site)
_arguments \
'(--force)--force[force creation of new site]'
;;
deploy)
_arguments \
'(--target)--target[specify the location to deploy to (default: `default`)]' \
'(--no-check)--no-check[do not run the issue checks marked for deployment]' \
'(--list)--list[list available locations to deploy to]' \
'(--list-deployers)--list-deployers[list available deployers]' \
'(--dry-run)--dry-run[show what would be deployed]'
;;
prune)
_arguments \
'(--yes)--yes[confirm deletion]' \
'(--dry-run)--dry-run[print files to be deleted instead of actually deleting them]'
;;
shell)
_arguments \
'(--preprocess)--preprocess[run preprocessor]'
;;
view)
_arguments \
'(--handler)--handler[specify the handler to use (webrick/mongrel/...)]' \
'(--host)--host[specify the host to listen on (default: 127.0.0.1)]' \
'(--port)--port[specify the port to listen on (default: 3000]' \
'(--live-reload)--live-reload[reload on changes]'
;;
esac
;;
esac
if (( CURRENT == 1 )); then
_describe -t commands "nanoc subcommand" _1st_arguments
return
......
alias n='nanoc'
alias na='nanoc autocompile'
alias nco='nanoc compile'
alias nci='nanoc create_item'
alias ncl='nanoc create_layout'
alias ncs='nanoc create_site'
alias ncs='nanoc create-site'
alias nd='nanoc deploy'
alias np='nanoc prune'
alias nv='nanoc view'
alias nw='nanoc watch'
ng_opts='addon asset-sizes b build completion d destroy doc e2e g generate get github-pages:deploy gh-pages:deploy h help i init install lint make-this-awesome new s serve server set t test v version -h --help'
ng_opts='addon asset-sizes b build completion d destroy doc e2e g generate get github-pages:deploy gh-pages:deploy h help i init install lint make-this-awesome new s serve server set t test update v version -h --help'
_ng_completion () {
local words cword opts
......@@ -56,6 +56,10 @@ _ng_completion () {
opts='--browsers --colors --config-file --environment --filter --host --launch --log-level --module --path --port --query --reporter --server --silent --test-page --test-port --watch -H -c -cf -e -f -m -r -s -tp -w'
;;
update )
opts='--all --dryRun --force --from --migrate-only --next --registry --to -d'
;;
v | version )
opts='--verbose'
;;
......
......@@ -13,20 +13,20 @@
# -O - enable OS detection
# -sA - TCP ACK scan
# -F - fast scan
# --script=vulscan - also access vulnerabilities in target
# --script=vuln - also access vulnerabilities in target
alias nmap_open_ports="nmap --open"
alias nmap_list_interfaces="nmap --iflist"
alias nmap_slow="nmap -sS -v -T1"
alias nmap_fin="nmap -sF -v"
alias nmap_full="nmap -sS -T4 -PE -PP -PS80,443 -PY -g 53 -A -p1-65535 -v"
alias nmap_check_for_firewall="nmap -sA -p1-65535 -v -T4"
alias nmap_slow="sudo nmap -sS -v -T1"
alias nmap_fin="sudo nmap -sF -v"
alias nmap_full="sudo nmap -sS -T4 -PE -PP -PS80,443 -PY -g 53 -A -p1-65535 -v"
alias nmap_check_for_firewall="sudo nmap -sA -p1-65535 -v -T4"
alias nmap_ping_through_firewall="nmap -PS -PA"
alias nmap_fast="nmap -F -T5 --version-light --top-ports 300"
alias nmap_detect_versions="nmap -sV -p1-65535 -O --osscan-guess -T4 -Pn"
alias nmap_check_for_vulns="nmap --script=vulscan"
alias nmap_full_udp="nmap -sS -sU -T4 -A -v -PE -PS22,25,80 -PA21,23,80,443,3389 "
alias nmap_traceroute="nmap -sP -PE -PS22,25,80 -PA21,23,80,3389 -PU -PO --traceroute "
alias nmap_detect_versions="sudo nmap -sV -p1-65535 -O --osscan-guess -T4 -Pn"
alias nmap_check_for_vulns="nmap --script=vuln"
alias nmap_full_udp="sudo nmap -sS -sU -T4 -A -v -PE -PS22,25,80 -PA21,23,80,443,3389 "
alias nmap_traceroute="sudo nmap -sP -PE -PS22,25,80 -PA21,23,80,3389 -PU -PO --traceroute "
alias nmap_full_with_scripts="sudo nmap -sS -sU -T4 -A -v -PE -PP -PS21,22,23,25,80,113,31339 -PA80,113,443,10042 -PO --script all "
alias nmap_web_safe_osscan="sudo nmap -p 80,443 -O -v --osscan-guess --fuzzy "
# node plugin
To use it, add `node` to the plugins array of your zshrc file:
```zsh
plugins=(... node)
```
This plugin adds `node-docs` function that open specific section in [Node.js](https://nodejs.org) documentation (depending on the installed version).
For example:
```zsh
# Opens https://nodejs.org/docs/latest-v10.x/api/fs.html
$ node-docs fs
# Opens https://nodejs.org/docs/latest-v10.x/api/path.html
$ node-docs path
```
## npm plugin
The npm plugin provides completion as well as adding many useful aliases.
To use it, add npm to the plugins array of your zshrc file:
```
plugins=(... npm)
```
## Aliases
| Alias | Command | Descripton |
|:------ |:-----------------------------|:----------------------------------------------------------------|
| `npmg` | `npm i -g` | Install dependencies globally |
| `npmS` | `npm i -S` | Install and save to dependencies in your package.json |
| `npmD` | `npm i -D` | Install and save to dev-dependencies in your package.json |
| `npmE` | `PATH="$(npm bin)":"$PATH"` | Run command from node_modules folder based on current directory |
| `npmO` | `npm outdated` | Check which npm modules are outdated |
| `npmV` | `npm -v` | Check package versions |
| `npmL` | `npm list` | List installed packages |
| `npmL0` | `npm ls --depth=0` | List top-level installed packages |
| `npmst` | `npm start` | Run npm start |
| `npmt` | `npm test` | Run npm test |
| `npmR` | `npm run` | Run npm scripts |
| `npmP` | `npm publish` | Run npm publish |
| `npmI` | `npm init` | Run npm init |
(( $+commands[npm] )) && {
__NPM_COMPLETION_FILE="${ZSH_CACHE_DIR}/npm_completion"
__NPM_COMPLETION_FILE="${ZSH_CACHE_DIR:-$ZSH/cache}/npm_completion"
if [[ ! -f $__NPM_COMPLETION_FILE ]]; then
npm completion >! $__NPM_COMPLETION_FILE 2>/dev/null
......@@ -52,3 +52,6 @@ alias npmR="npm run"
# Run npm publish
alias npmP="npm publish"
# Run npm init
alias npmI="npm init"
......@@ -11,7 +11,21 @@ This plugin automatically registers npx command-not-found handler if `npx` exist
plugins=(.... npx)
```
- Globally install npx binary (you need node.js installed too!)
- Globally install npx binary (npx will be auto installed with recent versions of Node.js)
```bash
sudo npm install -g npx
```
## Note
The shell auto-fallback doesn't auto-install plain packages. In order to get it to install something, you need to add `@`:
```
➜ jasmine@latest # or just `jasmine@`
npx: installed 13 in 1.896s
Randomized with seed 54385
Started
```
It does it this way so folks using the fallback don't accidentally try to install regular typoes.
# 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)
```
......@@ -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 <node|iojs|node version number>'
'uninstall:uninstall a version'
'use:modify PATH to use version'
'run:run version with given arguments'
'use:modify PATH to use <version>. Uses .nvmrc if available'
'exec:run <command> on <version>. Uses .nvmrc if available'
'run:run `node` on <version> with <args> 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 <version> to current version'
'unload:unload `nvm` from shell'
'which:display path to installed node version. Uses .nvmrc if available'
)
_arguments -C '*:: :->subcmds' && return 0
......
# 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
# Nyan plugin
This plugin adds a command to display [Nyan Cat](https://en.wikipedia.org/wiki/Nyan_Cat) right inside your terminal.
**Plugin is deprecated**. Check [official repo](https://github.com/klange/nyancat) for more information.
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment