Zsh-autocomplete: Down arrow key has no effect

Created on 9 May 2020  路  7Comments  路  Source: marlonrichert/zsh-autocomplete

Just cloned this repo and added it to my zsh config (with oh-my-zsh).
All seems to work fine (I don't have fzf installed), except the Down arrow key that has no effect. So I basically have no opportunity to navigate through proposals.
I tried commenting all my other zsh plugins but same issue.

My zshrc : here.

Also it would be nice to be able to enable/disable some key bindings.
For example I would gladly disable the Tab that selects first choice to keep the zsh behavior of hitting Tab twice to enter the suggestion grid.

All 7 comments

Thanks for reporting this. This is one config permutation that I hadn鈥檛 considered. The Down key doesn鈥檛 do menu selection if you don鈥檛 use fzf, because then you need the Down key to go forward when doing history search. However, I failed to realize that then you don鈥檛 have a way to enter menu selection.

I will fix this by making it so that, if you don鈥檛 use fzf, I will not override the Tab key behavior. I鈥檒l let you know when I鈥檝e pushed in a fix.

Apologies for the inconvenience!

@romzie I pushed in a fix. Please update and try it out.

@marlonrichert Okay just pulled and tested it. Here is my feedback :

  • pressing tab activates completion or triggers the grid list of suggestions as expected
  • pressing tab a second time enters the suggestions list as expected
  • once inside the suggestions list, using arrow keys and enter to select works as expected
  • but if I want to use the tab key to cycle through the suggestions, it messes up as seen here (pressing tab writes a space and re-write all the path until the next element of the list, more clear on the video).

Thanks for the quick reply !

@romzie This behavior is entirely intentional on my part and not a bug. It is exactly as specified in the Readme under "Key bindings in the completion menu". 馃檪

Since you can already move around in the menu using the arrow keys, zsh-autocomplete uses the Tab key to insert multiple selections without leaving the menu. To insert only one and exit immediately, press Return instead. It works this way in fzf, too, when you have multi-select enabled.

If you want to disabled this, just add the following to your .zshrc file _after_ sourcing zsh-autocomplete:

bindkey -M menuselect $key[Tab] menu-complete

Oh, and if you want Shift-Tab to cycle in the opposite direction while in the menu, rather than show more completions/info, add the following:

add-zle-hook-widget -d line-init _zsh_autocomplete__h__keymap-specific_keys
bindkey -M menuselect $key[BackTab] reverse-menu-complete

Well you got me there, I did not read enough of the README.

Thank you for adding those additionnal key binding choices to the README.
If I may be a little picky, I would prefer having custom variables to trigger those key bindings instead of those difficult-to-understand lines, but that's up to you.

Closing this issue, keep up the great job! Love this plugin now btw.

@romzie I added more info to the Readme on how to customize the behavior of zsh-autocomplete. Hopefully that helps. 馃檪

Was this page helpful?
0 / 5 - 0 ratings

Related issues

weilbith picture weilbith  路  7Comments

windowswithoutborders picture windowswithoutborders  路  6Comments

daxmc99 picture daxmc99  路  3Comments

jcassee picture jcassee  路  7Comments

cenk1cenk2 picture cenk1cenk2  路  3Comments