Add extra items into existing imenu items generated by major/minor modes. For example, extra items could be appended into existing imenu items generated by lsp-mode and js2-mode. Set up, At the end of minor/major mode hook, call `imenu-extra-auto-setup' which has one parameter "patterns". Patterns should be an alist of the same form as `imenu-generic-expression'. For example, insert below code to `js2-mode-hook' to extract unit test cases from javascript code. (add-hook 'js2-mode-hook (lambda () (require 'imenu-extra) (imenu-extra-auto-setup '(("tdd.it" "^[ \t]*it('\\([^']+\\)" 1) ("tdd.desc" "^[ \t]*describe('\\([^']+\\)" 1)))) Usage, Use imenu as usual.