keybind for down-line-or-complete not working in zshrc #203
-
Environment
Please report if the bug occurs without config files: If not, gradually add lines from your config file to the subshell until the bug appears. Which combination of config causes the bug to appear? minimum config in ~/zshrc-test/.zshrc:
Steps to reproduce
Expected behaviorWhen tab is pressed, autocomplete if there is only one result. If there are more, tab scrolls through all the options instead. Actual behaviorPressing tab completes the first result, regardless of how many results there are. The only way to select a result is by pressing down, as is the default. I'd strongly prefer if tab didn't autocomplete when there are multiple results, but instead keep pressing tab (or typing) until I get the desired selection. And obviously I don't want to issue bindkey manually on every zsh instance :-) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
That’s already possible, as described in the Readme. Just add one (not both) of the following two lines to your # To use menu selection:
zstyle ':autocomplete:tab:*' widget-style menu-select
# To cycle completions without using menu selection:
zstyle ':autocomplete:tab:*' widget-style menu-complete |
Beta Was this translation helpful? Give feedback.
-
Hey, exactly what I want :-) Thanks for the help. However, I found that neither of these two zstyle options have an effect if I enter them in a shell (even with just the two-liner zshrc above), but only when I put them in zshrc. This threw me off, because I actually tried both options before (by issuing manually). |
Beta Was this translation helpful? Give feedback.
-
That’s a limitation of Zsh’s line editor. Changing that behavior at runtime would require swapping the widget. |
Beta Was this translation helpful? Give feedback.
That’s already possible, as described in the Readme. Just add one (not both) of the following two lines to your
~/.zshrc
file (depending on which type of behavior your prefer; see the linked section in the Readme for details):