¹ https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#...
² https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#...
¹ https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#...
² https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#...
prompt> some-word[up key]
will search for some-word in the history.this feature helps because in 90% of cases i can type some-word and have autosuggestion show me the right command, so i just need to hit right arrow and enter to run it. but, if the suggestion is wrong, i can instead hit up arrow and search for a another history entry.
in zsh currently, i can get autosuggestions, but if the suggestions is wrong, i have to type ctrl-A and retype some-word in order to search the history. i want to be able to do that without retyping, the way it is done in fish.
elvish only has the uparrop feature which gets me there halfway, i can type something, and then hit uparrow to find a matching command. in most cases the first hit is the one i want, but if not i keep searching.
i prefer to also have the autosuggestion because often i don't remember that i have a similar command already, and the autosuggestion provides that hint.
together these are the two most useful features that i want from a shell.
If you also need to mimic the fish behaviour of C-r mid-command because your suggestion wasn't correct, then that does need a custom function to bind to C-r as you have to provide ${L,}BUFFER to populate the search pattern like fish does.