marlonrichert / zsh-autocomplete

🤖 Real-time type-ahead completion for Zsh. Asynchronous find-as-you-type autocompletion.
MIT License
5.38k stars 148 forks source link

Make Autocomplete compatible with `grml-zsh-config` out of the box #505

Closed marlonrichert closed 1 year ago

marlonrichert commented 2 years ago

Discussed in https://github.com/marlonrichert/zsh-autocomplete/discussions/504

Originally posted by **chrisr87** October 30, 2022 I installed grml-zsh-config with all defaults and zsh-autocomplete with all defaults and when I press `tab`, a list of directories (or commands, depending on what it was trying to complete) flash and then disappears. Anyone have an idea on how to fix this or is zsh-autocomplete just not compatible with grml-zsh-config out of the box?

The full Grml Zsh config can be found at https://git.grml.org/?p=grml-etc-core.git;a=blob_plain;f=etc/zsh/zshrc;hb=HEAD

unawarez commented 1 year ago

I was just debugging this myself and found this issue. Commenting this line fixed it for me: https://github.com/grml/grml-etc-core/blob/a2cda85d3d56fd5f5a7b954a444fd151318c4680/etc/zsh/zshrc#L796

        # if there are more than 5 options allow selecting from a menu
        zstyle ':completion:*'               menu select=5
marlonrichert commented 1 year ago

@unawarez Is this still an issue with the latest version of the main branch?

chrisr87 commented 1 year ago

@unawarez Is this still an issue with the latest version of the main branch?

Still an issue for me with the defaults. @unawarez's suggestion didn't work for me. Only thing that gets Tab or ↓ to work is changing this complete-word to menu-select here: https://github.com/marlonrichert/zsh-autocomplete/blob/5cc9da132e7535a540fb1235ce27fd5a233d4f0e/.zshrc#L61

marlonrichert commented 1 year ago

@chrisr87 Can you update and try again if this is still an issue?

chrisr87 commented 1 year ago

@chrisr87 Can you update and try again if this is still an issue?

Works now after updating. Thanks!

chrisr87 commented 1 year ago

Actually, now I can't leave history mode. Once I trigger history one time with ↑, even after exiting the history menu, ↓ triggers history again instead of autocomplete. tab is able to reset it, which inserts the first option and seems to get me out of history mode.

chrisr87 commented 1 year ago

Also randomly spamming this error, haven't tried to debug yet,

.autocomplete.up-line-or-search.zle-widget:6: scalar parameter _p9k__i set in enclosing scope in function .autocomplete.up-line-or-search.zle-widget`

Possibly conflicting with Powerlevel10k

marlonrichert commented 1 year ago

@unawarez @chrisr87 I tested it with the current main branch and it works without problems if you source Autcomplete in .zshrc.pre or .zshrc.local. The end result is slightly different, but both work.

Actually, now I can't leave history mode. Once I trigger history one time with ↑, even after exiting the history menu, ↓ triggers history again instead of autocomplete. tab is able to reset it, which inserts the first option and seems to get me out of history mode.

That's an unrelated bug, but has been fixed, too: 584bcbac7aca914e32cd67bf20ba0f3f38f44d17

marlonrichert commented 1 year ago

@unawarez @chrisr87 PS: If you enjoy using my software, please consider sponsoring me. 🙂