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

Re: completing from history



On Jun 17,  4:08am, Andy Spiegl wrote:
} Subject: completing from history
}
} On Adam Spier's zsh page (http://www.new.ox.ac.uk/~adam/computing/zsh/) I
} found these lines in his .zsh
}  # {{{ Simulate my old dabbrev-expand 3.0.5 patch 
}  zstyle ':completion:*:history-words' stop 'verbose'
}  zstyle ':completion:*:history-words' remove_all_dups 'yep'
}  # }}}
} 
} But I must admit that I don't understand what I can do with it.

If you've got 3.1.9 installed, you can type <ESC /> or <ESC ,> to invoke
the _history-complete-older or _history-complete-newer bindings.  The
above styles control whether the search cycles through the history and
whether it ever offers duplicate words -- except that it should be
`remove-all-dups' with hyphens, not underscores, and the value `yep'
does not work, it has to be `yes' `true' `1' or `on'.  So Adam must not
be using the distributed version of _history_complete_word.

Oh, you do need to have run "compinit" to enable those bindings.

You can also add _history to your completer style like this:

	zstyle ':completion:*' completer _complete _history

to have the history searched when you hit TAB and regular completion does
not find anything.  (Or put it in front of _complete to have the history
tried first, but that's probably not what you want.)

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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