Mac – Reuse .bash_profile for Fish in Mac

bashfishitermmacterminal

I'm using iTerm on my Mac and I have a .bash_profile that I have been comfortably using. I recently got to know about fish bash and I installed it on my Mac and all of a sudden my .bash_profile is not being sourced. Any ideas as to why I could not see it?

How could I instruct my iTerm and fish to source my .bach_profile like it was doing before without fish?

Best Answer

Fish has exactly one user controlled config file which is named $HOME/.config/fish/config.fish by default. Fish also has an export command for compatibility with bash/zsh/sh but it just a thin wrapper around the fish form:

set -gx VAR value

As for bash aliases you have two choices: turn them into abbreviations (see the "abbr" command) or functions. In fish you can define a function with its "alias" command but that simply turns

alias myalias some_command --arg1 --arg2

into

function myalias; some_command --arg1 --arg2 $argv; end

As Glenn Jackman pointed "fish is not bash". It is not an improved bash. Switching to fish isn't hard but does require a little effort. I made the switch 13 months ago and think it is worth the effort.

Related Question