zsh-users
 help / color / mirror / code / Atom feed
* case-insensitive filename completion?
@ 2000-03-16 15:13 John S Cooper
  2000-03-16 15:49 ` Bart Schaefer
  2000-03-16 15:49 ` Oliver Kiddle
  0 siblings, 2 replies; 6+ messages in thread
From: John S Cooper @ 2000-03-16 15:13 UTC (permalink / raw)
  To: zsh-users; +Cc: amold


I've been using the NT version of zsh for a while and have grown to like the
case-insensitive filename completion that it offers via the winntignorecase
option.

Has anyone considered adding an equivalent option to the unix version?  I like
typing mostly in lowercase and having the shell "fix up" the case for me if it
can do so unambiguously.

E.g.,. I'd like to have the following expand to ~/.Xdefaults if I have no other
files beginning .XdE, .xdeasdf, etc.

  $ ls ~/.xde<TAB>

If I have 2 files `Foo' and `foo' and type `ls f<TAB>', I guess it could do
either:

a) complete `foo'
b) leave me at `f' and offer `foo' and `Foo' as further completion matches.

I'm not sure which I would prefer - perhaps another option could control this!

[please copy me on replies as I'm not on the list]

Thanks,

    --- John


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

* Re: case-insensitive filename completion?
  2000-03-16 15:13 case-insensitive filename completion? John S Cooper
@ 2000-03-16 15:49 ` Bart Schaefer
  2000-03-16 17:00   ` John S Cooper
  2000-03-16 15:49 ` Oliver Kiddle
  1 sibling, 1 reply; 6+ messages in thread
From: Bart Schaefer @ 2000-03-16 15:49 UTC (permalink / raw)
  To: John S Cooper, zsh-users

On Mar 16,  3:13pm, John S Cooper wrote:
} Subject: case-insensitive filename completion?
}
} Has anyone considered adding [case-insensitive filename completion] to
} the unix version?

It's in the 3.1.6 development series.  You can find a fairly recent copy
of the source under ftp.zsh.org:/pub/development/.  There are several ways
to configure it; the most direct is:

	zstyle ":completion:*" matcher-list 'm:{A-Za-z}={a-zA-Z}'

which means that any letter on the command line (left of the `=') matches
any letter of the opposite case in the completions (right of the `='), in
addition to matching itself.  If you prefer case folding in only one
direction:

	zstyle ":completion:*" matcher-list 'm:{A-Z}={a-z}'

maps upper case on the command line to lower case in the completions.

There are zstyle settings to control spelling correction, approximate
matching, and a wide variety of other completion-driven manipulations.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


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

* Re: case-insensitive filename completion?
  2000-03-16 15:13 case-insensitive filename completion? John S Cooper
  2000-03-16 15:49 ` Bart Schaefer
@ 2000-03-16 15:49 ` Oliver Kiddle
  1 sibling, 0 replies; 6+ messages in thread
From: Oliver Kiddle @ 2000-03-16 15:49 UTC (permalink / raw)
  To: John S Cooper; +Cc: zsh-users, amold

John S Cooper wrote:
> 
> Has anyone considered adding an equivalent option to the unix version?  I like
> typing mostly in lowercase and having the shell "fix up" the case for me if it
> can do so unambiguously.

The development releases of Zsh have added case-insensitive completion
as an option so this will appear in the next release of zsh.

If you look at the documentation for the latest zsh development release,
find the section on matching control. It is very configurable and very
powerful - not just a simple option for case-insensitivity.

Oliver Kiddle


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

* Re: case-insensitive filename completion?
  2000-03-16 15:49 ` Bart Schaefer
@ 2000-03-16 17:00   ` John S Cooper
  2000-03-16 17:30     ` Oliver Kiddle
  2000-03-16 17:34     ` Bart Schaefer
  0 siblings, 2 replies; 6+ messages in thread
From: John S Cooper @ 2000-03-16 17:00 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: John S Cooper, zsh-users

"Bart Schaefer" <schaefer@candle.brasslantern.com> writes:

 > On Mar 16,  3:13pm, John S Cooper wrote:
 > } Subject: case-insensitive filename completion?
 > }
 > } Has anyone considered adding [case-insensitive filename completion] to
 > } the unix version?
 > 
 > It's in the 3.1.6 development series.  You can find a fairly recent copy
 > of the source under ftp.zsh.org:/pub/development/.  There are several ways
 > to configure it; the most direct is:
 > 
 > 	zstyle ":completion:*" matcher-list 'm:{A-Za-z}={a-zA-Z}'

