22390353682f742d8ea5e7ef0ec451fa836f2654

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge pull request #1573 from flz/master

Add new profiles plugin.

Diff

 1diff --git a/plugins/profiles/profiles.plugin.zsh b/plugins/profiles/profiles.plugin.zsh
 2new file mode 100644
 3index 0000000000000000000000000000000000000000..8faae6b53290b9fa9fb37255fb0159d142327df7
 4--- /dev/null
 5+++ b/plugins/profiles/profiles.plugin.zsh
 6@@ -0,0 +1,12 @@
 7+# You will probably want to list this plugin as the first in your .zshrc.
 8+
 9+# This will look for a custom profile for the local machine and each domain or
10+# subdomain it belongs to. (e.g. com, example.com and foo.example.com)
11+parts=(${(s:.:)$(hostname)})
12+for i in {${#parts}..1}; do
13+  profile=${(j:.:)${parts[$i,${#parts}]}}
14+  file=$ZSH_CUSTOM/profiles/$profile
15+  if [ -f $file ]; then
16+    source $file
17+  fi
18+done