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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 27683 invoked from network); 30 Jun 2023 00:45:12 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 30 Jun 2023 00:45:12 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1688085912; b=E4JjB/hNZDSjBO+Gqsv+iCijJJxmAQNiydagpZE5hFdhpdEvO6SGCkUk0ewrJv8/whY+t2dege RSUs6xFP/3mPPYdVyYb8K39wUXWgwU4vp/vkDOlECAXPVOiaGaaxzaMIH/ZLfIdVCpBSgt52W0 SxMjrWYFEe8PRVllTRuhfdowVGLnMSOU0MqgOB5gQY2k04ZYEI4U0Qk3BUft+fVazZNDTX+D8L 7omSmiHzAnWjYkjyNu2FWfelFdUkNB2z1cEXc3Z2Atzh27NhbkI6T6SR8OPrCOeSwhT0U+ktF/ +UOzBsa5T/xgtS1Nj5fvSVVC0jTsBSc3U7vaagkVZuFo4A==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f52.google.com) smtp.remote-ip=209.85.218.52; dkim=pass header.d=brasslantern-com.20221208.gappssmtp.com header.s=20221208 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1688085912; bh=aewm8HSyE81VLr49SkOwDREWYKfijKZlubS6uKtKTDk=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=hNdJqJpeVgFggrfsTUHPdv+NdiIy2jrFYgW2fyd/3/peQzTe68it+gJHYGyDTv1GwwSJLI6pc7 AkOgrSvU2X8vnU1+tO6LrrCuEq4VqIL5xCBVdG81wco75idRJ1VhNjNAVS28iCN9HU4xgoD/cj z+XBZFsYCEKRVSVHj+CFrYw7PZES5QXlEb1pAIUJ1iot9YNw4qcTgY5l+uMt1+0MyVUxdeD8Px Wxn8LCtReNBtXoWz7/jOhIuKNfndAI3mvhZVe7fGMhAcP+IFAya20sDT9pR57nSbjQcufOcP6S SE+LexsbDrCTBIxV9heaRfzK7uH3zdCryS+CSkseKZZfVA==; 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-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=ENdArn6AiXE2a+J8qO1o9hzP5cfyNKpnGIhtF0Soi5o=; b=iEMD4xT1NxC9grHbhl/7+g6wvP fW3ok9BWk0fc9HKfwYQefF+UDwJ2pB6nmDZxG+V9hNZ8RIYJXPxU+0Lp90HpsMExLtRXcAH9ieGqn G1HzAHLQe1dkXB3Gk+Ma86kbqqJ/AcOf2eXKc8Y8S/xeqKHEClEQX2QLdqQcGvv1KiulUwpI0gmLN hUC5JOBel8d08+ZXzdKmpIvOMnZ8J0DMmLiVA4FMbJDPbbdsydboToxlRQ0fStoakKCISlkXwjy1b knsENEFupOgGRpDhfbcD896b3hQ6YhZ5snpQf1TZVRlrue4bqeGtACQWaKGFSNuYMqoGKjrGbP+WT NCcLdOSg==; Received: by zero.zsh.org with local id 1qF2G7-000ISG-JU; Fri, 30 Jun 2023 00:45:11 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f52.google.com) smtp.remote-ip=209.85.218.52; dkim=pass header.d=brasslantern-com.20221208.gappssmtp.com header.s=20221208 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ej1-f52.google.com ([209.85.218.52]:52423) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1qF2FT-000Hjp-Oj; Fri, 30 Jun 2023 00:44:33 +0000 Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-986d8332f50so156506766b.0 for ; Thu, 29 Jun 2023 17:44:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20221208.gappssmtp.com; s=20221208; t=1688085871; x=1690677871; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ENdArn6AiXE2a+J8qO1o9hzP5cfyNKpnGIhtF0Soi5o=; b=yzadiG0jJmiZd/q+dSbxrz3dwtk86d2yo+eA4I9nhxkWnXfw5yi2+bqQbio4ChrE/+ rWvUiNqb6eWuZqWhtqbU2unwRhAgD4K3lU+PlFREdVBfcc4TIVuN2P6AViQ7/v1y26rA 8w3pZWnc9Obt+WSE4UuYg4NJRF3RYnWBQ3AycRhl/rl7VbOLYvS6MlHB8ViJnaJAi0bQ G17qdCB1Vz4KCSFLEbdBsMcNOfzeqrPXXWgkDr/dfFocbRGTSTt2jiETaQv06OdR8CSU yRIjcPVwt+iYVbflQDF+36KbzI1n1PHtoSF/7fy6NBnjW5aPh8br9gGdaeiwabEDFfIZ rX/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688085871; x=1690677871; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ENdArn6AiXE2a+J8qO1o9hzP5cfyNKpnGIhtF0Soi5o=; b=fCvMoOc+q5aHj2fnxcPkqvNTSlgR/qjqAX4MEEahpgUqw0TTvYAlDSaBuBk/KIoClg snArDmxzC2JvINnMsXcl2qISOki9Fu4cZYx7qCC5k24YEjOqBQEZcLD73fgKjK8yp6Kq cFFP+06cQhYUcFPCSt5md2ngxmv4pT7qAltatps3VY+H5i0PJ3GPt3ZyodzgS9DJmFFJ YsM3Li3XAZC51hXr9DnZQYfxQf+mLeJxZVbcW8pdBgcuygwA1gkiaxTIPBgg5QuiqvWy Jk5wJzxrqBRF6n4OkAzymjGA+9tx3cE3w4H0LmiO6Gp7jAns3S/G+dYNFdx6MqOI2Ydf ToNA== X-Gm-Message-State: AC+VfDzJSG7umcXKEXkiRfBwMqZT8VkBh+snWP2bsW02uhVC7RrWvu9O mMGi8i1yfbi8HnYSM0u7lDQcH5BoTimkt96/+Js7+g== X-Google-Smtp-Source: APBJJlFfLY96T8uZJsVfaAyhgrIPPh/XfN45uOcrU82olFpBg6P5mNcsG7xshW4ilNQ258Xo2YFempDH3Kj8Q836hEs= X-Received: by 2002:a17:906:868a:b0:98e:35d1:993e with SMTP id g10-20020a170906868a00b0098e35d1993emr611023ejx.5.1688085870643; Thu, 29 Jun 2023 17:44:30 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Thu, 29 Jun 2023 17:44:17 -0700 Message-ID: Subject: Re: How to have Zsh completion menu and use glob patterns + recursive search? To: Marc Coquand Cc: zsh-users@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 29099 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 Thu, Jun 29, 2023 at 5:40=E2=80=AFAM Marc Coquand wrot= e: > > I'd like to be able to do ./**/*file* and get a selectable list of a= ll options available. "do" that where? Usually it would be after a command word such as "ls" or "vi". Each command may have a different completion function that supplies contextual clues to adjust the results. Presuming we're just talking about generic file completion context: > I notice that if I remove all the previous options that I have enabled, .= /**/*file* works but it expands to all available options. That's because the default binding for the tab key is "expand-or-complete". You're seeing the results of the "expand" part, which takes place before completion is attempted. In many cases after "compinit" you want to change the binding of tab to be "complete-word". bindkey $'\t' complete-word > However, if I enable the completion list, ./**/*file* stops working = and doesn't do anything. You need the bindkey above (see the documention for _expand), followed by at the least (other completer entries are possible) zstyle ':completion:*' completer _expand _complete The _expand completer takes the place of the expansion part of "expand-or-complete" and (in effect) feeds the expansions back to the completion menu instead of populating the command line directly. You probably also want zstyle :completion::expand::: tag-order expansions original otherwise _expand will offer "all-expansions", that is, the "all available options" set you didn't like, as one of the possible menu choices, which if it is a large listing can have unexpected side-effects on the display.