mirror of
https://github.com/SqrtMinusOne/eshell-atuin.git
synced 2025-12-10 20:33:04 +03:00
readme: add filter mode
This commit is contained in:
parent
1e0e2503b5
commit
256982e335
2 changed files with 22 additions and 4 deletions
13
README.org
13
README.org
|
|
@ -60,6 +60,19 @@ Enable =eshell-atuin-mode= to turn on storing eshell commands in =atuin=.
|
|||
|
||||
Run =eshell-atuin-history= inside an =eshell= buffer to browse the saved history. Accepting the completion will insert the command.
|
||||
|
||||
** Filter mode
|
||||
=atuin= supports 4 [[https://docs.atuin.sh/configuration/config/#filter_mode][filter modes]]: global (default), host, session, directory. Default filter mode for =eshell-atuin= can be set as follows:
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(setq eshell-atuin-filter-mode 'global)
|
||||
#+end_src
|
||||
|
||||
In order to switch the mode at runtime, run =M-x eshell-atuin-history= with the prefix argument:
|
||||
- =C-u 0 M-x eshell-atuin-history= for =global=
|
||||
- =C-u 1 M-x eshell-atuin-history= for =host=
|
||||
- =C-u 2 M-x eshell-atuin-history= for =session=
|
||||
- =C-u 3 M-x eshell-atuin-history= for =directory=
|
||||
|
||||
* Implementation notes
|
||||
I may have overengineered the package a bit to scale on lots of records.
|
||||
|
||||
|
|
|
|||
|
|
@ -132,10 +132,15 @@ include here. Some examples:
|
|||
:group 'eshell-atuin
|
||||
:type '(choice
|
||||
(const nil :tag "Use default filter")
|
||||
(const 'global :tag "All hosts, all sessions, all directories")
|
||||
(const 'host :tag "History just from this host")
|
||||
(const 'session :tag "History just from this session")
|
||||
(const 'directory :tag "History just from this directory")))
|
||||
(const global :tag "All hosts, all sessions, all directories")
|
||||
(const host :tag "History just from this host")
|
||||
(const session :tag "History just from this session")
|
||||
(const directory :tag "History just from this directory"))
|
||||
:set
|
||||
(lambda (sym value)
|
||||
(set-default sym value)
|
||||
(when (fboundp #'eshell-atuin--history-rotate-cache)
|
||||
(eshell-atuin--history-rotate-cache))))
|
||||
|
||||
(defvar-local eshell-atuin--history-id nil
|
||||
"Atuin ID of the current eshell command.")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue