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

Does not reset ↑ and ↓ properly #609

Closed jclusso closed 1 year ago

jclusso commented 1 year ago

The docs have this snippet for reseting the original functionaliy for the ↑ and ↓ arrows. This is not correct though. Typing the start of a previously typed command would result in you going back through commands that start with what you typed.

Example

ssh root@domain.com
htop
time
reset

Before If you started typing ssh and then hit ↑ you would jump to ssh@root@domain.com

After If you start typing ssh and then hit ↑ you will get reset.

https://github.com/marlonrichert/zsh-autocomplete/blob/203513d7047c330766833028d393d2a96a9b2c38/README.md?plain=1#L273-L286

jclusso commented 1 year ago

It appears I've found the solution which is switching to up-line-or-beginning-search and down-line-or-beginning-search. I don't have anything in my .zshrc that would change this. Should I make a PR to update the documentation?

marlonrichert commented 1 year ago

Typing the start of a previously typed command would result in you going back through commands that start with what you typed.

That's not the default behavior in Zsh. Just start your shell with zsh -f and try how it works.

Should I make a PR to update the documentation?

Sure, but then try to make the instructions generic, not specific to this particular case. Maybe point to the official docs.

jclusso commented 1 year ago

@marlonrichert I guess you're right. I'm not sure how to best document this because the documentation you linked doesn't have up-line-or-beginning-search or down-line-or-beginning-search. I've confirmed the default behaviour is what you said so I'm going to close this issue since that is my mistake. I'm assuming since I use ohmyzsh, it must be overriding the history commands somewhere.

marlonrichert commented 1 year ago

Those two are optional widgets that ship Zsh, which indeed OMZ binds to those keys. They are documented here: https://zsh.sourceforge.io/Doc/Release/User-Contributions.html#Widgets