profiles.plugin.zsh 406 B

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