zsh-users
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Zsh-users List <zsh-users@sunsite.dk>
Subject: Re: Case-insensitive completion
Date: Wed, 17 Sep 2003 09:30:39 +0200	[thread overview]
Message-ID: <17942.1063783839@gmcs3.local> (raw)
In-Reply-To: <1030916170354.ZM30176@candle.brasslantern.com>

Bart wrote:

> Normally the way to do that would be to use different keybindings for
> "complete case-insensitively" vs. "complete case-sensitively" and tell
> zsh your preference by which of them you invoke.
> 
> Start with zstyles something like this:
> 
>   zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
>   zstyle ':completion:*:case-sensitive:*' matcher-list ''
>   zstyle ':completion:*' completer _expand _complete _ignored
> 
> Then, in a file (name doesn't matter much) somewhere in the path where
> compinit looks for completion functions, you put:
> 
> ---- 8< ---- snip ---- 8< ----
> #compdef -k complete-word \C-xI
> _main_complete _expand _complete:case-sensitive _ignored
> ---- 8< ---- snip ---- 8< ----

Would always use _generic for that type of thing myself. Avoids the need
for a separate function file:

zle -C case-sensitive complete-word _generic
zstyle ':completion:case-sensitive::::' completer _expand _complete _ignored
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
zstyle ':completion:case-sensitive:*' matcher-list ''
bindkey '^XI' case-sensitive

Oliver


  reply	other threads:[~2003-09-17  7:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-14 10:30 Jesper Holmberg
2003-09-14 18:58 ` Bart Schaefer
2003-09-15 19:08   ` Jesper Holmberg
2003-09-16 17:03     ` Bart Schaefer
2003-09-17  7:30       ` Oliver Kiddle [this message]
2003-09-17 14:36         ` Bart Schaefer
2003-09-16 10:09   ` Oliver Kiddle
2003-09-16 11:59     ` Peter Stephenson
2003-09-16 12:17       ` Oliver Kiddle
2003-09-16 12:22         ` Jesper Holmberg
2003-09-17  7:40 ` Oliver Kiddle
2003-09-17 14:43   ` Bart Schaefer
2003-09-17 15:15     ` Oliver Kiddle
2003-09-18 10:26       ` Jesper Holmberg

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=17942.1063783839@gmcs3.local \
    --to=okiddle@yahoo.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).