When I am using zsh (default installation of oh-my-zsh) and press Tab it auto-completes the path which is very useful.

If there is only one candidate the auto-completion system just add the candidate to the path you're currently typing, as expected!

But if there are more than one candidate it displays a list below the PS for you to see, from here you have two choices:

  1. You see one item in the list that matches your intention, you start typing the first letters and tab again to autocomplete the full word.

  2. You tab directly after the list appears and then you can use the navigation keybindings to select an item in the list and then press enter to append the selected item in the current path you're typing.

In the second case you've pressed Tab two times in a row, the second Tab to enter the navigation mode.

Is there a way to tell zsh to directly enter the navigation list, in other words to highlight the first item if there is a list of choices?

  • 1
    Possibly just a matter of doing set -o menucomplete. See info zsh menucomplete for details. – Stéphane Chazelas Jan 24 at 17:32
  • @StéphaneChazelas merci – vdegenne Jan 24 at 17:40

There is a pretty simple way to achieve this. I don't know oh-my-zsh, but I know this issue.
It's as simple as including zstyle '*' single-ignored complete somewhere in your shell config, preferably after your oh-my-zsh config gets loded. Hope this helps!

| improve this answer | |
  • I tried to include that in my ~/.zshrc after the oh-my-zsh sourcing but it has no effect even I restart the shell. Any others ideas ? (thx btw) – vdegenne Jan 24 at 11:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.