zsh-users
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Ray Andrews <rayandrews@eastlink.ca>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: trivial problem with histverify
Date: Tue, 2 Dec 2014 00:26:39 +0100	[thread overview]
Message-ID: <CAHYJk3Q=oOaBrOoT_cmfrC=jS9f0VDPV2UDofiy9mcw=L2gxRA@mail.gmail.com> (raw)
In-Reply-To: <547CCD76.2020806@eastlink.ca>

On Mon, Dec 1, 2014 at 9:20 PM, Ray Andrews <rayandrews@eastlink.ca> wrote:
> I have this command bound to PgUp:
>
>      history 1 | grep --color=auto "[[:digit:]]  !!"
>
> ... it does the obvious thing, I type a string I want to search for in
> history and get
> a nice colored listing.  When recalling a command from history with '!', I
> like to
> have 'setopt histverify' in case I want to edit the command, or just be sure
> I'm
> going to execute the correct command before it fires.  However, if that
> option is
> set, it fouls up the above keybinding in the predictable way, it demands
> ENTER
> before it will work. It seems on the face of it that 'histverify' is not
> being very
> smart about that, because the key binding isn't executing a command, it's
> just making a listing.  It seems as if the test for 'histverify' is just
> seeing the
> literal bangs in the key binding and not figuring out that there is really
> no command
> being executed.  Is this really what we want?  If so, is there a simple
> work-around?
> As it is, I just leave 'histverify' off, and try to be careful, so it's
> hardly important,
> but I would  like to have it both ways if possible.

If histverify is set or not doesn't change the fact that !! in your
command will expand as normal. If you want to suppress history
expansion you either have to disable the banghist option, or quote the
history character (!). Long story short is: '[[:digit:]] !!' will do
what you want (double quotes do not stop history expansion).

-- 
Mikael Magnusson


  reply	other threads:[~2014-12-01 23:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-01 20:20 Ray Andrews
2014-12-01 23:26 ` Mikael Magnusson [this message]
2014-12-02  0:10   ` Ray Andrews
2014-12-02  2:47     ` Bart Schaefer
2014-12-03  3:53       ` Ray Andrews

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHYJk3Q=oOaBrOoT_cmfrC=jS9f0VDPV2UDofiy9mcw=L2gxRA@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).