zsh-users / zsh-autosuggestions

Fish-like autosuggestions for zsh
MIT License
31.11k stars 1.86k forks source link

Found a workaround to my problem in issue #594 but it breaks some other functionality #644

Closed iambeingtracked closed 2 years ago

iambeingtracked commented 2 years ago

I was using oh-my-zsh before, There the plugin worked right after i installed it. Now i got rid of it and i'm now sourcing it in the .zshrc file. So the navigation through arrows wasn't working. I found a fix in issue #594. It fixed the issue, but the behaviour of the shell changed. Now when i press the up arrow without typing anything, it shows the command i typed b4 but the cursor is in the start. I want the cursor to move to the end when i press the up arrow key. Also so that when i press the up arrow key without typing anything it just shows the previuos command and the cursor goes to the end. This is the solution from issue #594 that i've applied to .zshrc:

Fix zsh autosuggestions keybind for arrow keys

zle-line-init() {} bindkey '\e[A' history-beginning-search-backward bindkey '\e[B' history-beginning-search-forward

ericfreese commented 2 years ago

The history-beginning-search-* widgets are not actually related to this plugin and AFAIK there's no way to get the behavior you want with them moving the cursor to the end because they use the cursor position to determine the prefix to match previous command entries with. Maybe try stack overflow or sending an email to the zsh email list.