Until recently, the default file name used by this plugin was
.env
, but now it is.in
. This is done in order not to conflict with.env
files from numerous projects.
.in
and .out
files.This plugin adds support for enter and leave events. By default .in
files are used when entering a directory, and .out
files when leaving a directory. 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 file names of .in
& .out
respectively.
/home/user/dir1
and execute cd /var/www/myproject
this plugin will source the following files if they exist/home/user/dir1/.out
/home/user/.out
/home/.out
/var/.in
/var/www/.in
/var/www/myproject/.in
/
and execute cd /home/user/dir1
this plugin will source the following files if they exist/home/.in
/home/user/.in
/home/user/dir1/.in
/home/user/dir1
and execute cd /
this plugin will source the following files if they exist/home/user/dir1/.out
/home/user/.out
/home/.out
.in
and .out
filesPlease, don't use pwd
or $PWD
, instead of this use $(dirname $0)
. Additionally, the path of the directory being entered or exited is passed as the first argument to both .in
and .out
scripts, should using a symlink be preferred.
nvm use node
OLDPATH=$PATH
export PATH="$(dirname $0)/node_modules/.bin":$PATH
nvm use system
export PATH=$OLDPATH
.env
or/and .env.local
source $(dirname $0)/.env*
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
Add zpm load zpm-zsh/autoenv
into .zshrc
Execute git clone https://github.com/zpm-zsh/autoenv ~/.oh-my-zsh/custom/plugins/autoenv
. Add autoenv
into plugins array in .zshrc
Fig adds apps, shortcuts, and autocomplete to your existing terminal.
Install autoenv
in just one click.
Add antigen bundle zpm-zsh/autoenv
into .zshrc
Add zgen load zpm-zsh/autoenv
into .zshrc