Giter Site home page Giter Site logo

autoenv-1's Introduction

Autoenv

Until recently, the default name was .env, but now it is .in. This is done in order not to conflict with .env files from numerous projects.

Autoenv automatically sources (known/whitelisted) .in and .out files.

This plugin support for enter and leave events. By default .in is used for entering, and .out for leaving. And you can set variable CLICOLOR=1 for enabling colored output.

The environment variables $AUTOENV_IN_FILE & $AUTOENV_OUT_FILE can be used to override the default values for the names of .in & .out respectively.

Example of use

  • If you are in the directory /home/user/dir1 and execute cd /var/www/myproject this plugin will source following files if they exist
/home/user/dir1/.out
/home/user/.out
/home/.out
/var/.in
/var/www/.in
/var/www/myproject/.in
  • If you are in the directory / and execute cd /home/user/dir1 this plugin will source following files if they exist
/home/.in
/home/user/.in
/home/user/dir1/.in
  • If you are in the directory /home/user/dir1 and execute cd / this plugin will source following files if they exist
/home/user/dir1/.out
/home/user/.out
/home/.out

Examples of .in and .out files

Please, don't use pwd or $PWD, instead of this use $(dirname $0)

For node.js developing:

.in

nvm use node
OLDPATH=$PATH
export PATH="$(dirname $0)/node_modules/.bin":$PATH

.out

nvm use system
export PATH=$OLDPATH

For projects with .env or/and .env.local

source $(dirname $0)/.env*

Prerequisites

This plugin depends on zsh-colors.

If you don't use zpm, install it manually and activate it before this plugin. If you use zpm you don’t need to do anything

Installation

Using zpm

Add zpm load zpm-zsh/autoenv into .zshrc

Using oh-my-zsh

Execute git clone https://github.com/zpm-zsh/autoenv ~/.oh-my-zsh/custom/plugins/autoenv. Add autoenv into plugins array in .zshrc

Using antigen

Add antigen bundle zpm-zsh/autoenv into .zshrc

Using zgen

Add zgen load zpm-zsh/autoenv into .zshrc

autoenv-1's People

Contributors

darcmattr avatar grigorii-horos avatar hellola avatar ithinuel avatar lowjoel avatar matthewflamm avatar nagasaki45 avatar tanvir002700 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.