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

Re: Better Use of dirs,popd?



On 20 February 2010 02:13, Geoff Wing <gcw@xxxxxxx> wrote:
> On Saturday 2010-02-20 00:34 +0000, zzapper output:
> :Hi
> :It's annoying that if I do a
> :> dirs -v
> :I can list my recent directories but cannot cd to a particular one.
> :I guess a nifty bit of scripting could do the job.
> :any ideas other than a clunky
> :dirs -v | gp '^13' | sed  etc etc
>
> % dirs -v
> 0 /
> 1 /tmp
> 2 /home
> 3 /staff
> % pwd
> /
> % cd ~3
> % pwd
> /staff
> % cd ~2
> % pwd
> /home
> %

If you use cd -<num> instead, you can even tabcomplete at the - and
see the stack. You can use a + instead of a - to reverse the numbers
too.

-- 
Mikael Magnusson



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