Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Down arrow key has no effect #21

Closed
romzie opened this issue May 9, 2020 · 7 comments
Closed

Down arrow key has no effect #21

romzie opened this issue May 9, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@romzie
Copy link

romzie commented May 9, 2020

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.

@marlonrichert
Copy link
Owner

Thanks for reporting this. This is one config permutation that I hadn’t considered. The Down key doesn’t do menu selection if you don’t 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’t have a way to enter menu selection.

I will fix this by making it so that, if you don’t use fzf, I will not override the Tab key behavior. I’ll let you know when I’ve pushed in a fix.

Apologies for the inconvenience!

marlonrichert added a commit that referenced this issue May 11, 2020
Address issue #21
marlonrichert added a commit that referenced this issue May 11, 2020
Address issue #21
@marlonrichert
Copy link
Owner

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

marlonrichert added a commit that referenced this issue May 11, 2020
Address issue #21
@romzie
Copy link
Author

romzie commented May 11, 2020

@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 !

@marlonrichert
Copy link
Owner

marlonrichert commented May 12, 2020

@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

marlonrichert added a commit that referenced this issue May 12, 2020
@marlonrichert
Copy link
Owner

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

marlonrichert added a commit that referenced this issue May 12, 2020
marlonrichert added a commit that referenced this issue May 12, 2020
marlonrichert added a commit that referenced this issue May 12, 2020
marlonrichert added a commit that referenced this issue May 12, 2020
marlonrichert added a commit that referenced this issue May 12, 2020
@romzie
Copy link
Author

romzie commented May 12, 2020

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 romzie closed this as completed May 12, 2020
marlonrichert added a commit that referenced this issue May 12, 2020
marlonrichert added a commit that referenced this issue May 12, 2020
marlonrichert added a commit that referenced this issue May 12, 2020
marlonrichert added a commit that referenced this issue May 12, 2020
marlonrichert added a commit that referenced this issue May 12, 2020
marlonrichert added a commit that referenced this issue May 12, 2020
@marlonrichert
Copy link
Owner

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

@marlonrichert marlonrichert added the bug Something isn't working label Mar 8, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants