tanvir002700 / autoenv

Autoenv for zsh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 Plug horosgrisa/autoenv into .zshrc

Using oh-my-zsh

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

Using antigen

Add antigen bundle horosgrisa/autoenv into .zshrc

Using zgen

Add zgen load horosgrisa/autoenv into .zshrc

About

Autoenv for zsh

License:GNU General Public License v3.0


Languages

Language:Shell 100.0%