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

Re: In menu-select, how to make accept-line do not put a space



On 7/10/19, Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx> wrote:
> Hello,I'm using the following setup:
>
> zstyle ':completion:*:*:*:default' menu yes select search
> function double-accept { accept-line; accept-line; }
> zle -N double-accept
> bindkey -M menuselect ' ' double-accept
>
> It works fine, but it puts a space after pressing the space to accept
> an entry. I would like it to not do it. How to accomplish this?

This doesn't do what you think it does.

"Note  that  the  following always perform the same task within the
menu selection map and cannot be replaced by user defined widgets, nor
can the set of functions be extended"
..list of widgets..
"any other zle function  not  listed leaves menu selection and
executes that function.  It is possible to make widgets in the above
list do the same by using the form of the widget with a `.' in front.
For example,  the  widget  `.accept-line'  has  the effect of leaving
menu selection and accepting the entire command line."

-- 
Mikael Magnusson



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