Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: History completion



tannhauser wrote:
> Hello everyone,
> 
> i remember, that someday command history completion worked this way for
> me:
> "cat l<arrow-up>" got me all variations that actually started with "cat
> l", like "cat lol" and so on. right now, i just get all old variations
> of "cat", the parameters are ignored.
> 
> i hope you get my point, my english ist kind of rusty at the moment.

There are two different commands:  history-beginning-search-backward is
what you want, history-search-backward is what you've got.

You need something like

bindkey '\e[A' history-beginning-search-backward
bindkey '\e[B' history-beginning-search-forward

assuming your arrow keys send the normal sequence (start a "read" command
and then type the key to check, then ^C).  (You can supposedly get this
information from "echotc" or "echoti" but they often lie.)

-- 
Peter Stephenson <pws@xxxxxxx>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


'member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom'



Messages sorted by: Reverse Date, Date, Thread, Author