helm-shell-history
is a helm frontend to bash history.
It comes with a fast c parser which you can compile by just running make
(make test
runs its tests).
You can configure it to use the fast parser by setting helm-shell-history-fast-parser
to point to the binary.
When the fast binary is not configured, it falls back on using the history
shell built-in to get the candidates.
Candidates are presented in recency order. The completion action is to insert the selected command at the end of the buffer
- Emacs 25.3 or higher
- Helm 1.9.9 or higher
mkdir -p ~/.emacs.d/lisp/helm-shell-history
git clone https://github.com/PalaceChan/helm-shell-history.git ~/.emacs.d/lisp/helm-shell-history
#to unlock much faster parsing of your history
(cd ~/.emacs.d/lisp/helm-shell-history/src && make)
A minimal configuration:
(use-package helm-shell-history
:load-path "~/.emacs.d/lisp/helm-shell-history/elisp"
:after term
:config
(define-key term-mode-map (kbd "M-r") 'helm-shell-history))
A much faster (recommended) configuration:
(use-package helm-shell-history
:load-path "~/.emacs.d/lisp/helm-shell-history/elisp"
:after term
:config
(setq helm-shell-history-fast-parser "~/.emacs.d/lisp/helm-shell-history/src/parse_history")
(define-key term-mode-map (kbd "M-r") 'helm-shell-history))
History file to use
Date/timestamp prefix to use when displaying candidates.
If you override this in a way that alters the count of displayed prefix tokens make sure to also update helm-shell-history-prefix-tokens
Tokens to skip when inserting selected command (the default of 3 corresponds to the default command number, date, and time)
Set to t
if you want fuzzy matching of candidates.
Limit the number of candidates to this number of most recent shell commands.
Point to the compiled binary for the fast parsing to unlock much faster parsing