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

configuring the new completion system



On Tue, 6 Jun 2000, Bart Schaefer wrote:
> As a workaround, the following should behave the way you want:
> 
> bindkey '\t' complete-word
> autoload -U compinit
> compinit
> zstyle ':completion:*' completer _expand _complete
> zstyle ':completion:*:expand:::' glob 1
> zstyle ':completion:*:expand:::' substitute 1

This comes close, but there's still something about this setup that
annoys the heck out of me.  (I'm only just beginning to try to get the
new completion system working (since I have mainly been using a
customized version of 3.0.7 until just recently), so hopefully this
can be tweaked.)

My biggest gripe is that if I type "~/.z" or "$HOME/.z" and press tab,
the prefix expands into my home directory path.  I *hate* this.  I'm
typing an abbreviated directory path and I want to complete an
abbreviated directory path.  When I remove the "_expand" portion of
the zstyle, then that part of the completion works properly, but I can
no longer expand "~/.z*" into a list of file names.  I would love to
see a version of _expand that works like it did in 3.0.x.

On a related note, I've always disliked the fact that wildcard
expansion expands variables and tilde references.  For instance, if I
type:

    touch ~/.tmp{1..3}
    rm ~/.tmp*<tab>

I want to see:

    rm ~/.tmp1 ~/.tmp2 ~/.tmp3

not:

    rm /home/wayne/.tmp1 /home/wayne/.tmp2 /home/wayne/.tmp3

I've always been meaning to look into fixing this.  I figure that the
code can either keep a copy of the unexpanded strings to substitute
into, or that it can do a set of reverse substitutions after the
wildcard expansion has completed (e.g. turning "/home/wayne" back into
a "~" at the tail end of the process).

Finally, one of the just-committed cvs changes has introduced a bug
where an extra space is getting added when it shouldn't be.  Now, if
you type "~/.z<tab>" you get "/home/wayne/.z " even though that file
does not exist.  You should be able to reproduce this as follows:

% zsh -f
% autoload -U compinit
% compinit
% zstyle ':completion:*' completer _expand _complete
% zstyle ':completion:*:expand:::' glob 1
% ls ~/.z<tab>

..wayne..



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