title: Have zsh return case-insensitive auto-complete matches, but prefer exact matches
body: <p>I am using zsh with oh-my-zsh's rc file and there is some behavior I find particularly annoying. By default, oh-my-zsh is configured to return case-insensitive matches when auto-completing. This behavior is sometimes good, but other times it really sucks. Is there a way I can configure zsh to only use case-insenstive matching when there are no case-sensitive matches?</p>
  
  <p>For instance, this case would use case-sensitive matching:</p>
  
  <pre><code>&gt; ls
  LICENSE.txt    lib/
  &gt; emacs l &lt;-- should autocomplete to lib/
  </code></pre>
  
  <p>In this case, case-insensitive auto-completion would happen:</p>
  
  <pre><code>&gt; ls
  README    lib/
  &gt; emacs r &lt;-- should autocomplete to README
  </code></pre>
  
  <p>Thanks!</p>