Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Why doesn't cd ignore files when you type say "cd fred*"
- X-seq: zsh-users 6842
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Why doesn't cd ignore files when you type say "cd fred*"
- Date: Fri, 05 Dec 2003 11:54:38 +0100
- Cc: zzapper <david@xxxxxxxxxx>
- In-reply-to: <k2pusvsfg64p2070t8iplb9l1ckp4t52du@xxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <kohusvg6jgqkqqtbc5th8h12b61iomo1gr@xxxxxxx> <4222.1070552274@xxxxxxx> <k2pusvsfg64p2070t8iplb9l1ckp4t52du@xxxxxxx>
zzapper wrote:
> Yes tasty! ( I've called this cdd and left the builtin cd alone). (is
> the keyword function optional?)
>
> But are there any solutions using COMPCTRL?
Yes.
With old style completion, try the globcomplete option.
With new completion, you can use the _match completer. You can use it
in the main list of completers. That will cause all globs like "fred*"
to be matched against the completion matches.
I prefer _expand because it does proper filename generation, handling
globbing flags etc but I bind _match to a separate key. So if I was to
do `cd fred*' and then press escape *, it would just complete the
directory. I think this below is the relevant setup code I use. You may
want to adjust the first zstyle and do without the second.
bindkey '\e*' match-word
zstyle ':completion:match-word::::' completer _all_matches _match _ignored
zstyle ':completion:match-word:*' match-original both
zle -C match-word complete-word _generic
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author