Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: command-cancellation with #
- X-seq: zsh-users 12351
- From: Chris Johnson <cjohnson@xxxxxxxxxx>
- To: Micah Elliott <mde@xxxxxxxxxxxxxxxx>, zsh-users@xxxxxxxxxx
- Subject: Re: command-cancellation with #
- Date: Thu, 20 Dec 2007 13:26:42 -0500
- In-reply-to: <20071220181259.GG14122@xxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20071220175536.GE14122@xxxxxxxxxxxxxxxx> <237967ef0712201002j763fd446se54c7a2b0e2cfff0@xxxxxxxxxxxxxx> <20071220181259.GG14122@xxxxxxxxxxxxxxxx>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author