Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: completer for file extensions
- X-seq: zsh-workers 32458
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: Re: completer for file extensions
- Date: Mon, 03 Mar 2014 16:33:58 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1393860839; bh=g1tvPmOX3B88XcHn9O6pc/6SjzDFtzRc4cCt8yR9QIE=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Received:In-reply-to:From:References:To:Subject:MIME-Version:Content-Type:Content-ID:Date:Message-ID; b=jGnEa2CgqyKVMPMbI+heFIUayYaVLX62tqyDFaj8yUFqvuqx33D7AGGyJVimBvnSs7xOFJAzZGmLsCfaezPNNlAVfAqMBU9sh8nItGzMwmpAD3cdsT6euKjNyg/y1Iwb6ZfoLK+yT1fmYa462pr6fzfTsXOab8AeXRdbscyXBK0=
- In-reply-to: <CAHYJk3Rr4Jk_83J=LU4OuB5f2ROpsn95ZTArOmxaqCtifYQZqg@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <29011.1393594448@thecus.kiddle.eu> <CAHYJk3RRtyS2uMGc1TG7DwYMQcF1KcpObiDOp3BeBidfBZ_9rw@mail.gmail.com> <626.1393625311@thecus.kiddle.eu> <CAHYJk3Rr4Jk_83J=LU4OuB5f2ROpsn95ZTArOmxaqCtifYQZqg@mail.gmail.com>
Mikael Magnusson wrote:
> I have a number of screenshots with . in the name and it causes these
> completions to be added;
> .00.png .09.16.png .13580 .16.png .36.04.png .58.png
> I guess you go for the first . to get stuff like .tar.gz? Tarballs
It takes all of them, so for foo-1.0.tar.gz, it will add .gz .tar.gz and
.0.tar.gz. Incidentally, that's what the {1.. brace expansion that was
mistakenly {1- is for (along with the I flag).
> often have . in the name for version numbers so I have the same issue
> in that directory;
Numbers alone are I think a rare choice for file extensions so I'll add
in:
files=( ${files:#.<->(.*|)} )
You might still find cases where dots are used but not meant as
extensions: something like .rc2 or .5-dev-0 but you wouldn't want, e.g.
.mp3 filtered. You can always use an ignored-patterns style. The change
above is equivalent to doing:
zstyle ':completion:*:extensions:*' ignored-patterns '.<->(.*|)'
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author