zsh-users / zsh-autosuggestions

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

Support ctrl-n and ctrl-p has similar function as down key and up key #609

Open Patrick0308 opened 3 years ago

Patrick0308 commented 3 years ago

Is your feature request related to a problem? Please describe.

I like get next or pervious history command by using ctrl-n and ctrl-p. I believe many people just like me. But it can not automatically complete the command currently entered.

Describe the solution you'd like

supporting ctrl-n and ctrl-p has similar function as down key and up key

bigwheel commented 3 years ago

~Totaly agree. I was very confused this behavior change and Im disabling zsh-autosuggestions.~

Im inpecting this. I thought this change caused by 0.7.0 release but 0.6.4 has same behavior. I doubt of other zsh plugins.

ericfreese commented 3 years ago

Hi, if I'm understanding you correctly, it sounds like you're requesting the same functionality as #192, #409, #533.

Do the history-beginning-search-forward and history-beginning-search-backward widgets work for you? I personally like to bind them to ctrl+n and ctrl+p:

% bindkey | grep 'history-beginning'
"^N" history-beginning-search-forward
"^P" history-beginning-search-backward
Patrick0308 commented 3 years ago
bindkey "^P" history-beginning-search-backward
bindkey "^N" history-beginning-search-forward

It's work for me. Thanks @ericfreese.

sehirger commented 9 months ago

bindkey | grep 'history-beginning'

Hello, for example, after entering the header part such as $ ls -a -al .... , there are many commands that can be keep $ lsselect current $ ls -al. Is there any shortcut key or solution?