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!

2 Answers 2

10

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

1
  • May I ask, what is the purpose of (setq eshell-glob-case-insensitive t) in emacs?
    – Akari
    Commented Dec 7, 2023 at 14:41
0

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

1
  • 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
    Commented Sep 5, 2011 at 10:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.