From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20562 invoked by alias); 14 Feb 2015 16:43:29 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 34542 Received: (qmail 12510 invoked from network); 14 Feb 2015 16:43:24 -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=-0.5 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW,RCVD_NUMERIC_HELO, SPF_HELO_PASS,T_FSL_HELO_BARE_IP_2 autolearn=no version=3.3.2 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-workers@zsh.org From: Christian Neukirchen Subject: Re: directory specific functions and aliases Date: Sat, 14 Feb 2015 17:43:21 +0100 Message-ID: <87zj8gxx3q.fsf@gmail.com> References: <20150213154138.118cf396@pwslap01u.europe.root.pri> <20150213155212.49ed641f@pwslap01u.europe.root.pri> <20150213211159.GB12771__23092.9831196137$1423863146$gmane$org@neroon.zhar.net> Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 141.84.9.5 In-Reply-To: <20150213211159.GB12771__23092.9831196137$1423863146$gmane$org@neroon.zhar.net> (John Eikenberry's message of "Fri, 13 Feb 2015 13:11:59 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) John Eikenberry writes: > Peter Stephenson wrote: > >> On Fri, 13 Feb 2015 15:41:38 +0000 >> Peter Stephenson wrote: >> > 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. >> >> Come to think of it, that can produce multiple matches. >> >> (../)#foo(oL[1]) >> >> gets you the first one you encounter going up (the one with the shortest >> name). > > I also use this for a local history and have found it made more sense to get > the one with the longest name, the one 'closer' to you in the tree. I also > found expanding the name useful (the :a). I use this... > > (../)#.zsh_history(oL[-1]:a)) I think you want (Od[1]:a) really? -- Christian Neukirchen http://chneukirchen.org