From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19731 invoked by alias); 13 Feb 2015 15:41:46 -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: 19867 Received: (qmail 24345 invoked from network); 13 Feb 2015 15:41:44 -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=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.2 X-AuditID: cbfec7f4-b7f126d000001e9a-82-54de1aa3eded Date: Fri, 13 Feb 2015 15:41:38 +0000 From: Peter Stephenson To: Zsh Users Subject: Re: directory specific functions and aliases Message-id: <20150213154138.118cf396@pwslap01u.europe.root.pri> In-reply-to: References: Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrMLMWRmVeSWpSXmKPExsVy+t/xq7qLpe6FGHxcamGx4+RKRgdGj1UH PzAFMEZx2aSk5mSWpRbp2yVwZUyZM5O94Dx7xZ9rD5gaGNvZuhg5OSQETCS+n57ODmGLSVy4 tx4sLiSwlFHiyY9kCHsRk8T8TcFdjFxA9jZGiTsbroMVsQioSky+85QZxGYTMJSYumk2I4gt IqAocebXN6YuRg4OYQFTiSuzJEHCvAL2EvM3/gIr5xQIltj09iYLxPwAibn3roCN5BfQl7j6 9xMTxD32EjOvnGGE6BWU+DH5Hlg9s4CWxOZtTawQtrzE5jVvmSHmqEvcuLubfQKj0CwkLbOQ tMxC0rKAkXkVo2hqaXJBcVJ6rqFecWJucWleul5yfu4mRkjAftnBuPiY1SFGAQ5GJR5eicq7 IUKsiWXFlbmHGCU4mJVEeCNuAIV4UxIrq1KL8uOLSnNSiw8xMnFwSjUw1jw8rXCxdkvBK4Yv 9i0CSx6mREbtPyLAlqHt3rhQ+JCk2mPbzfVS2Z+Wx0Z9KMxhOibjXXxvQ82lNQ3yqxqy/6R/ ZhE6fetR+f19mzqv6JSbJd1NmXP4zGZ+f+Nrp4MTPjY51blun/xIrSM/z93qXPr1DbXfZ6rd aDU6dVCvysNs0vJDG9ZqKLEUZyQaajEXFScCAI/GS682AgAA On Fri, 13 Feb 2015 10:05:21 -0500 shawn wilson wrote: > What would be the best way to make functions that do different things > based on the directory I'm in - kinda like rvm does with rubies? I was > hoping for something cleaner than: case $(pwd) This is mainly because > I want to wrap cvs and rsync differently based on repo (and where > within that repo). I use a dot-file in the directory, but you need to be careful with this --- at least check you own the file before using it for extracting commands or anything of that kind. You can easily search backward for a file of the same name in a parent directory if you have EXTENDED_GLOB set: (../)#.thatdotfilename which will allow you to put in the top level of a repository. In particular, I have a local history file that's searched for commands if they match a certain pattern. Integration with the main history file sort of works but isn't as seamless as I'd like. pws