profiles.plugin.zsh
405 bytes
1# You will probably want to list this plugin as the first in your .zshrc.
2
3# This will look for a custom profile for the local machine and each domain or
4# subdomain it belongs to. (e.g. com, example.com and foo.example.com)
5parts=(${(s:.:)HOST})
6for i in {${#parts}..1}; do
7 profile=${(j:.:)${parts[$i,${#parts}]}}
8 file=$ZSH_CUSTOM/profiles/$profile
9 if [ -f $file ]; then
10 source $file
11 fi
12done