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

Re: Three Bugs/Problems and a Requested Feature



>3. named directories sometimes don't show the shortest path.  Happens
>   randomly.
>
>> maps=/tmp/maps
>> mpt1=~maps/mpt1
>> mpt2=~mpt1/mpt2
>> mpt3=~mpt2/mpt3
>> cd ~mpt3
>
>OUTPUT of "%~" will show different things.  ie
>   >  ~mpt3   # Correct
>   >  ~maps/mpt1/mpt2/mpt3   # Not the shortest one
>   >  ~mpt2/mpt3   # Not the shortest one
>
>I have many many named directories if that matters.

It works for me.  However, if you do

% maps=/tmp/maps
% mpt1=~maps/mpt1
% mpt2=~mpt1/mpt2
% mpt3=~mpt2/mpt3
% cd /tmp/maps/mpt1/mpt2/mpt3

then %~ will give ~mpt2/mpt3.  If you do

% maps=/tmp/maps
% mpt1=~maps/mpt1
% mpt2=~maps/mpt1/mpt2
% mpt3=~maps/mpt1/mpt2/mpt3
% cd /tmp/maps/mpt1/mpt2/mpt3

then %~ will give ~maps/mpt1/mpt2/mpt3.  Remember that a parameter is
only used for %~ if it has already been used in a ~ expansion.  Could
this be the problem?  If so, the AUTO_NAME_DIRS option may solve it.

>WANTED FEATURE!!!!!
>
>At the autocorrect prompted I have always "dreamed" of being able to
>hit "c" for change.  Which would put me in "change mode" for the
>word that needs to be fixed.  Kind of like "cw" in vi.  So say
>I had "tcat thisisahzolifilethathasareallylongname.tar.gz | tar xf -
>
>Currently it might try to correct that "tcat" to "cat" instead of 
>"zcat".  So I would need to do a "e" for edit, and then arrow over or
>hit "ESC0ecw". It would be nice to be able to hit 'c' have it do basicly
>a vi-ish "cw" on the word "tcat", since it already knew thats what needed
>to be corrected. Don't know if this makes any sense, if it is really hard,
>but I would use it all the time.

Seems reasonable.  It wouldn't fit in with the correction mechanism
very well, but it's possible with a bit of rearrangement.

-zefram



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