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

Re: most-recent-file completion and accept-line



On Thu, 23 Sep 2004, Eric Smith wrote:

> How do I bind a key combination to complete the most recent file
> and then automatically run accept-line or <enter> on this
> filename?

This seems like an odd question, because any key _combination_ you choose
will be at least as many keystrokes as typing ctrl-o enter.  Normally you
want bindings for things that would otherwise take lots of keystrokes.

However:

accept-most-recent() {
  zle most-recent-file && zle .accept-line
}
zle -N accept-most-recent
bindkey '^X^O' accept-most-recent



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