From dc16fe10e39f04ebb8e1bcf7f9befa19e9542fb6 Mon Sep 17 00:00:00 2001 From: StrawberryTea Date: Fri, 27 Oct 2023 23:23:39 -0500 Subject: [PATCH] feat(eshell): add imenu support --- modules/term/eshell/config.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/term/eshell/config.el b/modules/term/eshell/config.el index c3496ffe9..cf2beb9b2 100644 --- a/modules/term/eshell/config.el +++ b/modules/term/eshell/config.el @@ -105,6 +105,12 @@ You should use `set-eshell-alias!' to change this.") ;; cursor comes close to the left/right edges of the window. (setq-hook! 'eshell-mode-hook hscroll-margin 0) + ;; Recognize prompts as Imenu entries. + (setq-hook! 'eshell-mode-hook + imenu-generic-expression + `((,(propertize "λ" 'face 'eshell-prompt) + ,(concat eshell-prompt-regexp "\\(.*\\)") 1))) + ;; Don't auto-write our aliases! Let us manage our own `eshell-aliases-file' ;; or configure `+eshell-aliases' via elisp. (advice-add #'eshell-write-aliases-list :override #'ignore)