[Grml] zsh history completion via arrow keys

Frank Terbeck ft at grml.org
Wed Jan 23 21:49:13 CET 2013


John wrote:
[...]
> But if I attempt to use the uparrow now, I get:
>
> % vim ~/
> No such widget `up-line-or-beginning-search'


Meh. This is what I get for not trying things out...

  autoload -Uz up-line-or-beginning-search
  zle -N up-line-or-beginning-search
  autoload -Uz down-line-or-beginning-search
  zle -N down-line-or-beginning-search
  bindkey '\eOA' up-line-or-beginning-search
  bindkey '\e[A' up-line-or-beginning-search
  bindkey '\eOB' down-line-or-beginning-search
  bindkey '\e[B' down-line-or-beginning-search

There seems to be a cosmetic bug that triggers the first time you use
either of those (if you got warn_create_global set, which I do):

up-line-or-beginning-search:15: scalar parameter __savecursor created globally in function
up-line-or-beginning-search:16: scalar parameter __searching created globally in function

you can do the following until you get a fixed up zsh version:

  typeset -g __savecursor __searching


Regards, Frank


More information about the Grml mailing list