mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-25 23:30:08 +00:00
Add new profiles plugin.
Depending on the machine you're logged into, you may want to use specific configuration. Add 'profiles' to your list of plugin will try to find a profile for the local machine and each (sub)domain it belongs to.
This commit is contained in:
parent
615e41b0ec
commit
6d762fa053
1 changed files with 12 additions and 0 deletions
12
plugins/profiles/profiles.plugin.zsh
Normal file
12
plugins/profiles/profiles.plugin.zsh
Normal file
|
@ -0,0 +1,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
|
Loading…
Reference in a new issue