zsh-users
 help / color / mirror / code / Atom feed
* Completion II
@ 2007-05-17 11:12 zzapper
  2007-05-17 11:23 ` Nikolai Weibull
  0 siblings, 1 reply; 6+ messages in thread
From: zzapper @ 2007-05-17 11:12 UTC (permalink / raw)
  To: zsh-users

Hi

Say I want to complete a filename I know contains a certain string 'joe'

I can do 

> vi *joe*<TAB>

or even

> vi main*joe*<TAB>

Can I however do the opposite and avoid an arbitrary string joe?




-- 
zzapper
http://www.rayninfo.co.uk/vimtips.html


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

* Re: Completion II
  2007-05-17 11:12 Completion II zzapper
@ 2007-05-17 11:23 ` Nikolai Weibull
  2007-05-17 11:37   ` zzapper
  0 siblings, 1 reply; 6+ messages in thread
From: Nikolai Weibull @ 2007-05-17 11:23 UTC (permalink / raw)
  To: zzapper; +Cc: zsh-users

On 5/17/07, zzapper <david@tvis.co.uk> wrote:
> Hi
>
> Say I want to complete a filename I know contains a certain string 'joe'
>
> I can do
>
> > vi *joe*<TAB>
>
> or even
>
> > vi main*joe*<TAB>

% man zshexpn

(search for "Matches anything except")

You'll find two options, ^x and x~y.  ^x matches anything except
whatever x matches.  x~y matches anything x matches except anything
that also matches y.

  nikolai


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

* Re: Completion II
  2007-05-17 11:23 ` Nikolai Weibull
@ 2007-05-17 11:37   ` zzapper
  2007-05-17 11:46     ` Nikolai Weibull
  0 siblings, 1 reply; 6+ messages in thread
From: zzapper @ 2007-05-17 11:37 UTC (permalink / raw)
  To: zsh-users

"Nikolai Weibull" <now@bitwi.se> wrote in 
news:dbfc82860705170423p4de4b42fh564a4f5df78c1638@mail.gmail.com:

> On 5/17/07, zzapper <david@tvis.co.uk> wrote:
>> Hi
>>
>> Say I want to complete a filename I know contains a certain string 'joe'
>>
>> I can do
>>
>> > vi *joe*<TAB>
>>
>> or even
>>
>> > vi main*joe*<TAB>
> 
> % man zshexpn
> 
> (search for "Matches anything except")
> 
> You'll find two options, ^x and x~y.  ^x matches anything except
> whatever x matches.  x~y matches anything x matches except anything
> that also matches y.
> 
>   nikolai
> 
> 
Sorry Not working for me can you give an example?


$ setopt
autopushd
nocaseglob
extendedglob
interactive
monitor
nopromptcr
pushdignoredups
shinstdin
zle


-- 
zzapper
http://www.rayninfo.co.uk/vimtips.html


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

* Re: Completion II
  2007-05-17 11:37   ` zzapper
@ 2007-05-17 11:46     ` Nikolai Weibull
  2007-05-17 12:03       ` zzapper
  0 siblings, 1 reply; 6+ messages in thread
From: Nikolai Weibull @ 2007-05-17 11:46 UTC (permalink / raw)
  To: zzapper; +Cc: zsh-users

On 5/17/07, zzapper <david@tvis.co.uk> wrote:

> "Nikolai Weibull" <now@bitwi.se> wrote in

> > % man zshexpn
> >
> > (search for "Matches anything except")
> >
> > You'll find two options, ^x and x~y.  ^x matches anything except
> > whatever x matches.  x~y matches anything x matches except anything
> > that also matches y.

> Sorry Not working for me can you give an example?

What's there to be sorry about?

Did you actually read the documentation?

% mkdir example && cd example &&  touch a b c d e f g && ls *~[ef] &&
cd .. && rm -r example
a  b  c  d  g

  nikolai


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

* Re: Completion II
  2007-05-17 11:46     ` Nikolai Weibull
@ 2007-05-17 12:03       ` zzapper
  2007-05-17 13:09         ` Thomas Köhler
  0 siblings, 1 reply; 6+ messages in thread
From: zzapper @ 2007-05-17 12:03 UTC (permalink / raw)
  To: zsh-users

"Nikolai Weibull" <now@bitwi.se> wrote in 
news:dbfc82860705170446n5f99ad5cj763702298b8cf68d@mail.gmail.com:

> On 5/17/07, zzapper <david@tvis.co.uk> wrote:
> 
>> "Nikolai Weibull" <now@bitwi.se> wrote in
> 
>> > % man zshexpn
>> >
>> > (search for "Matches anything except")
>> >
>> > You'll find two options, ^x and x~y.  ^x matches anything except
>> > whatever x matches.  x~y matches anything x matches except anything
>> > that also matches y.
> 
>> Sorry Not working for me can you give an example?
> 
> What's there to be sorry about?
> 
> Did you actually read the documentation?
> 
> % mkdir example && cd example &&  touch a b c d e f g && ls *~[ef] &&
> cd .. && rm -r example
> a  b  c  d  g
> 
>   nikolai
> 

Yep what I wanted was

vi main*~*joe*<TAB>

What I hadnt sussed was that the TAB completion respects normal FNG, cool!



-- 
zzapper
http://www.rayninfo.co.uk/vimtips.html


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

* Re: Completion II
  2007-05-17 12:03       ` zzapper
@ 2007-05-17 13:09         ` Thomas Köhler
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Köhler @ 2007-05-17 13:09 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 514 bytes --]

zzapper wrote:
[...]
> Yep what I wanted was
> 
> vi main*~*joe*<TAB>

You can bind your favorite key to expand-word and use that
instead of <TAB>.

I use vi keybindings and have mapped ^E for expand-word:
bindkey "^E" expand-word

Ciao,
Thomas

-- 
 Thomas Köhler       Email:       jean-luc@picard.franken.de
     <><             WWW:              http://gott-gehabt.de
                     IRC:                           tkoehler
                     PGP public key available from Homepage!

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2007-05-17 13:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-17 11:12 Completion II zzapper
2007-05-17 11:23 ` Nikolai Weibull
2007-05-17 11:37   ` zzapper
2007-05-17 11:46     ` Nikolai Weibull
2007-05-17 12:03       ` zzapper
2007-05-17 13:09         ` Thomas Köhler

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