From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9250 invoked by alias); 20 Apr 2012 09:19:35 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17019 Received: (qmail 23922 invoked from network); 20 Apr 2012 09:19:33 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at mi.fu-berlin.de does not designate permitted sender hosts) Date: Fri, 20 Apr 2012 11:01:11 +0200 From: "Christoph (Stucki) von Stuckrad" To: zsh-users@zsh.org Subject: Re: Loading functions Message-ID: <20120420090111.GD2646@localhost.mi.fu-berlin.de> Mail-Followup-To: zsh-users@zsh.org References: <20120419230311.18b75bf0@internecto.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120419230311.18b75bf0@internecto.net> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: "Chr. von Stuckrad" X-Originating-IP: 160.45.113.41 On Thu, 19 Apr 2012, Mark wrote: > Then I realised that ideally my shell would "do something" (e.g. > automatically load functions, set env vars) when I go into a directory > or any subdirectory and "undo" it (unload these functions, unset the > variables) upon leaving the directory. Which ultimately leads to my next > question: can zsh be instructed to have a particular environment that is > local to certain directories? You will have to insert code into the 'hook-function 'chpwd' for example by creating a directory of 'environments' like '~/.vim/direnv.d/*' and put 'setters' and 'unsetters' into files with some naming scheme, and let 'chpwd' source those files according to some schema (tests regexps on name, etc.). This might be realy useful I think... Stucki This -- Christoph von Stuckrad * * |nickname |Mail \ Freie Universitaet Berlin |/_*|'stucki' |Tel(Mo.,Mi.):+49 30 838-75 459| Mathematik & Informatik EDV |\ *|if online| (Di,Do,Fr):+49 30 77 39 6600| Takustr. 9 / 14195 Berlin * * |on IRCnet|Fax(home): +49 30 77 39 6601/