From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 24723 invoked from network); 31 Jul 2022 15:35:23 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 31 Jul 2022 15:35:23 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1659281723; b=UIL+ydwR6it+MuFQcsYUa02TGd3Grae0Ov+iKcpx1SUeB/e5edXPp2rCxQbCKgJWG/3cBHWqL7 XJxPvVIkRvR1ZZx+IePXmFvuDee4vMFzGI7iuaMHVDpEaAIUph5b6DldNxl/xHjkJOztHMNbaZ lUrhiYehRw2lJ8panri7EoUfNDA7RiW8V599O/76crrTj3J1OEziIOvidgH0c9LmTCMDmNyQAd V2rGFK1lPcbwUJDltn5OgFjDGpbGJvIDLsuW2PC6Y0q4SJyvIDYkepCTepM7BfE5TjNjAWQmkd zcexV4Bl+bO7RiFk0FBY8oMNIHgATBwduEkEK9RThAS46Q==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-pf1-f182.google.com) smtp.remote-ip=209.85.210.182; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1659281723; bh=bQplWVFXQJ1E+yqrgdNfEcwmsI3mRAjB2P0DxZQmR20=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:References: In-Reply-To:MIME-Version:DKIM-Signature:DKIM-Signature; b=Nk0fVUUdGpL2yUBEYvwoMkBKwyQejliN8X8dkgvzvUydfCQC3J+Dt0/S18LQ3s/EASTt20s34+ WJO91FTGcOlR0pNaYLV3Q09dcDEm7UHUB3hv+rXNb/8II23wBV0/9IwhLiC6/C9kFo2m6cJwI+ iXv/pWvcp6Fm2yaiYG8rNaTN94uYpsoP72tK0/NvW8iHqkF+NskSOrFo/Z0HuUGF1O0IN6UKa2 v+jgTZVhv8WmEhki5Cy/4wDs/haGIK2b6uZrPe9LuIGOQz58Eeb608etdzXIRWa8wpH96Fihuo Fk9t+tHdoIZ9ErN39D/jylyZUNVGumfC4J6T4HTnTy0adQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:References:In-Reply-To:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=T0XnF5/3ORlRExnrZzXcbHE6eUJ7gnNdoG+TEi3+Lqc=; b=Wj6TUDU8bb6ZCkGOF0qwCdRXfq DLdz5zJg2vBlLsWdDls7nkVV4gfzjkczOUtOgFSmDzP8rpFlneojRWG2Y4/xpRZXepZH4ZbCUSuhi TK4muGqPXdFhPqq6bdrArOQOyaDkFyrQ2ETjIwhTwwFTlLjmY134+6Cdec9EHWITCHR0kn9fWCCfx qKVqQQtFH7rV3v75WyoNWfd3T2qto/Rw5yfvare2Nu3t3L2kZMsK5Q6kjHTePcIvupiq5wme2Dc/I pM3T6PyDYbJWFA4MGWihOpwgao+cuEWNrodsp+Dnc/N8x1blyYgmZagnw4vflg8vKzFP5nJuOsefi mbLoYc3g==; Received: from authenticated user by zero.zsh.org with local id 1oIAyR-0003xW-Fe; Sun, 31 Jul 2022 15:35:23 +0000 Authentication-Results: zsh.org; iprev=pass (mail-pf1-f182.google.com) smtp.remote-ip=209.85.210.182; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-pf1-f182.google.com ([209.85.210.182]:45686) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1oIAxY-0003GU-LB; Sun, 31 Jul 2022 15:34:29 +0000 Received: by mail-pf1-f182.google.com with SMTP id y9so8465989pff.12 for ; Sun, 31 Jul 2022 08:34:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc; bh=T0XnF5/3ORlRExnrZzXcbHE6eUJ7gnNdoG+TEi3+Lqc=; b=WElq/Tl/ATI9QeW6Bv1vU8n9eJVn2IfuG3IKMBRzW5EAo5NrONzIRnoVfQBtmtDFpe MiGuy3JMNu8WxvQnMUdb2/Lm5/KqdmfXOcVHZMJnJCOHE/ly9lgaAiBKtMBDPjRLhu8b x06Ei6dMbeBgsD8nBUf1r3+rHsEsG/axjiTg1uhxc9Z+q3Z0jbO8sRTQsnBS9h03Hhf8 M3KEuy+G7q43hpbjYnwv36WfChlhT34iCfrgNpjMgGsQuvEF33Bx93U6hKngeN8msNQ3 +uFLqQ466OMXERTKeP35+DjWrzMx/Ba9bandO10mh1AZMyaGMOtqNWTGRgCAG3rQwzsE e/BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc; bh=T0XnF5/3ORlRExnrZzXcbHE6eUJ7gnNdoG+TEi3+Lqc=; b=STNzGRkMAsw/zic04j8nyq7JlN3H4Uu+/ojif3wo2eN1KG+sU6LDk6VvD2qMpRUSEz leGW0XUUbs8OpjaG15HSHb1EgupkQcu5ZjYdshs1XbqGaxp0pQe9CcgC3sHJmBwRyk44 xO+WU+xiGsULWsBxgQYswkesLx/YrpdJH1qcimlSIVCqT2UwqWLXDTaI7N+Zc6ZVD8nS G9ml/4sI6qA/TIxbrxmePmSoj23aAiJkGPpFSmBywBZl1Lg9gUgN6Q0bBaSftBu4AEUA vgrL3yA4wyrsesWeeGRXZTiaGhYMy8exzKojGrRBew0H++zt12FRLwn2RlPWeZJMRsFo UbNg== X-Gm-Message-State: ACgBeo0SXXldL+NC/wM7NpLn1y+VW/7Pqrw4SA+XoOS4qvAjAiTT//nu P4XZE2O2HVXvcwJ017pWaIZwEYdbxuKPbB2EwVw= X-Google-Smtp-Source: AA6agR7JAGIoCw3Ex2lZwduMyHaYNQKN7lq5GcgyU3PND4aFxKQ8TBv2rkOCFthIh8lVCZtjH4JOUadbzKTxKVBtf2E= X-Received: by 2002:a63:c012:0:b0:41c:1148:ec9 with SMTP id h18-20020a63c012000000b0041c11480ec9mr1020727pgg.444.1659281666923; Sun, 31 Jul 2022 08:34:26 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:6a11:410:0:0:0:0 with HTTP; Sun, 31 Jul 2022 08:34:26 -0700 (PDT) In-Reply-To: References: From: Mikael Magnusson Date: Sun, 31 Jul 2022 17:34:26 +0200 Message-ID: Subject: Re: Completion... but only for the extension part To: Thomas Lauer Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 27920 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On 7/31/22, Thomas Lauer wrote: > Sorry if this is in the Fine Manual but I couldn't find it (and googling > also brought no great enlightenment). > > I have directories with many files in them which all have rather long > extensions (12+ chars). There can be quite a few separate extensions, > say "*.winter-music" or "*.spanish-photos"... you get the idea. > > So, often I want to complete filenames as normal but sometimes I want to > limit completion to files with just one specific extension, say > "*.indonesian-videos". So... I'd like to type "*.indo" and then press > to get "*.indonesian-videos" which in its turn will complete > only those files. The problem is the bit... or rather a > function that does that and can be bound to . Do I have to > write such a function or is there something in the completion system > that will do this OOTB? There is _extensions, you probably want it on a separate keybind from normal completion, look at the _all_matches entry for an example of how to do that. https://www.zsh.org/mla/workers/2014/msg00230.html is the thread for the patch that adds _extensions if you're curious. -- Mikael Magnusson