direnv is great for switching any envnvariables let given directory.
I use it when I have projects with different jdks or nodejs.