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

completion with globbing, take 2



Several days ago, I wanted to know how I could get zsh to respond to 

something *TAB

by replacing the * with the list everything that the completion system
would return instead of everything * would match in the current
directory.  I was told to do this:

zstyle ':completion:*' completer _oldlist _complete _match
bindkey "^I" complete-word

I've spent a lot of time trying to figure this out, but this still
doesn't work and I don't know how to make it work.  This gives a
behavior like menu-complete.  I never want menu-complete-like
functionality.  I want behavior more like what expand-or-complete does
except that I want only what the completion system would return to be
substituted.

I will be very explicit to reduce the chance of my question being
misunderstood.

zsh -f

> zsh% autoload -U compinit
> zsh% compinit
> zsh% mkdir /tmp/z
> zsh% cd /tmp/z
> zsh% mkdir 1 2 3
> zsh% touch a b c

Type:

> zsh% rmdir TAB

You see:

> zsh% rmdir 
> 1/  2/  3/

Type:

> zsh% rmdir *TAB

You see:

> zsh% rmdir 1 2 3 a b c 

Now configure as above:

> zsh% zstyle ':completion:*' completer _oldlist _complete _match
> zsh% bindkey "^I" complete-word

Type:

> zsh% rmdir *TAB

You see:

> zsh% rmdir 1/
1/  2/  3/

Each subsequent TAB rotates between 1/, 2/, and 3/.

What I want:

> zsh% rmdir *TAB

should yield

> zsh% rmdir 1 2 3 

Is there a way to do this?

--
E. Jay Berkenbilt (ejb@xxxxxx)  |  http://www.ql.org/q/



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