From bc3d7a134ece6c78d38d3e7cfcab26d55ba21b70 Mon Sep 17 00:00:00 2001 From: Michel Albert Date: Wed, 19 Dec 2012 08:41:31 +0100 Subject: [PATCH] New plugin: `perhost`. This plugin allows you to load settings based on the current hostname. The per-host config files are stored in `~/.zsh/perhost`. I was not sure whether to look in `~/.zsh` or rather in `~/.oh-my-zsh/etc/perhost`. Both seemed fine to me, although I slightly prefer the second. Any thoughts? --- plugins/perhost/README.rst | 9 +++++++++ plugins/perhost/perhost.plugin.zsh | 4 ++++ 2 files changed, 13 insertions(+) create mode 100644 plugins/perhost/README.rst create mode 100644 plugins/perhost/perhost.plugin.zsh diff --git a/plugins/perhost/README.rst b/plugins/perhost/README.rst new file mode 100644 index 000000000..9904f8a37 --- /dev/null +++ b/plugins/perhost/README.rst @@ -0,0 +1,9 @@ +Per host configuration +====================== + +The plugin ``perhost`` allows you to execute a ZSH script named after the +current hostname. The files live in the directory ``~/.zsh/perhost``. + +To create a file with the correct name, type the following:: + + vim ~/.zsh/perhost/`hostname`.zsh diff --git a/plugins/perhost/perhost.plugin.zsh b/plugins/perhost/perhost.plugin.zsh new file mode 100644 index 000000000..4d67b6e3a --- /dev/null +++ b/plugins/perhost/perhost.plugin.zsh @@ -0,0 +1,4 @@ +local hostconfig=~/.zsh/perhost/$(hostname).zsh +if [ -f ${hostconfig} ]; then + source ${hostconfig} +fi