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

Re: Completing strings from history?

> Typing `foo<ESC-/>' (bound to _history-complete-older) finds the most recent
> word in the history beginning "foo".  Typing <ESC-/> again appears to do
> nothing.
> Is it possible to set things up so that repeatedly typing <ESC-/> cycles back
> through all matches in the history?  (ala Emacs' dabbrev-expand)

You can do this by setting the `stop' style, which is so called because it
stops when it has reached as far back into the history as it can (unlike
normal menu completion which would continue cycling).

  zstyle ':completion:history-words:*' stop 1

You should also be able to turn on menu completion just in this context,
but I couldn't get that to work with a brief try, for some reason.

What doesn't work which probably ought to is that if you type `\e,'
(_history-complete-newer) it should cycle back in the other direction.
Probably nobody thought about it at the time.

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070

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