Tarrasch / zsh-autoenv

Autoenv for zsh
700 stars 30 forks source link

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

Closed blueyed closed 9 years ago

blueyed commented 9 years ago

.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?

Tarrasch commented 9 years ago

I'm all for it :)

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

blueyed commented 9 years ago

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

Tarrasch commented 9 years ago

Thanks! Very useful resources!

blueyed commented 9 years ago

See #32.

ryneeverett commented 9 years ago

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?

blueyed commented 9 years ago

@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.

Tarrasch commented 9 years ago

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

ryneeverett commented 9 years ago

@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.

blueyed commented 9 years ago

@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.

ryneeverett commented 9 years ago

@blueyed thanks, hadn't noticed that!