
ATTENTION: Early alpha!
It is direnv but for a more global scope. So if you want to have directory based environments, use direnv,
but if you want to have an environment for the current shell, you can use fbenv.
cargo install fbenvfbenv.toml to your home directory:```toml [environment1] SOME_VAR = "foo"
[environment2] SOME_VAR = "bar" ```
Manual usage:
fbenv ls to show the keys of all your environmentsfbenv get environment1 to get an output like:
```bash
export FBENV=environment1;export SOME_VAR="foo"; ```
fbenv:
bash
eval $(fbenv get environment1)
printenv | grep SOME_VAR should yield "foo" ```toml SOME_VAR = "blubb"
[environment1] SOMEOTHERVAR = "bla" ```
will ignore the variable SOME_VAR!
fzf for adding extra sugar to your workflow :)zsh config:bash
if [[ -x "$(command -v fbenv)" ]];
then
if [[ -x "$(command -v fzf)" ]];
then
eval $(fbenv print-zsh-setup --with-fzf 2>/dev/null);
else
eval $(fbenv print-zsh-setup 2>/dev/null);
fi;
fi;
switch-env commandWhen you are lucky to use the grml zsh config, you can add the current environment to your prompt:
```bash function fbenvprompt () { if [ -n "$FBENV" ]; then REPLY="fbenv ~ $FBENV " else REPLY="" fi; }
grmlthemeaddtoken longpath '%60<..<%~%<<' '%B' '%b grmlthemeaddtoken magentahost '%m' '%F{magenta}' '%f' grmlthemeaddtoken greenuser '%n' '%F{green}' '%f' grmlthemeaddtoken gtprompt "»" grmlthemeaddtoken space ' ' grmlthemeaddtoken fb-env -f fbenvprompt '%F{cyan}' '%f'
zstyle ':prompt:grml:left:setup' items date space time fb-env change-root greenuser at magentahost newline gtprompt space ```
This will look like this:
2018-07-08 22:46:13 fbenv ~ environment1 user@host
»