Git Product home page Git Product logo

fast-zsh-nvm's Introduction

Fast-ZSH-NVM

Overview

A ZSH plugin to initialize NVM quickly when a new terminal opens.

If AUTO_LOAD_NVMRC_FILES is set to true, this plugin also runs nvm use automatically whenever you enter a directory that contains an .nvmrc file (which NVM reads to discover what version of node to use in that location).

Why?

Other NVM-loading scripts I've seen (including the default technique provided in NVM itself) have been widely reported to be slow.

Thanks to some feedback from NVM's main author and another helpful developer, there are a couple ways to speed this process up (the --no-use option and asynchronous loading). I just compiled both into an easy-to-install package.

Integration with plugin managers

fast-zsh-nvm requires the mafredri/zsh-async package, so be sure to install both in your plugin manager of choice.

Update your .zshrc file with the following two lines (order matters):

antibody bundle mafredri/zsh-async
antibody bundle allanjamesvestal/fast-zsh-nvm

Update your .zshrc file with the following two lines (order matters). Do not use the antigen theme function.

antibody bundle mafredri/zsh-async
antibody bundle allanjamesvestal/fast-zsh-nvm
zgen load mafredri/zsh-async
zgen load allanjamesvestal/fast-zsh-nvm

Update your .zshrc file with the following two lines:

zplug mafredri/zsh-async, from:github
zplug allanjamesvestal/fast-zsh-nvm, from:github

Configuration

fast-zsh-nvm has two configuration options. Each can be triggered by setting the corresponding environment variable to true.

AUTO_LOAD_NVMRC_FILES listens every time you change directories. If the new directory has an .nvmrc file, this option will automatically switch to the correct node verson for that folder.

LOAD_NVMRC_ON_INIT extends the plugin to also run that auto-loading behavior just after the terminal session starts. This is disabled by default, as it adds significantly to the initial load time if your starting directory contains a .nvmrc file.

fast-zsh-nvm's People

Contributors

allanjamesvestal avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.