[Grml] zsh history completion via arrow keys
John
da_audiophile at yahoo.com
Wed Jan 23 21:37:54 CET 2013
> Heh. Sorry for not reading your first posting thoroughly enough.
>
> From the zshcontrib(1) manual:
>
> up-line-or-beginning-search, down-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-beginning-search-backward and
> -forward, rather than the first word on the line.
>
> So, you'd probably need something along the lines of this:
>
> autoload -Uz up-line-or-beginning-search
> autoload -Uz 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
OK! I placed those 6 lines in my ~/.zshrc.local and resourced the config file. The key mapping seems intact:
% bindkey '"^[[A" up-line-or-beginning-search
But if I attempt to use the uparrow now, I get:
% vim ~/ :(
No such widget `up-line-or-beginning-search'
You thoughts are welcomed and thank you.
More information about the Grml
mailing list