Sourcing different environment files in Fish Shell

I've recently started using Fish Shell and I really like it since I spend most of my time using the shell, Fish's IntelliSense-like completion is handy.

One thing that bugged me is the lack of being able to easily separate environment variables into separate files so I added this little block inside my fish_prompt function in /etc/fish/functions/ :

Now you can put different aliases / exports in /etc/fish/env/$HOME/.config/fish/env/.

Of course if you're doing this for one command, for example go related exports (GOROOT, GOPATH, etc) it's better to put it in /etc/fish/functions/ and it will be automatically sources the first time you type go.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTMLtags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">