From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14058 invoked by alias); 11 Dec 2014 00:41:59 -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: 19519 Received: (qmail 4888 invoked from network); 11 Dec 2014 00:41:46 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1418258083; bh=ES3+cQGfRSawlX8sQlexzXbKkGB1AiHCPUZhLfnetkA=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=m1vad9OX7gxQfcgZG7tuR7sb2knRS7Jy/7sI0AHce3jKjI2mdqAUW4nTCdI7+oN4JWlD7NTTszkxgw2nlMcZ9mJDeqzNzikUmulTrn4/zz4iO+BPzfpFVN2c6nHAM8+x4iqsqcpSD4aNkeGo8In8vxXtltDBPu3x1A5R6NPbCl209eChrH+RPq5pcxxtBOBk0DCR/pWRjTW/k/puSHzpk0YhEbV4qMb6TqXtk23SPGvetgTdwfDm5X77BQq5CXBHgkilHARFAicoC3fZYvhRBmp2xj1TqxYpj7HiYPmyNwpy9fBA+eDD4Iljo59Wap8WESgvp4/XE3Eu6R1iqKUG+Q== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.co.uk; b=lrRsGpMFT20jg3MdtzCYc9jhUxRnq+6ak+/6se64NnbwG2nP/rCPssDrAiYZZxWiOa65ttCkNmyb7Es+gvKulqbZFE06kbn3KSdLrsAN9hP9wVL2T2A0auQ9IVnT7g4KhIaTxQeAaS/Ehdp2pmEDNedwoD6jevaIVOcmHJNURhsg2n8GZI8YR4MIIW4KYpD3T7JNg+bIQ3OtTvCI5LbT2wyYQgXHJwb6dIoQM+pTJs6ZsUEJDBo3KZl5U5fg8ViK0Jv/PFZmwNsV3MJUNQ+z56WqvYXp8v1pQ4MV01H4VdjMlMc+NlMryXs4GZ6FiSs2rORUAqeGIJXS3YWdu1xEIA==; X-Yahoo-Newman-Id: 597248.80018.bm@smtp129.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: zTkkEoMVM1nm1vXyy7CIiS4bIrkam9N9huCVRv.HdCdUNY4 pWmBnlvEnc036XjlOdvLmYYDFIj8eHhcBz4aPpcv3tKLBh5T3MCVSxSXEhal 6tqI6j4Dajf2inmcRMW_e7QUsWGN92iXh2WtctB7WeGuPGKWa8OtiwYQpZH3 zRzbTWq_sYlQmOMhS5GtfKtKNzsRqoe.Bkm9_PNnG75rY8sQlIiu52.KqXRq nc1u53f_bXsht8MuMvsM2URTkagu89OM6wy8_XAI61g4ZpcopUcymFx86C19 U3TJBNgSpvNLL9PkBzgS_Ezwnvn8rdu9ffTa7Kbsnqt5MLirOX_ms4YSL9Jj MU1xw.65uzUQAdK5.0X7b3Q.lwZxHovKIWEyml.cupzmuoW22kzmNXXlzBdV HC.SIbuVHVZ6mkXAY.3OqqWTonm64EUgjBso_9DnsvPuBFOhpfZXCweywepD cz30EylDreNigzKvc3Zzn6Xlv5hajaqD15cPrKxRdcGF0_zLBgPkeYIR2e5h zE0kqsDZQQRgfeFAlInFH456SMpL3WAxaVbfOZ7cXW5SGJorltlEkhHR_cUK OEN0EihgicvAZxQZ3 X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- In-reply-to: <5488D414.6010300@eastlink.ca> From: Oliver Kiddle References: <5488D414.6010300@eastlink.ca> To: Zsh Users Subject: Re: completion MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <30452.1418258082.1@thecus.kiddle.eu> Date: Thu, 11 Dec 2014 01:34:42 +0100 Message-ID: <30453.1418258082@thecus.kiddle.eu> Ray Andrews wrote: > > In chapter 10 of 'the book', at one point you start doing this: > > zstyle ':completion:::::' completer _complete _approximate > > ... I missed any leading explanation of what those five colons > are doing. See the grey box on p237. The part with the colons is the context. The context is decribed using a colon-separated list of components. This allows for things to be configured in a context-sensitive manner. The "completer"s are sort of top-level drivers and are selected very early while the context is still empty. The five colons are included because they prevent the completer style from matching in other contexts where you might want a different configuration. > Playing with matcher-list, you have some good ideas there. > I currently have all that completion/matcher stuff copied in > from some website of sample .zshrc's and it was all taken on > faith, since I hadn't the slightest clue how all that stuff works. > Since I'm now trying to understand it, the current line I have > contains this: > > zstyle ':completion:*' matcher-list ... 'r:|[._-]=* r:|=* l:|=*' > > ... at the risk of insanity, what is that incantation doing, and > do I want it? Gentle generalities are fine. Matching is the part of the completion system that decides which of the possibilities match what you have typed on the command-line. By default, this is just an exact string match of the prefix so given: touch one two three : t It sees that t is a prefix of two and three but not one. The r:|[._-]=* is roughly saying put a wildcard (*) before . _ or -. This allows something line w.z.o to complete to www.zsh.org It's not unreasonable to use that style. You might want to further limit the style, however. Matching control can make approximate completion too aggressive so you might want ':completion:*:(^approximate):*' Or you might want to restrict it to, e.g. filename completion. Applicable matching controls are often defined in specific functions so the one you quote is not that necessary. Oliver