Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Fw: Zsh - push current command on history without executing it
- X-seq: zsh-users 12384
- From: "Mikael Magnusson" <mikachu@xxxxxxxxx>
- To: casper.gripenberg@xxxxxxxxxxxxx
- Subject: Re: Fw: Zsh - push current command on history without executing it
- Date: Fri, 4 Jan 2008 12:04:15 +0100
- Cc: "Zsh Users" <zsh-users@xxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=eivIPKfX9gzpDq7KsKzCkth4aKg53YP4bG/zWPaL/X4=; b=f+p/J9Rsb98G76fal9noFAJhXUIMwck+3+xmNhliYt6WB6A5FmVuvTgxIMc4A6EM85cKDc3wZWEqDJMg4AnXSQCZVDJE1GDgrJNZoux7KB+IXo3I7QoBC2jf9Nz9leQOHsqJSfrr/yEkIsemCdT3dzhJ4hqdQRtMfW9ONHQBaCA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ZuxtVp8Em/mknd1TXBRdHQbezGYOvzvr3wfndDV1NvcoWcHX9Q/IDDjf9GL7LabLDvIqJ2fwuDo/JmC5dOrOWTIpyY2aDihpqM3PiHXpxBgtqPpgndmUpIOAOTEuj44cefIXykn2huDXYzYdNcWXdgmsIkW+19krsAIbjvJMfBo=
- In-reply-to: <20080104105900.37a87f7e@news01>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20080104105900.37a87f7e@news01>
---------- Forwarded message ----------
From: Chris Johnson <cjohnson@xxxxxxxxxx>
Date: 20 Dec 2007 19:26
Subject: Re: command-cancellation with #
To: Micah Elliott <mde@xxxxxxxxxxxxxxxx>, zsh-users@xxxxxxxxxx
Micah Elliott sent me the following 1.3K:
> On 2007-12-20 Mikael Magnusson wrote:
>
> > On 20/12/2007, Micah Elliott <mde@xxxxxxxxxxxxxxxx> wrote:
> > > $ #ls foo
> > > zsh: bad pattern: #ls
> > >
> > > Is there a way to make this work in zsh the way it does in bash?
> >
> > setopt interactivecomments
>
> Great, that works. Thanks!
>
> Is there some way I could have discovered that? I don't see it
> in zshall(1). I do see that it (and a few others) are set now by
> running 'setopt', but it would be nice to know what all the
> available options are (which aren't in the manpage).
It's in my zshall, and more narrowly, in zshoptions.
For the functionality of "pausing" a command line, you can also bind the
push-line widget (check out the zshzle man page for key binding and
line-editing options) to temporarily interrupt a command so as to
execute another, and have the interrupted command return for editing
automatically. I bind this to Alt-Q (or Escape-Q):
bindkey "^[Q" push-line
And I have this custom widget to help me store a command line in history
without executing it:
commit-to-history() {
print -s ${(z)BUFFER}
zle send-break
}
zle -N commit-to-history
bindkey "^X^H" commit-to-history
So, I type a command, hit Ctrl-X Ctrl-H, and then retrieve my command
from history when I need it.
--
Chris Johnson
cjohnson@xxxxxxxxxx
http://www.cs.utk.edu/~cjohnson
On 04/01/2008, Peter Stephenson <pws@xxxxxxx> wrote:
> Forwarded from someone presumably not on the list.
>
>
> Begin forwarded message:
>
> Date: Mon, 24 Dec 2007 03:59:55 +0200
> From: Casper Gripenberg <casper.gripenberg@xxxxxxxxxxxxx>
> To: pws@xxxxxxx
> Subject: Zsh - push current command on history without executing it
>
>
>
> Hi..I was reading the zsh manual and trying to
> figure out how to push the current command line
> into the history list wihout actually executing
> the command.
>
> push-line does almost what I want, but it pops
> the command back into view after I issue the next
> command. What I'm looking for is something like
> push-history.. but I can't find it. Is there
> such a thing or any way to make zsh do something
> like that?
>
> Thanks.
>
> Casper
>
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author