6

How can you do case-insensitive pattern matching with Eshell? With Zsh, one can use "globbing tags" (i.e., if the extended_glob is turned on) such as in

print L(#i)in(#I)ux

which would match LINux for instance.

Is there anything like that for Eshell? From what I know Eshell doesn't have a support for something like Zsh's "globbing tags", but do you know if there is an Eshell predicate for case-insensitive matching? If there isn't, do you have any suggestion of how to define a predicate in Eshell to do that?

Thanks!

falsum
  • 349
  • 1
  • 7

2 Answers2

9

(setq eshell-glob-case-insensitive t) Does not work.

(setq eshell-cmpl-ignore-case t) This works. Put it in your .emacs or .emacs.d/init.el.

Rudolf Adamkovič
  • 31,030
  • 13
  • 103
  • 118
flyrain
  • 573
  • 6
  • 11
0

You can set the variable eshell-glob-case-insensitive to true to enable case-insensitive globbing in eshell.

Luke Girvin
  • 13,221
  • 9
  • 64
  • 84
  • Thanks! I've missed this variable. Just a sidenote. With Zsh, if you put the `(#i)` flag at the beginning of the path like `(#i)/Doc/` Zsh will search for `DOC`, `DoC`, etc. But because you can also use the flag in the middle of your search pattern, Zsh allows you to decrease the number of matches the shell will look for -- which may speed up the matching process. For this reason, I think it would be nice if eshell would have something like Zsh flags. But maybe I'm just complaining too much :) – falsum Sep 05 '11 at 10:56