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

Re: Problem with complete-all



* On Fri Aug 13, Oliver Kiddle wrote:
> It seems we need to fix the example in the manual.
> 
> > zle -C all-matches complete-word _generic
> > bindkey '^Xx' all-matches
> > zstyle ':completion:all-matches:*' old-matches only
> > zstyle ':completion:all-matches::::' completer _all_matches
> 
> Try changing the last style to add _complete after _all_matches:
>   zstyle ':completion:all-matches::::' completer _all_matches _complete
> It needs _complete there to actually generate some matches.

Thank you for your reply, Oliver. It still doesn't work exactly as I'd
expect, though.

This is what I now have in my .zshrc:

zle -C all-matches complete-word _generic
bindkey '^Xx' all-matches
zstyle ':completion:all-matches:*' old-matches only
zstyle ':completion:all-matches::::' completer _all_matches _complete
zstyle ':completion:all-matches:*' insert true
zstyle ':completion:all-matches:*' file-patterns \
    '%p:globbed-files' '*(-/):directories' '*:all-files'


Now, if I for example have added the files "file" and "text", I have to
press '^Xx' twice before the added files are inserted after 'cvs add '.
Pressing it once doesn't have any effect.

If I have added the files "file1" and "file2", pressing '^Xx' once gives
me "file" on the command line, i.e. it completes the unique part, just
like complete-word usually does. Pressing '^Xx' another time gives me both
file-names.

How can I change this so that '^Xx' inserts all the files the first time
it is used?

Jesper



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