Tarrasch / zsh-autoenv

Autoenv for zsh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change default env file names (conflict with typical use of .env)

blueyed opened this issue · comments

.env appears to be commonly used for defining key-value pairs of environment variables (e.g. with foreman etc).

We should change our defaults.

What about using .autoenv.zsh instead of .env, and .autoenv_leave.zsh instead of .env_leave?

I'm all for it :)

Just for future reference, can you link to this foreman project's .env file?

It's mentioned in the man page: https://ddollar.github.io/foreman/

ENVIRONMENT

If a .env file exists in the current directory, the default environment
will be read from it. This file should contain key/value pairs, separated
by =, with one key/value pair per line.

FOO=bar
BAZ=qux

Also relevant: https://github.com/tpope/vim-dotenv

Thanks! Very useful resources!

I understand the decision to change the name to avoid collisions with foreman, but why make the it zsh-specific? Wouldn't any implementation of autoenv work the same? Why not just .autoenv/.autoenv_leave?

@ryneeverett
It makes it clear that it is a Zsh file, where the syntax might differ from other shells.

I am open to change the default again, but not convinced yet.

Agree with @blueyed for the reasons he said. :)

@blueyed Fair enough, though I would personally value compatibility with bash autoenv more than the ability to write zshscript (they could both execute /bin/sh .autoenv)

Also, as someone who types touch .env multiple times a day, the length of the file name is disappointing. Guess I'll have to add one more alias I'll never remember, haha.

@ryneeverett
You know that this is a setting that can be configured?!
Just set/change AUTOENV_FILE_ENTER and AUTOENV_FILE_LEAVE.
This would typically be done before sourcing the plugin, but could be done later, too.

@blueyed thanks, hadn't noticed that!