4

Currently, when I hit TAB, and there's more than one option to autocomplete, zsh will show all of them. If I hit TAB a second time, it will pick the first.

I'd like to change this to:

  1. First TAB: Do nothing if there are more than one option
  2. Second TAB: Show the list
  3. Third TAB: pick the first

Is that possible?

(Why? When I hit tab, it's usually because I think what I typed was unambiguous. If it's not, I want to stop for a second and look back before getting the list.)

In addition, how do I turn on menu-based completion (where I can choose the choices from a menu)?

2 Answers 2

0

in ~/.zshrc

unsetopt BASH_AUTO_LIST

With BASH_AUTO_LIST set, the list only appears the second time you hit tab on an ambiguous completion.

Take a look at Ambiguous completions section for more options

2
  • Will this work for zsh? The question was about zsh autocomplete Apr 16, 2019 at 16:55
  • Tested. This does not work for me. Apr 16, 2019 at 16:57
0

This is an old question, but still comes up in google. I didn't find a way to complete the ambiguous name only on the third tab, but I did find that you can turn off ambiguous completion completely using:

setopt no_auto_menu
setopt no_menu_complete

Run 'setopt' by itself to show what's currently set. It works with both uppercase and lowercase and with or without the underscores.

To turn something off, prepend "no".

This doc has details on the options for ambiguous name completion. https://zsh.sourceforge.io/Guide/zshguide06.html#l147

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .