Emacs: Add imenu navigation for restclient files
Alan Pearce alan.pearce@spotcap.com
Thu, 11 Jun 2015 15:38:59 +0200
1 files changed, 7 insertions(+), 1 deletions(-)
jump to
M tag-emacs/emacs.d/init.el → tag-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