From dac2c6ee79dc140ff0d4b43bd94c47cc6b3d163e Mon Sep 17 00:00:00 2001 From: Sebastian Reichel Date: Thu, 24 Nov 2011 17:35:25 +0100 Subject: add chpwd_profiles function --- zshrc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/zshrc b/zshrc index f5b4db9..469779a 100644 --- a/zshrc +++ b/zshrc @@ -108,6 +108,20 @@ vcs_info_wrapper() { echo "${vcs_info_msg_0_}" } +CHPWD_PROFILE='default' +function chpwd_profiles() { + local -x profile + + zstyle -s ":chpwd:profiles:${PWD}" profile profile || profile='default' + if (( ${+functions[chpwd_profile_$profile]} )) ; then + chpwd_profile_${profile} + fi + + CHPWD_PROFILE="${profile}" + return 0 +} +chpwd_functions=( ${chpwd_functions} chpwd_profiles ) + # update title function precmd { title "%n@%m %~" } -- cgit v1.2.3