Shell
Switch branches/tags
Nothing to show
Clone or download
Latest commit f374357 Apr 5, 2018
Permalink
Failed to load latest commit information.
.gitignore new file: .gitignore Mar 6, 2015
LICENSE Initial commit Aug 15, 2014
README.md Change instruction for instalation Oct 29, 2017
autoenv.plugin.zsh remove ugly debug commands Apr 4, 2018
term.png Change image Oct 29, 2017

README.md

Autoenv

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

This plugin support for enter and leave events. By default .env is used for entering, and .out for leaving. And you can set variable COLORS=true 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 .env & .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/.env
/var/www/.env
/var/www/myproject/.env
  • If you are in the directory / and execute cd /home/user/dir1 this plugin will source following files if they exist
/home/.env
/home/user/.env
/home/user/dir1/.env
  • 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

Example of .env and .out files useful for node.js developing

.env

nvm use node
OLDPATH=$PATH
export PATH=`pwd`/node_modules/.bin:$PATH

.out

nvm use system
export PATH=$OLDPATH

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