I've just installed 3.6.1 and have the case-insensitive completion working with
this (from the man pages):

    compctl -M 'm:{a-zA-Z}={A-Za-z}'

I notice there's a huge amount of new stuff, which will inevitably take some
time to learn about.  Initial differences I notice:

1) My `setopt autolist' behavior seems to no longer work:

3.0.5:
  $ echo $Z<TAB>
=>
  $ echo $ZSH_
  ZSH_NAME     ZSH_VERSION

3.1.6:
  $ echo $Z<TAB>
=>
  $ echo $ZSH_  


2) If my cursor is at the bottom of my xterm window, filename completion
scrolls the "current line" upwards in order to list completions below.  With
3.0.5 the cursor remained on the bottom line and completions were listed
above.  I preferred the 3.0.5 behavior, as I could just look at the bottom for
my input line rather than having to look upwards to find it.

If anyone can show me how to "fix" these 2 quibbles, I'll probably live with
the new version and gradually learn it over time.  [I suppose I am being lazy,
but just have too much "real" work to do right now! :-)]

Thanks,

    --- John


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

* Re: case-insensitive filename completion?
  2000-03-16 17:00   ` John S Cooper
@ 2000-03-16 17:30     ` Oliver Kiddle
  2000-03-16 17:34     ` Bart Schaefer
  1 sibling, 0 replies; 6+ messages in thread
From: Oliver Kiddle @ 2000-03-16 17:30 UTC (permalink / raw)
  To: John S Cooper; +Cc: Bart Schaefer, zsh-users

John S Cooper wrote:

> 1) My `setopt autolist' behavior seems to no longer work:

I can't reproduce this. Try it after zsh -f and then add in your options
and setup bit-by-bit to see if you can isolate something which is
breaking it.

> 2) If my cursor is at the bottom of my xterm window, filename completion
> scrolls the "current line" upwards in order to list completions below.  With
> 3.0.5 the cursor remained on the bottom line and completions were listed
> above.  I preferred the 3.0.5 behavior, as I could just look at the bottom for
> my input line rather than having to look upwards to find it.

Try: unsetopt alwayslastprompt.

I didn't like this feature initially either but by the time I'd worked
out how to turn it off, I'd come to like it.

Oliver Kiddle


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

* Re: case-insensitive filename completion?
  2000-03-16 17:00   ` John S Cooper
  2000-03-16 17:30     ` Oliver Kiddle
@ 2000-03-16 17:34     ` Bart Schaefer
  1 sibling, 0 replies; 6+ messages in thread
From: Bart Schaefer @ 2000-03-16 17:34 UTC (permalink / raw)
  To: John S Cooper; +Cc: zsh-users

On Mar 16,  5:00pm, John S Cooper wrote:
} Subject: Re: case-insensitive filename completion?
}
} 1) My `setopt autolist' behavior seems to no longer work

unsetopt list_ambiguous

} 2) If my cursor is at the bottom of my xterm window, filename completion
} scrolls the "current line" upwards in order to list completions below.

unsetopt always_last_prompt


Both of these result from a change to make the default option settings in
3.1.2+ display more of the fancy features of zsh.  The 3.0.x and earlier
ethic had been to leave most of the fancy stuff turned off until the user
discovered it.  It was decided that most people NEVER discovered it, so
it would be better start out with it and make people turn it off.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


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

end of thread, other threads:[~2000-03-16 17:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-16 15:13 case-insensitive filename completion? John S Cooper
2000-03-16 15:49 ` Bart Schaefer
2000-03-16 17:00   ` John S Cooper
2000-03-16 17:30     ` Oliver Kiddle
2000-03-16 17:34     ` Bart Schaefer
2000-03-16 15:49 ` Oliver Kiddle

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