From 6ccb9a3343a8eb0d37917da9cf1c6c54baffcf6c Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Mon, 15 Dec 2025 00:26:10 -0800 Subject: oni-eshell: Add imenu expression for prompts --- oni-eshell.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 ;; 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) -- cgit v1.3-2-g0d8e