zsh-users
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: zsh-users@sunsite.dk
Cc: zzapper <david@tvis.co.uk>
Subject: Re: Why doesn't cd ignore files when you type say "cd fred*"
Date: Fri, 05 Dec 2003 11:54:38 +0100	[thread overview]
Message-ID: <2542.1070621678@gmcs3.local> (raw)
In-Reply-To: <k2pusvsfg64p2070t8iplb9l1ckp4t52du@4ax.com>

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


  reply	other threads:[~2003-12-05 10:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-04 14:54 zzapper
2003-12-04 15:37 ` Peter Stephenson
2003-12-04 16:47   ` zzapper
2003-12-05 10:54     ` Oliver Kiddle [this message]
2003-12-05 11:06       ` zzapper
2003-12-05 14:27         ` Oliver Kiddle
2003-12-04 17:30 ` Bart Schaefer
2003-12-04 20:50   ` zzapper
2003-12-04 22:56     ` Pavol Juhas

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=2542.1070621678@gmcs3.local \
    --to=okiddle@yahoo.co.uk \
    --cc=david@tvis.co.uk \
    --cc=zsh-users@sunsite.dk \
    /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).