Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to insert completions on command line
- X-seq: zsh-users 10626
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: How to insert completions on command line
- Date: Sat, 19 Aug 2006 20:16:27 -0700
- In-reply-to: <20060819234130.GA11224@xxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <237967ef0608181647v2c9d526evd1afa34d9b0a366d@xxxxxxxxxxxxxx> <060818205326.ZM24653@xxxxxxxxxxxxxxxxxxxxxx> <237967ef0608182215q2b59fdb0w5f645f72385a9508@xxxxxxxxxxxxxx> <060819111754.ZM28540@xxxxxxxxxxxxxxxxxxxxxx> <20060819234130.GA11224@xxxxxxxxxxxxx>
On Aug 20, 1:41am, Vincent Lefevre wrote:
} Subject: Re: How to insert completions on command line
}
} On 2006-08-19 11:17:54 -0700, Bart Schaefer wrote:
} > zle -C all-matches complete-word _generic
} > bindkey '^Xa' all-matches
} > zstyle ':completion:all-matches:*' old-matches only
} > zstyle ':completion:all-matches::::' completer _all_matches
}
} I've tried for instance: mail ^Xa
} but the ^Xa has no effect, whereas [Tab] lists all the possible
} completions.
I had forgotten (and the manual, from which I copied those lines, doesn't
state directly) how _all_matches works. You have to first generate the
list of completions with a normal completer (such as by pressing tab) and
then type ^Xa to insert them on the line. _all_matches doesn't generate
any completions of its own.
To get the effect of having ^Xa both generate and insert completions,
you need:
zle -C all-matches complete-word _generic
bindkey '^Xa' all-matches
zstyle ':completion:all-matches:*' insert yes
zstyle ':completion:all-matches::::' completer \
_all_matches _complete
Replace or augment _complete with whatever other completers you want,
but _all_matches must come first.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author