Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: history-search + a few new user question



Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> } 2) some way to set "ignorerece" so
> 
> "rece"?  Hmm, must be Czech?
> 
> However, I see what you're getting at, and the answer is no, there is
> not in general a way to make zsh behave that way unless the underlying
> filesystem does so (like in cygwin).

Well, there's the option "nocaseglob", which interprets patterns that way,
but the problem is "downloads" is a simple string which isn't treated as a
pattern (which is why Bart didn't bother mentioning the option).  You can
use tricks to force it to be a pattern, but you'll probably think they're
too clumsy to use:

% setopt nocaseglob
% echo downloads(/)
DownLoads

Basically, anything which (1) is a pattern of some sort (2) only matches
the thing you want will do the trick.  The pattern here picks out all
directories called downloads, but using the normal globbing rules, so
"nocaseglob" is applied.

> } cd downloads
> } interprets as too
> } cd DownLoads 
> 
> For specific cases, such as "cd", you can fix it:

Another useful thing to know about (again, not quite what you asked for) is
completion's matching control, which allows it to match case-insenstively.
Assuming you are using the new completion system, try this setting:

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

(You don't need "nocaseglob" for this).  Now you can type:

% cd downloads<TAB>

and the completion system will work out that the file you want is called
DownLoads and change it.  This will work for any file, indeed any form of
completion that doesn't replace the matcher list.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com



Messages sorted by: Reverse Date, Date, Thread, Author