From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27785 invoked by alias); 13 Feb 2015 21:30:45 -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: 19869 Received: (qmail 4243 invoked from network); 13 Feb 2015 21:30:31 -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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.2 Date: Fri, 13 Feb 2015 13:11:59 -0800 From: John Eikenberry To: zsh-users@zsh.org Subject: Re: directory specific functions and aliases Message-ID: <20150213211159.GB12771@neroon.zhar.net> Mail-Followup-To: John Eikenberry , zsh-users@zsh.org References: <20150213154138.118cf396@pwslap01u.europe.root.pri> <20150213155212.49ed641f@pwslap01u.europe.root.pri> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="SkvwRMAIpAhPCcCJ" Content-Disposition: inline In-Reply-To: <20150213155212.49ed641f@pwslap01u.europe.root.pri> User-Agent: Mutt/1.5.23 (2014-03-12) --SkvwRMAIpAhPCcCJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > Come to think of it, that can produce multiple matches. >=20 > (../)#foo(oL[1]) >=20 > 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)) --=20 John Eikenberry [ jae@zhar.net - http://zhar.net ] [ PGP public key @ http://zhar.net/jae_at_zhar_net.gpg ] ________________________________________________________________________ "Perfection is attained, not when no more can be added, but when no more can be removed." -- Antoine de Saint-Exupery --SkvwRMAIpAhPCcCJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBCgAGBQJU3mifAAoJED2anlkTqUWilp8H/2ij6hzaKhFlwIXBU9dZ62o7 IR/rq6bF+sZsQwfSnxs8176tLzkSQzN4+0i/RcdQs23PZvHpkiVcBoCL8pGZc1E9 gE0g7DZwCxC/qAevrZhd3DuHsvzqEMxMf4P2OMYzJdElAvtUNobgrPkcPukY+a6U YMNR2qqgxz+HrOhAcZMI6f0lsG5I7JsT5yza8+F3wSyUmBVteHDmWAWLdQEBanMi huC691CRT/JxC1Vhvlh5Q+k3sPWL5zZGSCWR4Lvf5Zb0pLHyBkiyjSYhGFegn6wm 4/S+K37b26aqfPLsImPS8VHjugMsvaNsEhcjyWy36yWtrHDUdrDe2Cu0pNwnXEw= =VB3P -----END PGP SIGNATURE----- --SkvwRMAIpAhPCcCJ--