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 fbenv
fbenv.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
command