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

RE: menu selection and enter key



> "Virginia Mann" wrote:
> > I'm configuring zsh for the first time and trying to understand the
> > features.
> >
> > I find menu completion very useful, and I like seeing the list of
> candidates
> > below it. <tab><tab><tab> yes, that's the one I want<enter>, and it
> > executes.
> >
> > Then I found menu *selection*, which let me see where I was as I tabbed
> thru
> > the candidates by highlighting where I am in the list, which is very
> > convenient. Unfortunately, when I reach the one I want and hit <enter>,
> it
> > no longer executes. Now it just inserts a space and sits there waiting
> for
> > me to enter more. I have to hit enter again to make it execute.
> 

But you may just as well continue editing current line without executing it.


> accept-line in menu selection is redefined to do that. If I've
> understood what you want it to do correctly, you can do:
> 
> double-accept() {
>   zle accept-line && zle accept-line
> }
> zle -N double-accept
> bindkey -M menuselect '^M' double-accept
> 

Would not simple

bindkey -M menuselect '^M' .accept-line

be easier? 
 
-andrey



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