exa icon indicating copy to clipboard operation
exa copied to clipboard

Feature Request: Option to view files sorted in a non-case-sensitive way

Open zv0n opened this issue 10 years ago • 2 comments

I (and possibly some other people) would it find very useful if there was an option to sort files that isn't case sensitive.

I have edited the options file so it would be possible when user creates sort field "nocaps" here - http://pastebin.com/pyKAqxpn

I would really appreciate it if you'd add it to the Master branch.

zv0n avatar Mar 06 '16 12:03 zv0n

Hey, @zv0n. (I think I recognise your name from somewhere, possibly relating to screenshots filled with lots of terminals.)

Anyway, I've taken a look at your code and I'll definitely add the functionality you want. However, I can't accept the exact code you've written, for Rust reasons: we shouldn't use to_ascii_lowercase when we can't assume ASCII; it might turn out that one uppercase character in a filename expands to two or more lowercase characters. We can also convert the string to lowercase lazily using the function provided in the natord crate, returning early without needing to lowercase the rest if the files differ early on.

I'm about to commit some code that adds a case-insensitive sort field with --sort=Name instead of name. I could do it for --sort=Ext too, now that I think about it. Anyway, would this work for you?

ogham avatar Mar 18 '16 14:03 ogham

Sounds great! Yeah, I do post/comment on screenshots with cool colored terminals :smiley: Thanks for taking the time and implementing this :)

zv0n avatar Mar 18 '16 17:03 zv0n