Add suggestion to use outline-minor-mode in Eshell

This commit is contained in:
Bram Schoenmakers 2023-01-01 07:52:46 +01:00
parent 70d0ed7b5e
commit 2495767296
2 changed files with 21 additions and 0 deletions

View File

@ -315,6 +315,20 @@ My vertico-repeat setup.
(f "This does not work."))
#+end_src
* Use outline-minor-mode with eshell :emacs:eshell:
Found [[https://www.reddit.com/r/emacs/comments/e2u5n9/comment/f918t22/][a Reddit comment]] suggesting to assign the prompt regexp to the outline regexp. Here's the corresponding =use-package= syntax:
#+begin_src elisp :tangle gists/outline-minor-mode-eshell.el
;; use C-c @ C-t to get a foldable shell history
(use-package eshell
:config
(add-hook 'eshell-mode-hook
(lambda () (setq-local outline-regexp eshell-prompt-regexp)))
:hook
(eshell-mode . outline-minor-mode))
#+end_src
* Meta
** License

View File

@ -0,0 +1,7 @@
;; use C-c @ C-t to get a foldable shell history
(use-package eshell
:config
(add-hook 'eshell-mode-hook
(lambda () (setq-local outline-regexp eshell-prompt-regexp)))
:hook
(eshell-mode . outline-minor-mode))