diff --git a/gists.org b/gists.org index d696212..5801d33 100644 --- a/gists.org +++ b/gists.org @@ -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 diff --git a/gists/outline-minor-mode-eshell.el b/gists/outline-minor-mode-eshell.el new file mode 100644 index 0000000..2b002c8 --- /dev/null +++ b/gists/outline-minor-mode-eshell.el @@ -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))