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

Re: (one more) Completion question

On Jan 29,  1:22pm, B.Stephens@xxxxxxxxx wrote:

> I'd like the completion to be a bit stickier: I quite often find myself 
> changing to some utterly uninteresting directory because there happens to be a 
> directory "~/src" or something, when what I really wanted was "srcs" under the 
> current directory (but of course I pressed Return too quickly).
> It's not too annoying though (I can always use popd), and I'm not even sure 
> what behaviour I'd like, exactly.  Perhaps the above requested behaviour would 
> work: I could have cd complete first to subdirectories of the current 
> directory, and only then to things under directories in cdpath?

What you say at the end is what I would do. Personally, I don't use a
$cdpath but have a few aliases which do cd from a particular directory
(cdd does a cd from home etc).

This reminded me of a suggestion that I was thinking of. I don't find
pushd and popd to be a very natuaral way of doing things. Half the time
I forget to use popd when I previously did a pushd and I often only
realise after I have gone to a new directory that I should have used

I regularly use "cd -" to return to where I was last but often I want to
go back where I was a while ago. What I would like is to have "cd -" and
"cd +". When I cd somewhere, it would be put on a sort of stack so "cd
-" would pop the directory off the stack to return to where you have
been. Typing "cd -" again would take you not back to where you last were
but to the previous directory on the stack: "cd +" would go back to
where you were before. If you are not sure that you understand what I am
saying, I mean something like the forward and back buttons in Netscape,
where "cd -" is equivalent to back and "cd +" is equivalent to forward -
just with directories as opposed to web pages.

Another way of making it better would be a key combination (maybe Alt+Up
and Alt+Down) which would cycle through past directories if you have
typed cd on the current input line.

Does anyone have any ideas as to how these could be implemented using
functions and arrays or whatever.

Oliver Kiddle.

P.S. I seem to have deleted the e-mail about zsh 3.1.2-zefram and more
specifically the location from which it can be downloaded. Could someone
please mail me the location.

/  \|.   _ _  |_/. _| _|| _     E-mail: opk101@xxxxxxxxxxxxx
\__/||\/(-|   | \|(_|(_||(-        Web: http://www.york.ac.uk/~opk101/

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