Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Completing all possible candidates
- X-seq: zsh-users 17564
- From: Jesper Nygårds <jesper.nygards@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Completing all possible candidates
- Date: Tue, 15 Jan 2013 08:28:14 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=eEvcb3BMb7EwduHsqZ1qBx68Zcg7ucr43rnZYDeKJIs=; b=O1V8+zMURGwP7WhBRsf54QbFAOIxytiOoOlMRoCcQP+fa3KgPdXaHu/XP+y/ccFoiG eBMnYYNCJFVZuJsC4VRI+LZAhkhxAZ2bC6A6/Qt63BptI1DovM4WM1tBmY7wj+gL3UHd fEZ3hvWNZJQnmMl3KUtXpmYq9wsqDXoZ6AFGfTHGIYgP1uMUC+YNLl/dtvgal9ra29Hr W+P3YlVohOmYS4a7ftN/zfcPuxjt67+9V6VaMEAavPfavTaYmc8Di6cXPkn23Ad0d0JG JEVZys6UKUVKmmUdkrL+GunncuYUc+63bPhWWZccsqt8muDOKh1GwUlzoqZ9E3h9Z1kz tzSA==
- In-reply-to: <130111063215.ZM11317@torch.brasslantern.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CABZhJg9jVc1PRX0T7p6XR3sc87oszM0hKQSeYAJnZb52Vp36xQ@mail.gmail.com> <jesper.nygards@gmail.com> <130111063215.ZM11317@torch.brasslantern.com>
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@xxxxxxxxxxxxxxxx>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.
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author