zsh-users
 help / color / mirror / code / Atom feed
* Substring completion
@ 2006-08-15  6:54 Mika Borner
  2006-08-15  8:01 ` sac
  0 siblings, 1 reply; 2+ messages in thread
From: Mika Borner @ 2006-08-15  6:54 UTC (permalink / raw)
  To: zsh-users

Hi

I just started to use zsh, so this might sound like a newbie question.
I searched with google for a solution,  but could not find anything.
Here's my problem:

I'm trying to write a completion. All the possible arguments are in a
predefined array. Because the elements are quite complex, I want to have
a completion that works  by giving a substring of an element. All the
completions that I've found so far (e.g. file completion), demand that
the completion starts from the first letter.

 Is there a utility function to acomplish this? The man pages are
"quite" complex, so I might have overlooked something...

//Mika

# mv Disclaimer.txt /dev/null


-------------------------------------------------------------------------
This message is intended for the addressee only and may
contain confidential or privileged information. If you
are not the intended receiver, any disclosure, copying
to any person or any action taken or omitted to be taken
in reliance on this e-mail, is prohibited and may be un-
lawful. You must therefore delete this e-mail.
Internet communications may not be secure or error-free
and may contain viruses. They may be subject to possible
data corruption, accidental or on purpose. This e-mail is
not and should not be construed as an offer or the
solicitation of an offer to purchase or subscribe or sell
or redeem any investments.
-------------------------------------------------------------------------


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

* Re: Substring completion
  2006-08-15  6:54 Substring completion Mika Borner
@ 2006-08-15  8:01 ` sac
  0 siblings, 0 replies; 2+ messages in thread
From: sac @ 2006-08-15  8:01 UTC (permalink / raw)
  To: zsh-users

Hi,

Actually the following does the job.

zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}
m:{a-zA-Z}={A-Za-z} r:|[._-]=** r:|=** l:|=*'
'm:{a-z}={A-Z}'

The above line is generated by the program
compinstall.
For me its more of a pain than pleasure. Anyway hope
it helps you.

Regards,
sac.

--- Mika Borner <Mika.Borner@clariden.com> wrote:

> Hi
> 
> I just started to use zsh, so this might sound like
> a newbie question.
> I searched with google for a solution,  but could
> not find anything.
> Here's my problem:
> 
> I'm trying to write a completion. All the possible
> arguments are in a
> predefined array. Because the elements are quite
> complex, I want to have
> a completion that works  by giving a substring of an
> element. All the
> completions that I've found so far (e.g. file
> completion), demand that
> the completion starts from the first letter.
> 
>  Is there a utility function to acomplish this? The
> man pages are
> "quite" complex, so I might have overlooked
> something...
> 
> //Mika
> 
> # mv Disclaimer.txt /dev/null
> 
> 
>
-------------------------------------------------------------------------
> This message is intended for the addressee only and
> may
> contain confidential or privileged information. If
> you
> are not the intended receiver, any disclosure,
> copying
> to any person or any action taken or omitted to be
> taken
> in reliance on this e-mail, is prohibited and may be
> un-
> lawful. You must therefore delete this e-mail.
> Internet communications may not be secure or
> error-free
> and may contain viruses. They may be subject to
> possible
> data corruption, accidental or on purpose. This
> e-mail is
> not and should not be construed as an offer or the
> solicitation of an offer to purchase or subscribe or
> sell
> or redeem any investments.
>
-------------------------------------------------------------------------
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


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

end of thread, other threads:[~2006-08-15  8:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-15  6:54 Substring completion Mika Borner
2006-08-15  8:01 ` sac

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