all repos — nixfiles @ 13290f1c8f69cf45f6c0b621f4bec96df8fd7301

System and user configuration, managed by nix and home-manager

Emacs: Add imenu navigation for restclient files

Alan Pearce
commit

13290f1c8f69cf45f6c0b621f4bec96df8fd7301

parent

5db8dd53007f8d008c6ad1884c5349b3ad69f898

1 file changed, 7 insertions(+), 1 deletion(-)

jump to
M tag-emacs/emacs.d/init.eltag-emacs/emacs.d/init.el
@@ -1441,7 +1441,13 @@ (req-package json-mode
:mode ("\\.json\\'" . json-mode)) (req-package restclient - :mode ("\\.api\\'" . restclient-mode)) + :mode ("\\.api\\'" . restclient-mode) + :config (progn + (defun imenu-restclient-sections () + (setq imenu-prev-index-position-function nil) + (add-to-list 'imenu-generic-expression '("Services" "^## ?\\(.+\\)$" 1) t) + (add-to-list 'imenu-generic-expression '("Calls" "^# ?\\(.+\\)$" 1) t)) + (add-hook restclient-mode-hook #'imenu-restclient-sections))) (req-package tern :config (progn