Question: This works
----------

Normally, `zsh`'s tab completion works well.

```
$ touch foo-1-bar foo-2-bar
$ touch f<Tab>
$ touch foo--bar
            ^ cursor here

```

Pressing `Tab` again brings up a menu from which I can select files.

```
$ touch foo--bar
foo-1-bar  foo-2-bar

```

This doesn't
------------

However, this doesn't seem to work with strings where the beginning and end match. For example:

```
touch foo-bar foo-foo-bar
touch f<Tab>
touch foo-bar
         ^ cursor here. <tab> again.
touch foo-bar
              ^ cursor here.

```

No menu is brought up, and there is no opportunity to select `foo-foo-bar`. Is this expected behaviour or a bug? Is there a setting to make a menu appear in the latter scenario?

I'm using `oh-my-zsh`. I attempted removing all the completion-related lines from `~/.zshrc`, but this made no difference.

Answer: 
As per the comments, I tried disabling `oh-my-zsh`, which fixed this problem. I then went through the `oh-my-zsh` source, selectively disabling modules.

I previously had `CASE_SENSITIVE="true"`, but commenting out this line fixed it for me. Apparently it's a [known bug](https://github.com/robbyrussell/oh-my-zsh/issues/1398).

To fix it, I could put the following line in `~/.zshrc` after sourcing `oh-my-zsh`.

```
zstyle ':completion:*' matcher-list 'r:|=*' 'l:|=* r:|=*'

```
Another option is setting COMPLETE\_IN\_WORD as described on the same page - <http://zsh.sourceforge.net/FAQ/zshfaq04.html#l50>.

```
setopt complete_in_word

```

This will try to fill in the word at the point of the cursor, and all the characters after the point of the cursor will be replaced with what is filled.