aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2025-12-15 00:26:10 -0800
committerGravatar Tom Willemse2025-12-15 00:28:16 -0800
commit6ccb9a3343a8eb0d37917da9cf1c6c54baffcf6c (patch)
treee5e1284dc61dcf75f8d72ab3dc3de4e84d302648
parent0eeb605b6bd938369847271826138ff987a8c437 (diff)
downloademacs-config-6ccb9a3343a8eb0d37917da9cf1c6c54baffcf6c.tar.gz
emacs-config-6ccb9a3343a8eb0d37917da9cf1c6c54baffcf6c.zip
oni-eshell: Add imenu expression for prompts
-rw-r--r--oni-eshell.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/oni-eshell.el b/oni-eshell.el
index 7a0e0c2..411f7ac 100644
--- a/oni-eshell.el
+++ b/oni-eshell.el
@@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
-;; Version: 2023.0414.233822
+;; Version: 2025.1215.002605
;; Package-Requires: (eshell-fringe-status esh-autosuggest xterm-color eshell-syntax-highlighting)
;; This program is free software; you can redistribute it and/or modify
@@ -93,6 +93,11 @@
"Change the page delimiter so that it matches the prompt for easy navigation."
(setq-local page-delimiter eshell-prompt-regexp))
+(defun oni-eshell-set-imenu-expression ()
+ "Set the local imenu expression for easy navigation between prompts."
+ (setq-local imenu-generic-expression
+ `(("Prompt" . ,eshell-prompt-regexp))))
+
(add-hook 'eshell-before-prompt-hook #'oni-eshell--set-xterm-variables)
(add-hook 'eshell-first-time-mode-hook #'oni-eshell--expand-keymap)
(add-hook 'eshell-load-hook #'oni-eshell--disable-ansi-color-handling)
@@ -100,6 +105,7 @@
(add-hook 'eshell-load-hook #'oni-eshell--enable-xterm-filter)
(add-hook 'eshell-mode-hook #'oni-eshell-change-font)
(add-hook 'eshell-mode-hook #'oni-eshell-disable-beacon-on-scroll)
+(add-hook 'eshell-mode-hook #'oni-eshell-set-imenu-expression)
(add-hook 'eshell-mode-hook #'oni-eshell-set-page-delimiter)
(add-hook 'eshell-mode-hook 'esh-autosuggest-mode)
(add-hook 'eshell-mode-hook 'eshell-syntax-highlighting-mode)