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 5831 invoked from network); 7 Jan 2024 18:46:59 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 7 Jan 2024 18:46:59 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1704653219; b=smVLqJ2nvZBg+kIBqflv+FyovAXwAgq81ZSy2CjiJG/lFXeEv8pKWiJBU3vTduB3B6wdAhTAdx dL72U2DOzvHI9yB2t2tv7UQ4kneQ5oGwp2MHWMPdMkCBuLE7mc4pSycrd60I6rrJUJxFgV6cb3 MdJtzMkrZxKq7l8TY4MojjsTK+3VGAEBXSThHx281IAevJzyp9zRkT3UkVbbGOcGk+49IFxHOL uVU6AaP80vIDOufOHipoeGrjADpjpIafygwY26nkmiocSIkaf/f8OYL4pmKyt7MmvnI7qLzFja dg8nQYApU6NSMim1lZTJlWG3J/0sLWACtMV0cRk1yLAC+g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lf1-f51.google.com) smtp.remote-ip=209.85.167.51; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 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=1704653219; bh=YubmPA2oU+F8dK84/AuUAdGuFPMYEVj3mYx2p1iYGIY=; 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=Xaxqw2rQP+Dc2bhaXhrJaFOrDRHk+cc6K6E8ktH8AOrIfvy1hy6OszaJo3D2mohWSD4wFXirBr JXM0+zruOuVbkEXzkZrM7LHUMqp+Y9eAVee/4T/WMRZVyDIsNsIzKoe2n8QEmEN0UKG9WSljfk GufTKdxqvVjR344gE3LvmPTMg7VO9Kw2IghB+IrEJu5VQNB2vCH1bFrZJcEZoNRb0tn13aY899 VXS7E/oV9ORPTZx+myh8rNFnyOvU5norfD8QeTOHxrwvIWLSFqKUxFebxlJqkXTaKposIHsC9c M8L1HYKOQSX5zzom1kzPpz7ta1eRldcDzOU73+3+QW6sQw==; 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=wof0JxUgGPbwyGYFfQ0NdTX9jxsRb2OehgKYu5gyVag=; b=Wp5fAoeCCxox/6ih8YAzNIbOaV DjfypGEMXezgIdApNJWWX3xTorNOnxFP0XGFuDNfMWp7XcBq8P8M7LSt7l/Z4Kg+vLeGb5aqCdFwD Q4xc+jxDV6N4jX8M/oe2DKDyM3sM4k8umpVmahhtJLvz7gN+iXiqF5gixMtkwdNueYEwG6XyWRaQn rb07ha9o7ETMnB/XzaUSjGgQZbNNOfPpoiCgeuTk0Pi7Cg+aMFson+7tbiK8zPWgEyFNMikVrJ27Z ZnFC8KLLe0VRElZvU4+1GCs/ww0/kersXn52dyN+vceaEOVdi0GYRIGawXaLarFnuE7Mye9+0sA5R E77Xcidw==; Received: by zero.zsh.org with local id 1rMYAk-000Bpu-NE; Sun, 07 Jan 2024 18:46:58 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lf1-f51.google.com) smtp.remote-ip=209.85.167.51; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-lf1-f51.google.com ([209.85.167.51]:51321) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rMYAB-000BWK-SM; Sun, 07 Jan 2024 18:46:25 +0000 Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-50ea8fbf261so1106400e87.2 for ; Sun, 07 Jan 2024 10:46:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20230601.gappssmtp.com; s=20230601; t=1704653183; x=1705257983; darn=zsh.org; 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=wof0JxUgGPbwyGYFfQ0NdTX9jxsRb2OehgKYu5gyVag=; b=t9XGNmMVPVWiP0YzZ68c/4LZDlAzZVFbe3K82u7PGMqx6HuX0yzxrdX626uFP0P//4 4jWM6UrcYq0jNKQ9N+yDA5WGnNa8FV3L0OwkbJjZvRNod3yYCLgPwwWHZdGwQqAe1bYw 8JrecdOufjgEFQsOEXF/05sCzs5ej7Y/RqIcGItwy8NNcTkN2ANWn49OATQxU8Z/pAbg A49NK9396h1Oom2OT04sNfYxJ28Q4TM/kVBmApkBN8RSLnYSmlwcfBekJf1QrGUYREzq khcHktEOpJIDXRRwnISUyOFnxEpZT3Q2nMgLLpQsQ9rDKLUQcFwPGkn735vAj5YvRPOY sV+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704653183; x=1705257983; 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=wof0JxUgGPbwyGYFfQ0NdTX9jxsRb2OehgKYu5gyVag=; b=eGDLmBTV9SAaZt1g33zrHnwSVXDheWZ+RFgciQ9neFd3gKZBvVeA6FA9p9RMIlcOes R+SWvmUMW9llhrCYaFHw7L6t+yUjI3yWQZ/PML/YIRhw5HCfb8gQ4vJioBee70DKIvcQ 8o/5dVbRgS1x+voIG5fuUIFUpb9Z7eosevShXpFHaIHg8nZryyol5HEbFDZ7ySyurCmE dtu+8LbSN7BqSbAkW0CacninqP3D+Zuu0Ep+uLSO2fDXWEe1d6G+qU8Oi82sq0//DI1Z Nz+KD/B9Uac022k5KM3c8zbKJYfnAAj1BXU2r1816SfAhcI+8iPId5WuNskdtH9f1Cab JWPA== X-Gm-Message-State: AOJu0YySDk2rTMr4Y18xIFfk1L5bThcrcapVRRVgmTMqxvq6jFheR8Pc LyBtnb/ySOKvr0gjVKGY607jQXaBVngK1TLXqQQayFeqs1RA6XICM366iPa1JQ== X-Google-Smtp-Source: AGHT+IGjYqZ7qeHoQd688QpHFkHg2eYRXauy2kXDC9vDDmUbKEBs/Y4haoqILByRhDKvbUbZZaMOHKUdo+Yh7mEZGmM= X-Received: by 2002:a19:760b:0:b0:50e:38ac:c3cc with SMTP id c11-20020a19760b000000b0050e38acc3ccmr880816lff.119.1704653182618; Sun, 07 Jan 2024 10:46:22 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Sun, 7 Jan 2024 10:46:10 -0800 Message-ID: Subject: Re: File completion with git ls-files To: =?UTF-8?B?SsO2cmcgU29tbWVy?= Cc: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 52470 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On Sun, Jan 7, 2024 at 10:05=E2=80=AFAM J=C3=B6rg Sommer w= rote: > > I am looking for a way to complete the full path to files in a subdirecto= ry > by its name. I would like to enter `less foo`, hit TAB (or a special shor= t > cut) and cycle through the list of `dir/subd-1/subd-2/foo=E2=80=A6`, > `dir2/abc/foo=E2=80=A6`, `dir2/s1/s2/s3/foo`. This is more along the lines of a zsh-users question, but something like th= is: git-search-complete() { local f for f in ${(f)"$( git ls-files )"} do if [[ $f =3D */* ]] then compadd -f -P $f:h/ $f:t else compadd -f $f fi done } zle -C git-search-complete .menu-complete git-search-complete Then bindkey git-search-complete to your preference. This could pretty easily be made into an entry in your "completer" zstyle to be invoked by TAB when nothing is found by earlier completers.