August 2023
The order of files being loaded by ZSH is the following:
.zshenv
.zprofile
if login.zshrc
if interactive.zlogin
if login.zlogout
sometimesWhy? sometimes variables might be replaced by subsequent files or some other configuration that you don’t desire might be applied.
Be careful when setting things on .zshenv
since it can be overriden by subsequent scripts. Also, only .zshrc
should be used for things like prompt colors and user scripts.