oantolin / completing-history

Insert history items with completion
GNU General Public License v3.0
7 stars 1 forks source link

This package provides a command =completing-history-insert-item= to insert an item from history using completion. It calls =completing-read= to do this, meaning it will work with your preferred completion framework. The package supports: the minibuffer, eshell, comint and term.

There is also a function =completing-history-setup-keybinding= to setup a keybinding for you in all supported contexts. By default it binds =completing-history-insert-item= to =M-r= (usually bound to a command that gets the previous history item matching a regexp) and unbinds the companion =M-s= command (usually bound to a command that searches forward in the history).

To customize the binding of =completing-history-insert-item=, use =completing-history-binding=. To keep =M-s= from being unbound customize =completing-history-unbind-M-s=.

Sorry, there are no plans to put this on MELPA.

If you prefer packages on MELPA, you can use the =consult-history= command from [[https://github.com/minad/consult][Consult]] instead of the =completing-history-insert-item= command from this package. By design, Consult does not setup any key bindings for you. You can get the effect of =(completing-history-setup-keybinding)= by binding =consult-history= to =M-r= and unbinding =M-s= in each of the following keymaps: