diff options
author | Sebastian Reichel <sre@ring0.de> | 2011-11-24 17:35:25 +0100 |
---|---|---|
committer | Sebastian Reichel <sre@ring0.de> | 2011-11-24 17:35:25 +0100 |
commit | dac2c6ee79dc140ff0d4b43bd94c47cc6b3d163e (patch) | |
tree | 129eccb659971e74f9a05157eb48920706d18a46 | |
parent | 2e93859c99a03439bbbafaaed6a9d5b4da291647 (diff) | |
download | zsh-config-dac2c6ee79dc140ff0d4b43bd94c47cc6b3d163e.tar.bz2 |
add chpwd_profiles function
-rw-r--r-- | zshrc | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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 %~" } |