First, let me go through a specific case and then explain the general case.
Suppose I have two directories A and B.
The contents of A are:
The contents of B are
I would like tab completion of 'f' or 'F' in A to expand to 'foo'. Likewise 'b' or 'B' to go to 'Bar'.
However in B I want completion of 'f' to only expand to 'foobar' and 'F' to only expand to 'Foobar'.
More generally, tab completion should be case insensitive iff the letter that is being completed on has exactly one case when matched.
Note that there is
set completion-ignore-case on I can put into my '.inputrc' file, but this does not work as I want in the case of my hypothetical directory B.