From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25707 invoked from network); 6 Jun 2000 22:23:18 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 6 Jun 2000 22:23:18 -0000 Received: (qmail 4136 invoked by alias); 6 Jun 2000 22:22:53 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 3118 Received: (qmail 4126 invoked from network); 6 Jun 2000 22:22:52 -0000 Date: Tue, 6 Jun 2000 15:22:37 -0700 (PDT) From: Wayne Davison X-Sender: wayne@phong.blorf.net To: zsh-users@sunsite.auc.dk Subject: configuring the new completion system In-Reply-To: <1000606032038.ZM25884@candle.brasslantern.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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* 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" 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 ..wayne..