-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
I'd like to do my matching using the following alternative "smart-case" algorithm, call it "letter-wise smart-case":
A capital letter in needle matches an upper case letter, while lower case letters match both upper- and lower-case letters. This essentially says "I want upper case letters to match upper case but don't care about the case of the rest".
Zsh supports this kind of matching with
zstyle ':completion:*' matcher-list 'm:{[:lower:]}={[:upper:]}'
This is slightly different to the currently implemented CaseMatching::Smart(call it "global smart-case") where a lower-case letter does not match an upper-case letter if there is a capital letter present in the search term.
Compare how different search terms match against fooBAR:
| Algo | oba | oBA | oBa | OBa |
|---|---|---|---|---|
| global | yes | yes | no | no |
| letter-wise | yes | yes | yes | no |
(the difference is for oBa)
Related:nushell/nushell#16105
ysthakur and reneleonhardt
Metadata
Metadata
Assignees
Labels
No labels