zsh-users
 help / color / mirror / code / Atom feed
* _complete: insert unambiguous when globbing
@ 2022-01-03 12:39 Tomasz Pala
  2022-01-03 15:40 ` Tomasz Pala
  2022-01-04  0:25 ` Bart Schaefer
  0 siblings, 2 replies; 9+ messages in thread
From: Tomasz Pala @ 2022-01-03 12:39 UTC (permalink / raw)
  To: zsh-users

Hello,

I'm struggling with something which felt basic, yet I cannot find a
valid solution (in any combination of remaining styles)...

mkdir empty
cd empty
touch 20{a,b,c,d}.x

ls 2[tab]	==> 20		this is expected
ls 2*[tab]	!=> 20		how to make this to be expanded first to

"20", and then the regular rules to proceed (either menu complete I
always use, or _expand)?

More advanced example:
ls 2*x[tab]	?=> 20[completions]x

And the most advanced:
ls 2*[tab]	?=> 20*.x	with the cursor placed after "*"


In the most advanced form, the _completion expands "2*", finds out there
is unambiguous "20" prefix and ".x" suffix and puts them into ZLE before
performing completion (in my case, menu).

In other words, I want the globbing _complete to behave like non-globbing one.


While the initial case is pointless (simply don't put the "*" at the
end), I'd like to use it when looking for specific file types. I often
look for logs in 2021.*.xz form and when there is too many matches I
want to narrow them down, but I could simply type 2*z[tab] to have the
same effect.

best regards,
-- 
Tomasz Pala <gotar@pld-linux.org>


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

end of thread, other threads:[~2022-01-06 10:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-03 12:39 _complete: insert unambiguous when globbing Tomasz Pala
2022-01-03 15:40 ` Tomasz Pala
2022-01-04  0:25 ` Bart Schaefer
2022-01-05 19:46   ` Tomasz Pala
2022-01-05 20:11     ` Bart Schaefer
2022-01-06  1:52       ` Tomasz Pala
2022-01-06 10:38         ` Tomasz Pala
2022-01-05 20:15     ` Tomasz Pala
2022-01-05 20:25       ` Bart Schaefer

Code repositories for project(s) associated with this public 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).