# ^Xa to insert all matches
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
UPDATE: The snippet above brings
insert-completions to zsh. Thanks, Trevor Joynson, who has provided the solution in comment.
insert-completions (see man bash) is the
feature I most miss in bash.
[insert-completions] Insert all completions of the text before point that would have been
generated by possible-completions.
Its default binding is M-*, a.k.a, Alt-Shift-8 or
It is useful for simple batch operations, such as removing all git branches
After I switched to zsh, I have been looking for a similar command, but for
no results. However, I just discovered the zsh way to select multiple
completions recently, using
[accept-and-hold] Push the contents of the buffer on the buffer stack and
The default binding is M-a (a.k.a, Alt-a or
Meta-a). If the command line has input content
executes the line
ls without clearing the input.
It seems unrelated. But if completion menu is activated and a menu item is
selected (the simplest way is Tab twice),
the current menu item without closing completing menu. So it is possible to
select multiple items by navigating to wanted items, and type M-a
to select them.