can zsh do 2 stage completion?
You should explore the compinstall
completion customization program.
autoload -Uz compinstall && compinstall
In the version that I am using (zsh 4.3.10), the option for inserting unambiguous prefixes is inside the following menu
-
3 “Styles for changing the way completions are displayed and inserted.”
-
2 “Change how completions are inserted: …”
-
1 “… insert any unambiguous prefix rather than [going] straight to menu completion”
- y
-
1 “… insert any unambiguous prefix rather than [going] straight to menu completion”
-
2 “Change how completions are inserted: …”
Once saved, this results in the following command saved to the completion customization file (usually .zshrc
):
zstyle ':completion:*' insert-unambiguous true
-
3 “Styles for changing the way completions are displayed and inserted.”
-
3 “Configure … completion lists, selection of items, …”
-
2 “Use cursor keys to select completions from completion lists.”
- 1
- Return
-
2 “Use cursor keys to select completions from completion lists.”
-
3 “Configure … completion lists, selection of items, …”
Once saved, this results in the following customization:
zstyle ':completion:*' menu select=1
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
You might like to customize the first one by adding interactive
:
zstyle ':completion:*' menu select=1 interactive