zsh-users
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Zach Riggle <zachriggle@gmail.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: Using history / fc for case-insensitive pattern matching
Date: Mon, 21 Feb 2022 22:01:24 +0100	[thread overview]
Message-ID: <CAHYJk3T0zPzxP9jB=F=3_CH+f7ewr0mWJTHeZX9a2P+Adztu8w@mail.gmail.com> (raw)
In-Reply-To: <CAMP9c5n=NQ6myLatuLTcNJ71PxDdTqGMbPrDArPVSABOskmiqA@mail.gmail.com>

On 2/21/22, Zach Riggle <zachriggle@gmail.com> wrote:
> I've written a neat little tool that wraps "fc" / "history" to make
> everything look neat and easily documentable for later reference /
> incident response.
>
>     $ command echo 'Hello, zsh-users!'
>     Hello, zsh-users!
>
>     $ hgrep zsh-u
>     # [2021-12-18 06:13]
>     git clone https://github.com/zsh-users/zsh.git
>
>     # [2022-02-21 11:39]
>     command echo 'Hello, zsh-users!'
>
> The down-side of this is that it appears "fc ... -m expression" is
> case-sensitive.  I expect that Zsh has excellent documentation on the
> patterns and how to make them case-insensitive but I haven't managed
> to find it yet.  Most of what I've found seems to correspond to file
> globbing, which isn't what I'm trying to do here.

You can use (#i) to make a pattern case insensitive, eg
fc -m '(#i)*zsh-u*'

you may need to setopt extendedglob first.

-- 
Mikael Magnusson


  reply	other threads:[~2022-02-21 21:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-21 17:43 Zach Riggle
2022-02-21 21:01 ` Mikael Magnusson [this message]
2022-02-22  9:09   ` zzapper
2022-02-22  9:27     ` Peter Stephenson
2022-02-22  9:39       ` zzapper
2022-02-22  9:47         ` zzapper
2022-02-22 10:18           ` Peter Stephenson
2022-02-22 13:07             ` zzapper

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='CAHYJk3T0zPzxP9jB=F=3_CH+f7ewr0mWJTHeZX9a2P+Adztu8w@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=zachriggle@gmail.com \
    --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).