From: Eric Smith <es@fruitcom.com>
To: zsh-users@sunsite.dk
Subject: Re: most-recent-file completion and accept-line
Date: Tue, 2 Nov 2004 21:06:49 +0100 [thread overview]
Message-ID: <20041102200649.GC22898@fruitcom.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0409230054550.21324@toltec.zanshin.com>
Thanks a lot Bart.
When I tried this previously, I could not get it to work, now it kinda works,
so I finally respond. Except you need to press the key combo twice, once for
all the possible options to appear and after the second press it accepts one of
the listed files.
Perhpas I have something configured that interferes with it?
Any way FWIW, here is my experience:
[eric@pepper ~] 13 $ ls -rt1 delm*
delme_fruitcom__08_04.pdf
delme_fruitcom__08_04.txt
delme_fruitcom__16_04.pdf
delme_fruitcom__16_04.txt
delme_zz___fruitcom_Monday_June_28_2004.pdf
delme_zz___fruitcom_Monday_June_28_2004.txt
delme_zz___fruitcom_Saturday_July_10_2004.pdf
delme_zz___fruitcom_Saturday_July_10_2004.txt
delme_zz___fruitcom_Wednesday_September_15_2004.pdf
delme_zz___fruitcom_Wednesday_September_15_2004.txt
delme.pdf
delme.txt
delme.xml
[eric@pepper ~] 13 $ ls delme<^X^O>
[eric@pepper ~] 13 $ ls delme.pdf
delme.pdf delme_zz___fruitcom_Monday_June_28_2004.pdf
delme.txt delme_zz___fruitcom_Monday_June_28_2004.txt
delme.xml delme_zz___fruitcom_Saturday_July_10_2004.pdf
delme_fruitcom__08_04.pdf delme_zz___fruitcom_Saturday_July_10_2004.txt
delme_fruitcom__08_04.txt delme_zz___fruitcom_Wednesday_September_15_2004.pdf
delme_fruitcom__16_04.pdf delme_zz___fruitcom_Wednesday_September_15_2004.txt
delme_fruitcom__16_04.txt
[eric@pepper ~] 13 $ ls delme.pdf<^X^O>
[eric@pepper ~] 13 $ ls delme.txt
delme.txt
<Yes, it looks a bit weird>
Bart Schaefer said:
> 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.
So I bind your function to ^O
> However:
>
> accept-most-recent() {
> zle most-recent-file && zle .accept-line
> }
> zle -N accept-most-recent
> bindkey '^X^O' accept-most-recent
--
Eric Smith
next prev parent reply other threads:[~2004-11-02 20:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-22 22:45 Eric Smith
2004-09-23 7:59 ` Bart Schaefer
2004-11-02 20:06 ` Eric Smith [this message]
2004-11-04 1:52 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20041102200649.GC22898@fruitcom.com \
--to=es@fruitcom.com \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).