zsh-users
 help / color / mirror / code / Atom feed
From: "John Cooper" <john.cooper@eu.citrix.com>
To: "John Cooper" <john.cooper@eu.citrix.com>, <zsh-users@sunsite.dk>
Subject: RE: Case insensitive completion problems with cygwin
Date: Thu, 2 Nov 2006 12:36:00 -0000	[thread overview]
Message-ID: <DD74FBB8EE28D441903D56487861CD9D0971751A@lonpexch01.citrite.net> (raw)
In-Reply-To: <DD74FBB8EE28D441903D56487861CD9D09717519@lonpexch01.citrite.net>

After a fair bit of trial-and-error I've found the following settings seem to achieve the desired result:

  zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
  zstyle ':completion:*:paths' accept-exact 'c:' 'b:' 'w:' 'r:' 'v:'
  zstyle ':completion:*' fake-files '/:c' '/:b' '/:w' '/:r' '/:v'

That is, I now get case-insensitive completion for all the following:
$ ls /c/p<TAB>
$ ls /C/p<TAB>
$ ls c:/p<TAB>
$ ls C:/p<TAB>

Assuming this is a recommended approach, perhaps a candidate for the FAQ?

(Btw, I've used cygwin's `mount -c' to change the cygdrive prefix to '/' rather than the default '/cygdrive', so that my drives appears as '/c', '/v', etc rather than the more usual '/cygdrive/c', '/cygdrive/v', etc.)

    --- John. 
________________________________________
From: John Cooper [mailto:john.cooper@eu.citrix.com] 
Sent: 01 November 2006 18:13
To: zsh-users@sunsite.dk
Subject: Case insensitive completion problems with cygwin

[I'm using zsh 4.3.2 on Windows 2003 with cygwin]
If I run `zsh -f' file completion works as expected in all the following:
$ ls /c/<TAB>
$ ls /C/<TAB>
$ ls c:/<TAB>
$ ls C:/<TAB>
However, after running the following:
  zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
  autoload -U compinit
  compinit -C
$ ls /c/<TAB>   # fails - no completions are listed
$ ls /C/<TAB>   # works as expected
$ ls c:/<TAB>   # fails - no completions are listed
$ ls C:/<TAB>   # works as expected

I've found I can work around the problem by adding a '' to the above matcher-list, namely:
  zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}'
However, this isn't really the behavior I'd like as the following will no longer
automatically complete both uppercase and lowercase matches. So if I now type
the following:
$ ls /c/p<TAB>
.. it will no longer list "/c/Program\ Files" as one of the completion matches,
and I have to manually hit backspace and change to an uppercase "P".
So, if I revert to the original matcher-list and try messing with fake-files:
  zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
  zstyle ':completion:*' fake-files '/:c g h l r w z'
.. I then get the desired behavior where the following lists all files
beginning with 'p' or 'P':
$ ls /c/p<TAB>
However, now the following no longer works:
$ ls c:/<TAB>  # fails - no completions are listed

Is there a way to get true case-insensitive completion working for both /c/ and
c:/ as a prefix?
Thanks,
    --- John


  reply	other threads:[~2006-11-02 12:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-01 18:13 John Cooper
2006-11-02 12:36 ` John Cooper [this message]
2006-11-02 13:05   ` Peter Stephenson
2006-11-02 13:45     ` John Cooper

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=DD74FBB8EE28D441903D56487861CD9D0971751A@lonpexch01.citrite.net \
    --to=john.cooper@eu.citrix.com \
    --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).