1

I have completion menu configured in my zsh. It works great, no problem.

Now I want to make my zsh act like that:

Let's say there are 3 files in a directory:

  1. somefile_first
  2. somefile_second
  3. somefile_third

Now when I press [TAB], I get completion menu with the first file placed in the command line. But I want zsh to complete the common part of file names (in this example it would be somefile_), do not place anything else after the common part, and let me navigate through completion menu.

How do I do that?

blackst0ne
  • 681
  • 6
  • 22

1 Answers1

1

I realize this question is old but I stumbled upon it when looking for the same answer. Here is what I found out.

AFAIK when using completion menu zsh will always place highlighted completion in the command line. However you can make it less hasty.

unsetopt menucomplete
setopt automenu

Changes the behaviour so

  • first TAB completes the common part
  • second lists completions without changing command line
  • third starts the menu and completes command line with highlighted completion

If you prefer no command line changes than fancy menu unset automenu too:

unsetopt menucomplete automenu

That gives bash-like completion. Only common part is completed and propositions are listed.

pan-mroku
  • 803
  • 6
  • 17