Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [zsh] Re: retrieving the results of last command?
- X-seq: zsh-users 8877
- From: Francisco Borges <f.borges@xxxxxx>
- To: Zsh users list <zsh-users@xxxxxxxxxx>
- Subject: Re: [zsh] Re: retrieving the results of last command?
- Date: Fri, 20 May 2005 16:24:29 +0200
- In-reply-to: <1049.1116593698@xxxxxxx>
- Mail-followup-to: Zsh users list <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: Alfa Informatica - Rijksuniversiteit Groningen
- References: <20050520121834.GA32499@xxxxxxxxxx> <1049.1116593698@xxxxxxx>
» On Fri, May 20, 2005 at 01:54PM +0100, Peter Stephenson wrote:
> You can simplify retrieving the command by using the parameter history
> from the zsh/parameter library, which contains the history indexed
> by the history line number, and the standard parameter HISTCMD which
> gives the current history line number.
>
> Normal "insert" widgets append stuff to the left of the cursor
> rather than replacing RBUFFER.
>
> You whould be able to do this:
>
> zmodload -i zsh/parameter
> insert-last-command-output() {
> LBUFFER+="$(eval $history[$((HISTCMD-1))])"
> }
Thanks a lot for the corrections and explantion!
Cheers,
Francisco.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author