Existe uma função documentada em zshcontrib
chamada up-line-or-beginning-search
, você pode ver isso executando.
man zshcontrib | less '+/^\s*up-line-or-beginning-search'
These widgets are similar to the builtin functions up-line-or-search and down-line-or-search: if in a multiline buffer they move up or down within the buffer, otherwise they search for a history line matching the start of the current line. In this case, however, they search for a line which matches the current line up to the current cursor position, in the manner of history-begin‐ ning-search-backward and -forward, rather than the first word on the line.
se você observar as instruções fornecidas na parte superior da seção ZLE FUNCTIONS
em man zshcontrib
Pessoalmente, eu segui as instruções acima, mas suspeito que hoje em dia você pode não precisar ... no seuZLE FUNCTIONS
Widgets
These functions all implement user-defined ZLE widgets (see zshzle(1)) which can be bound to keystrokes in interactive shells. To use them, your .zshrc should contain lines of the formautoload function
zle -N function
~/.zshrc
# register the function with the autoloader
autoload -U up-line-or-beginning-search
# define new zle widget
zle -N up-line-or-beginning-search
# bind UP key
[[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" up-line-or-beginning-search