From 191ba21e7029680ef8bd3c8bfaff890315d4bbd2 Mon Sep 17 00:00:00 2001 From: Matthias Meulien Date: Wed, 8 Sep 2021 21:57:48 +0200 Subject: [PATCH] Make Imenu index non-alphabetic mapping keys and anchors --- yaml-mode.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yaml-mode.el b/yaml-mode.el index 9d619d5..a136fb1 100644 --- a/yaml-mode.el +++ b/yaml-mode.el @@ -110,7 +110,8 @@ that key is pressed to begin a block literal." :group 'yaml) (defcustom yaml-imenu-generic-expression - '((nil "^\\(:?[a-zA-Z_-]+\\):" 1)) + '((nil "^\\(:?[^{}(),\s \n]+\\):" 1) + ("*Anchors*" "^\\s *[^{}(),\s \n]+: \\&\\([^{}(),\s \n]+\\)" 1)) "The imenu regex to parse an outline of the yaml file." :type 'string :group 'yaml)