summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Reichel <sre@ring0.de>2011-11-24 17:35:25 +0100
committerSebastian Reichel <sre@ring0.de>2011-11-24 17:35:25 +0100
commitdac2c6ee79dc140ff0d4b43bd94c47cc6b3d163e (patch)
tree129eccb659971e74f9a05157eb48920706d18a46
parent2e93859c99a03439bbbafaaed6a9d5b4da291647 (diff)
downloadzsh-config-dac2c6ee79dc140ff0d4b43bd94c47cc6b3d163e.tar.bz2
add chpwd_profiles function
-rw-r--r--zshrc14
1 files changed, 14 insertions, 0 deletions
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 %~" }