zsh-users
 help / color / mirror / code / Atom feed
* How to accept a particular directory during directory selection for further tab completion
@ 2022-04-22  9:15 zzapper
  2022-04-22  9:46 ` Jérémie Roquet
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: zzapper @ 2022-04-22  9:15 UTC (permalink / raw)
  To: Zsh-Users List

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?

zzapper



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to accept a particular directory during directory selection for further tab completion
  2022-04-22  9:15 How to accept a particular directory during directory selection for further tab completion 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-24 11:05 ` zzapper
  2 siblings, 1 reply; 6+ messages in thread
From: Jérémie Roquet @ 2022-04-22  9:46 UTC (permalink / raw)
  To: zzapper; +Cc: Zsh-Users List

Hi zzapper,

Le ven. 22 avr. 2022 à 11:16, zzapper <zsh@rayninfo.co.uk> a écrit :
> $ cd aa<tab>
> aaa/ aab/ aac/
>
> I want to accept aab/ then carry on completing

Just typing <tab> (once for aaa/, twice for aab/, etc.) then slash is enough:

  https://asciinema.org/a/qF9oeQVjENjhKxOvgUyGg2zQo

Best regards,

-- 
Jérémie


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to accept a particular directory during directory selection for further tab completion
  2022-04-22  9:46 ` Jérémie Roquet
@ 2022-04-22  9:59   ` zzapper
  0 siblings, 0 replies; 6+ messages in thread
From: zzapper @ 2022-04-22  9:59 UTC (permalink / raw)
  To: zsh-users


On 22/04/2022 10:46, Jérémie Roquet wrote:
>
> Just typing <tab> (once for aaa/, twice for aab/, etc.) then slash is enough:
>
>    https://asciinema.org/a/qF9oeQVjENjhKxOvgUyGg2zQo
>
> Best regards,
>

Jérémie , yes i like that (BTW your asciinema is in too small a font)



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to accept a particular directory during directory selection for further tab completion
  2022-04-22  9:15 How to accept a particular directory during directory selection for further tab completion zzapper
  2022-04-22  9:46 ` Jérémie Roquet
@ 2022-04-22 11:05 ` Mikael Magnusson
  2022-04-22 16:27   ` zzapper
  2022-04-24 11:05 ` zzapper
  2 siblings, 1 reply; 6+ messages in thread
From: Mikael Magnusson @ 2022-04-22 11:05 UTC (permalink / raw)
  To: zzapper; +Cc: Zsh-Users List

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)

-- 
Mikael Magnusson


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to accept a particular directory during directory selection for further tab completion
  2022-04-22 11:05 ` Mikael Magnusson
@ 2022-04-22 16:27   ` zzapper
  0 siblings, 0 replies; 6+ messages in thread
From: zzapper @ 2022-04-22 16:27 UTC (permalink / raw)
  To: Mikael Magnusson; +Cc: Zsh-Users List


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to accept a particular directory during directory selection for further tab completion
  2022-04-22  9:15 How to accept a particular directory during directory selection for further tab completion zzapper
  2022-04-22  9:46 ` Jérémie Roquet
  2022-04-22 11:05 ` Mikael Magnusson
@ 2022-04-24 11:05 ` zzapper
  2 siblings, 0 replies; 6+ messages in thread
From: zzapper @ 2022-04-24 11:05 UTC (permalink / raw)
  To: zsh-users


On 22/04/2022 10:15, zzapper 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?
>
> zzapper
>
Have I totally foobar-ed here????

Doesn't simple hitting 'return' do what I want  e.g. accept that 
directory and then allow me carry on completing??


zzapper



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-04-24 11:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-22  9:15 How to accept a particular directory during directory selection for further tab completion 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
2022-04-24 11:05 ` zzapper

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

	https://git.vuxu.org/mirror/zsh/

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).