zsh-users
 help / color / mirror / code / Atom feed
From: Tomasz Pala <gotar@polanet.pl>
To: zsh-users@zsh.org
Subject: Re: _complete: insert unambiguous when globbing
Date: Mon, 3 Jan 2022 16:40:49 +0100	[thread overview]
Message-ID: <20220103154049.GA5954@polanet.pl> (raw)
In-Reply-To: <20220103123903.GA20434@polanet.pl>

Sorry for mailing this to @sunsite.dk - please reply using this
forward...

On Mon, Jan 03, 2022 at 13:39:03 +0100, Tomasz Pala wrote:

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

One more note - zsh knows where the first ambiguous character is, even
with globbing, as it's shown with show-ambiguity style.

The question remains: how to make it complete the common parts when
globbing.

-- 
Tomasz Pala <gotar@pld-linux.org>


  reply	other threads:[~2022-01-03 15:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-03 12:39 Tomasz Pala
2022-01-03 15:40 ` Tomasz Pala [this message]
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

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20220103154049.GA5954@polanet.pl \
    --to=gotar@polanet.pl \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).