zsh-users
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: vogt@linux.vnet.ibm.com, Zsh Users <zsh-users@zsh.org>
Subject: Re: Recursive globbing shorthand (a la **.c)
Date: Wed, 28 Oct 2015 14:27:38 +0100	[thread overview]
Message-ID: <CAHYJk3TjmMEYZ-j5VT=D4WDPtZZkFVzKNXzYw9vxZReC0o-FZg@mail.gmail.com> (raw)
In-Reply-To: <20151028065702.GA8236@linux.vnet.ibm.com>

On Wed, Oct 28, 2015 at 7:57 AM, Dominik Vogt <vogt@linux.vnet.ibm.com> wrote:
> Most of the time, I use recursive globbing to find files of
> certain types, e.g.
>
>   $ ll **/*.c
>
> With the zsh here (4.3.17), recursive globbing works only
> with a plain ** anyway (i.e. in "**x" and "x**" the ** works just
> like a plain "*").  So, is it possible (or a useful future
> feature) to make "**" imply a trailing "/*" if not with a trailing
> pattern?  Then we could type
>
>   $ ll **.c
>
> as a shorthand, and the "traditional" uses would work without
> change (e.g. **/*.c or **/foo).
>
> (Note that on German keyboards, "/" and "*" are very awkward to
> type in a sequence because both need the left shift key held and
> the keys for the right hand are very far apart, so this is really
> a usability issue.)

If this is something you do often, you can do
alias -g '**.c=**/*.c'

I don't think it's useful to implement generally though, there's no
particular reason to assume the pattern following the **/ should start
with a *

-- 
Mikael Magnusson


  reply	other threads:[~2015-10-28 13:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-28  6:57 Dominik Vogt
2015-10-28 13:27 ` Mikael Magnusson [this message]
2015-10-28 19:04   ` ZyX
     [not found]   ` <240121446059044__35603.2418822453$1446059490$gmane$org@web30h.yandex.ru>
2015-10-28 21:15     ` Stephane Chazelas
2015-10-29 10:15   ` Dominik Vogt
2015-10-29 10:53 ` Peter Stephenson

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='CAHYJk3TjmMEYZ-j5VT=D4WDPtZZkFVzKNXzYw9vxZReC0o-FZg@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=vogt@linux.vnet.ibm.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).