summary refs log tree commit diff stats
path: root/tag-emacs/emacs.d/init.el
diff options
context:
space:
mode:
Diffstat (limited to 'tag-emacs/emacs.d/init.el')
-rw-r--r--tag-emacs/emacs.d/init.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/tag-emacs/emacs.d/init.el b/tag-emacs/emacs.d/init.el
index 3c2cb60..49b0f07 100644
--- a/tag-emacs/emacs.d/init.el
+++ b/tag-emacs/emacs.d/init.el
@@ -1441,7 +1441,13 @@ symbol, not word, as I need this for programming the most."
   :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