zsh-users
 help / color / mirror / code / Atom feed
From: "Jesper Nygårds" <jesper.nygards@gmail.com>
To: zsh-users@zsh.org
Subject: Re: Completing all possible candidates
Date: Tue, 15 Jan 2013 08:28:14 +0100	[thread overview]
Message-ID: <CABZhJg-Gg8eDveaio3A4wDmHwV+hP3dFcQcgc6F_Ck6vGwQ3Hw@mail.gmail.com> (raw)
In-Reply-To: <130111063215.ZM11317@torch.brasslantern.com>

[-- Attachment #1: Type: text/plain, Size: 1081 bytes --]

Great thanks, Bart! That worked very well. If anyone else is interested,
here's my result:

_my-prev-result() {
    local hstring
    if [[ $WIDGET = *-all-* ]]; then
        compstate[insert]=all
    fi
    # Run last command again, save output in hstring
    hstring=$(eval $(fc -l -n -1))
    # Split items on new-line into an array, quote each item
    compadd - ${(@f)hstring}
}

zle -C my-prev-comp menu-complete _my-prev-result
bindkey '\ee' my-prev-comp

zle -C my-all-prev-comp complete-word _my-prev-result
bindkey '^xE' my-all-prev-comp




On Fri, Jan 11, 2013 at 3:32 PM, Bart Schaefer <schaefer@brasslantern.com>wrote:

> On Jan 11, 12:30pm, Jesper Nygårds wrote:
> }
> } Simply stated, I want a key that says: "run the previous command line,
> and
> } put all the resulting output on the command line". How to do this?
>
> Take a look at Functions/Zle/keeper in the distributed set of examples.
> It doesn't capture the same results that you are looking for, but it
> has functions for copying those results to the command line.
>

  reply	other threads:[~2013-01-15  7:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-11 11:30 Jesper Nygårds
2013-01-11 14:32 ` Bart Schaefer
2013-01-15  7:28   ` Jesper Nygårds [this message]
2013-01-17  3:14     ` Bart Schaefer
2013-01-17  6:28       ` Jesper Nygårds
  -- strict thread matches above, loose matches on Subject: below --
2012-04-03 19:08 Large LS_COLORS makes auto_cd very slow Jesper Nygårds
2012-04-04  7:52 ` Bart Schaefer
2012-04-04 16:57   ` Jesper Nygårds
2012-04-05  9:30   ` Václav Zeman
2012-04-05 15:51     ` Bart Schaefer
2012-04-05 16:33       ` Bart Schaefer
2012-04-05 17:00         ` Philippe Troin
2012-04-06  9:49       ` Václav Zeman
2012-04-06 11:07         ` Mark van Dijk
2012-04-06 15:51         ` Bart Schaefer
2012-04-09  8:23         ` Václav Zeman
2012-04-09 19:28           ` Bart Schaefer
2012-04-06 18:30   ` Valodim Skywalker
2012-04-07 16:43     ` 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=CABZhJg-Gg8eDveaio3A4wDmHwV+hP3dFcQcgc6F_Ck6vGwQ3Hw@mail.gmail.com \
    --to=jesper.nygards@gmail.com \
    --cc=zsh-users@zsh.org \
    /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).