From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16184 invoked by alias); 21 Mar 2017 09:49:38 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 22596 Received: (qmail 18214 invoked from network); 21 Mar 2017 09:49:37 -0000 X-Qmail-Scanner-Diagnostics: from ambassador.madduck.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(188.174.253.166):SA:0(-2.3/5.0):. Processed in 3.198866 secs); 21 Mar 2017 09:49:37 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: madduck@fishbowl.rw.madduck.net X-Qmail-Scanner-Mime-Attachments: |digital_signature_gpg.asc| X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at fishbowl.rw.madduck.net does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=madduck.net; s=2015-11-14; t=1490089823; bh=i8uidNH4oW53OSuEN9svebyiUrgmZMg0z+rTsvCDtiA=; h=Date:From:To:Subject:From; b=TeFnCxjLfiofbzXpjKETuD4OCeTZVGYbhOQFUIlprKaktacxMtSXlpxIOtRzruqg+ 1B1a0WpUVs3A7bEN0s6k4PpUN1T1ErO/y29W+NVmx3AfBZW8+B4Zwtrf9LD89hpJWG FKqgkWbO3XNSg77ZBmcJCiyJY6EwuwHmDn5OHpqk= X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.99.2 at ambassador.madduck.net Date: Tue, 21 Mar 2017 22:49:17 +1300 From: martin f krafft To: zsh users list Subject: Making file-patterns and tag-order work Message-ID: <20170321094917.3aopmzwkpaam7kgl@fishbowl.rw.madduck.net> Mail-Followup-To: zsh users list MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xnd6qbeyq2qbi2kf" Content-Disposition: inline X-Motto: Keep the good times rollin' X-OS: Debian GNU/Linux 9.0 kernel 4.9.0-2-amd64 x86_64 X-Spamtrap: madduck.bogus@madduck.net X-Subliminal-Message: debian/rules! User-Agent: NeoMutt/20170113 (1.7.2) --xnd6qbeyq2qbi2kf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, I would like completion to differentiate files according to some globs. To this end, I've configured: zstyle ':completion:*:argument-rest:' file-patterns ' *(-/):directories:directories (*.(ba#k|old)|*~):backup-files:"backup files" *.(l#[oa]|py[co]|zwc):compiled-files:"compiled files" *.te#mp:temp-files:"temp files" .*.sw?:vim-swap-files:"vim swap files" %p:globbed-files *:all-files and also went on to hide all these patterns from the catch-alls in the last line (is there a way to do this without duplication?): zstyle ':completion:*:argument-rest:(all|globbed)-files' ignored-patterns= \ '((*.(ba#k|old)|*~)|*.(l#[oa]|py[co]|zwc)|*.te#mp|.*.sw?|*(-/))' The relevant options in effect are: auto_list no_list_ambiguous auto_menu no_menu_complete no_bash_auto_list list_packed and if I now try completion, I can confirm that these tags seem to work (indentation added for clarity): fishbowl:/tmp/cdt.6kIDed% cat ^D directories foobar/ backup files foo.bk foo.old compiled files foo.a foo.la foo.lo foo.o foo.pyc foo.zwc temp files foo.tmp vim swap files .foo.txt.swp files foobar/ foo.c foo.txt g (you can get the directory contents like this: touch foo.a foobar foo.bk foo.c foo.la foo.lo foo.o foo.old \ foo.pyc foo.tmp foo.txt foo.zwc g .foo.txt.swp ) I then went on to try to order the tags, because I want e.g. the swap files to appear last: zstyle ':completion:*:argument*' tag-order " directories globbed-files files all-files backup-files compiled-files temp-files vim-swap-files " Unfortunately, this does not work yet, and there are two problems: 1. the directories show up under 'files'. Is this because directories are special (they could contain files), or am I doing something wrong? 2. There is no change in the ordering. I've tried group-order too, but no effect. What am I missing? Thanks for any inputs! --=20 @martinkrafft | http://madduck.net/ | http://two.sentenc.es/ =20 "the only difference between the saint and the sinner is that every saint has a past and every sinner has a future." -- oscar wilde =20 spamtraps: madduck.bogus@madduck.net --xnd6qbeyq2qbi2kf Content-Type: application/pgp-signature; name="digital_signature_gpg.asc" Content-Description: Digital GPG signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current) -----BEGIN PGP SIGNATURE----- iQMGBAABCADwFiEELMsmvFxJvCIfIHlCVcmILZmbvMQFAljQ9x3AERpodHRwOi8v bWFydGluLWtyYWZmdC5uZXQvZ3BnL3NpZy1wb2xpY3kvNTVjOTg4MmQ5OTliYmNj NC8yMDExMDEyNDExMjU/c2hhNTEyc3VtPTFjYWQ5NmZkMjdkMzIzM2Y1M2UyMjg0 OTUzMzY0ODEwN2U1ZWU4ZDViZTY1NTI1MWQ3NGM4ZjFjNWMzYmM0MmYyMzA0ZmE1 MTUxNTBmN2JkNGRkMDVlOTgxOTkyNGYwNDk1MTNlZTk5NjJjYTcxNzA5ZjgxZDk0 NTE1ODUyYmQ4AAoJEFXJiC2Zm7zEQKQP/1Tv3Bq7efrw3x2e0hNHi5qa5I0jIn21 NFbYVcCQaNOZaJfCbWpfQNh1ZiQHwkcASeoakvvkFzT/8ADCQYzWLTK69qZ1JZgV MgHLCJjqksGCGUp47IBS+hll7PTYgu+OSLX3IHqvYUNuJHmdrq86b8IPg2CzrrP6 F+QiBID8LjVds2JCrd2MXjnPYbvfrMuOMLsaaOnYaEehFod5xrOA7+i1kBv56wdi D20OdDBBg2EznGzXcUdgzRQLlrLBuyy07o7BoK9DVNrw4A1D67JoEhhz9gGZ4koc pVt0Sb97AQvIB0RKTTMQ2cJtdZnkKyXiZ0KapFpqkZfuTNqvAJJjPGr/ejoj8sn1 8uepCzZSaEIgABKZic2JMKb/XdOu8WjwY1+WMua/ZKox6I/O8RPzE/RF03C9M8Jj 5MyPDGOs/d2kMJwIuknZ73eq6CXn7j4CgKl+69fZHQq86inA2ZxsU6yghCDh6pP+ 2X1UMuSolbLzWX9c4zfdXGTVo+NCnCRiWrF7vqFXELtA8IQ+c/QcAngDuT6/Zod7 lnWes6dCa03JBkwy2b+a1PAzSX7U1FGfllW6TSoeCrw9IFE2Q0yZRpD/LHym3lNy 2/dGgjwEMBwRHZqm93H9e4pB6HZMRtNMNCSnQJwoIjbMg7T8IUG3V2YoFXLiC4Ux dNKL1rldmOR8 =PLR/ -----END PGP SIGNATURE----- --xnd6qbeyq2qbi2kf--