zsh-users / zsh-autosuggestions

Fish-like autosuggestions for zsh
MIT License
30.43k stars 1.85k forks source link

Up / Down Arrows to Cycle Historic Matches #646

Closed nixpulvis-aetion closed 2 years ago

nixpulvis-aetion commented 2 years ago

Much like fish shell's implementation, I would like to be able to quickly cycle through my history by prefix using the up and down arrow keys. This feature is really nice especially because I'm starting to use other history tools like https://github.com/cantino/mcfly which also work with the arrow keys in this way.

It's a pretty intuitive feature, so I would probably consider this to be a good candidate for the default configuration, unless it conflicts with another popular key binding I'm unaware of.

ericfreese commented 2 years ago

Do history-beginning-search-backward/history-beginning-search-forward work for you?

See https://github.com/zsh-users/zsh-autosuggestions/issues/192

nixpulvis-aetion commented 2 years ago

@ericfreese perfect, thanks for pointing me in the right direction. I've added the following to me ~/.zshrc and it's working as I desired now:

bindkey "^[[A" history-beginning-search-backward
bindkey "^[[B" history-beginning-search-forward

How would you feel about adding this to the default configuration when you source zsh-autosuggestions.zsh?

ericfreese commented 2 years ago

How would you feel about adding this to the default configuration when you source zsh-autosuggestions.zsh?

I'd like to keep it out of this plugin because not everyone likes to use those widgets. This plugin tries to just implement autosuggestions without having any broader opinions about how people should set up their config

nixpulvis-aetion commented 2 years ago

OK, fair enough.

Thanks again.