Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: pushing a string in the cut&paste stack
- X-seq: zsh-users 11412
- From: Stephane Chazelas <Stephane_Chazelas@xxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: pushing a string in the cut&paste stack
- Date: Mon, 16 Apr 2007 17:34:46 +0100
- In-reply-to: <20070416155007.GA29719@xxxxxxxxx>
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <9fda5e550704160530p7e478483i4e8021a9e199ce23@xxxxxxxxxxxxxx> <20070416144411.GB20630@xxxxxxxxx> <9fda5e550704160803o1a26edf2oad09587d5e8b9c87@xxxxxxxxxxxxxx> <20070416155007.GA29719@xxxxxxxxx>
On Mon, Apr 16, 2007 at 05:50:07PM +0200, Andy Spiegl wrote:
> Hi Giulio,
>
> > to put the output of a program in the shell killring, something like
> >
> > myprogram | copythis
>
> This example sounds more interesting. Actually, this reminds me of a
> zsh-feature that I am missing sometimes: execute the command at the prompt
> and replace it with its result. Something like this:
>
> condor:~>zcalc 170000. /7
> [some magic key..]
> condor:~>24285.714285714286
> [ctrl-A zcalc ...]
> condor:~>zcalc 24285.714285714286 % 7
> [some magic key..]
> condor:~>2
> [and so on...]
>
> Any ideas?
> That would make your copy_this superflous, too. (c;
[...]
edit-command-output() {
BUFFER=$(eval $BUFFER)
CURSOR=0
}
zle -N edit-command-output
bindkey '\e!' edit-command-output
$ echo foo<Meta-!>
$ foo
Or maybe:
edit-command-output() {
local output
output=$(eval $BUFFER) || return
BUFFER=$output
CURSOR=0
}
--
Stéphane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author