Case-insensitive matching with Eshell?
Asked Answered
N

2

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!

Norahnorbert answered 3/9, 2011 at 11:47 Comment(0)
T
0

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

Trochelminth answered 3/9, 2011 at 12:17 Comment(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 :)Norahnorbert
B
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.

Bouffant answered 5/2, 2014 at 6:12 Comment(1)
May I ask, what is the purpose of (setq eshell-glob-case-insensitive t) in emacs?Plight
T
0

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

Trochelminth answered 3/9, 2011 at 12:17 Comment(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 :)Norahnorbert

© 2022 - 2024 — McMap. All rights reserved.