How to bind keys only for History Menu? #678
-
I want to keep the default behaviors in zsh' history search, which is using I tried the solution in README.md, but this does not only modify the key binding in History Menu, but also in Completion Menu.
But this is not what I want. When I press I know I can change the behavior of I think the solution is to change key binding only for History Menu. Can it be done? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I figure out a solution, that is adding a wrapper to the two widgets, history-search and complete-word. The wrappers call I add this to my
However this solution is too ugly, and will break if the function names are changed. I'm looking forward to a better solution. |
Beta Was this translation helpful? Give feedback.
-
Yes, this is exactly what case me trouble as well. I've come to zsh from bash and I do like this history, BUT exactly as you told the needs of confirming command before I'm able to edit it somehow is really pain and switching next / previous one, when I hit the left/right and my intended command disappears, it drives me creasy too. This definitely makes sense to map like this by default (end history / search and start moving cursor in command prompt). |
Beta Was this translation helpful? Give feedback.
I figure out a solution, that is adding a wrapper to the two widgets, history-search and complete-word. The wrappers call
bindkey
every time the widgets are called.I add this to my
.zshrc
: