Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: directory specific functions and aliases



John Eikenberry <jae@xxxxxxxx> writes:

> Peter Stephenson wrote:
>
>> On Fri, 13 Feb 2015 15:41:38 +0000
>> Peter Stephenson <p.stephenson@xxxxxxxxxxx> 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  <chneukirchen@xxxxxxxxx>  http://chneukirchen.org



Messages sorted by: Reverse Date, Date, Thread, Author