help / color / mirror / code / Atom feed
From: zzapper <zsh@rayninfo.co.uk>
To: Mikael Magnusson <mikachu@gmail.com>
Cc: Zsh-Users List <zsh-users@zsh.org>
Subject: Re: How to accept a particular directory during directory selection for further tab completion
Date: Fri, 22 Apr 2022 17:27:39 +0100	[thread overview]
Message-ID: <e9c87a81-801c-9e8d-2508-f0738a9567ec@rayninfo.co.uk> (raw)
In-Reply-To: <CAHYJk3Qe-bsV1YSnbQVRrB11W6kjTBAGfWrZFFFiQvdWvggU=Q@mail.gmail.com>

On 22/04/2022 12:05, Mikael Magnusson wrote:
> On 4/22/22, zzapper <zsh@rayninfo.co.uk> wrote:
>> Hi
>> cd aa<tab>
>> aaa/ aab/ aac/
>> I want to accept aab/ then carry on completing
>> I do this by manually deleting and then retyping the trailing slash.
>> But I guess there is an official way to do this?
> If you press a key bound to accept-and-infer-next-history during menu
> selection, then it will be accepted and menu selection will be
> automatically started again. There is no such key bound by default but
> you can do
> bindkey -M menuselect whateverkey accept-and-infer-next-history
> manpage entry:
> accept-and-infer-next-history
>   accepts  the  current match and then tries completion with menu selec‐
>   tion again;  in the case of files this allows one to select  a  direc‐
>   tory and immediately attempt to complete files in it;  if there are no
>   matches, a message is shown and one can use undo to go back to comple‐
>   tion  on  the  previous  level,  every other key leaves menu selection
>   (including the other zle functions which are otherwise special  during
>   menu selection)
> relatedly, accept-and-hold (or accept-and-menu-complete, they do the
> same thing here) is also useful:
> accept-and-hold, accept-and-menu-complete
>   accept the currently inserted match and continue selection allowing to
>   select the next match to insert into the line
> If you press this while several levels deep, you will insert one of
> the matches to the command line, and stay in the same directory in
> menu selection so you don't have to navigate back there to insert the
> next file you want (or slightly more optimally, copy-earlier-word and
> erase to last slash)
MM thanks for the detailed reply

  reply	other threads:[~2022-04-22 16:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-22  9:15 zzapper
2022-04-22  9:46 ` Jérémie Roquet
2022-04-22  9:59   ` zzapper
2022-04-22 11:05 ` Mikael Magnusson
2022-04-22 16:27   ` zzapper [this message]
2022-04-24 11:05 ` zzapper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e9c87a81-801c-9e8d-2508-f0738a9567ec@rayninfo.co.uk \
    --to=zsh@rayninfo.co.uk \
    --cc=mikachu@gmail.com \
    --cc=zsh-users@zsh.org \
    --subject='Re: How to accept a particular directory during directory selection for further tab completion' \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).