summaryrefslogtreecommitdiff
path: root/plugins/profiles/profiles.plugin.zsh
blob: 8faae6b53290b9fa9fb37255fb0159d142327df7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
# You will probably want to list this plugin as the first in your .zshrc.

# This will look for a custom profile for the local machine and each domain or
# subdomain it belongs to. (e.g. com, example.com and foo.example.com)
parts=(${(s:.:)$(hostname)})
for i in {${#parts}..1}; do
  profile=${(j:.:)${parts[$i,${#parts}]}}
  file=$ZSH_CUSTOM/profiles/$profile
  if [ -f $file ]; then
    source $file
  fi
done