Skip to content

Support alternative "letter-wise" smart case #80

@terrahornbeck378

Description

@terrahornbeck378

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions