Skip to content

Instantly share code, notes, and snippets.

@luxbock luxbock/clj-imenu.el
Last active Aug 29, 2015

Embed
What would you like to do?
clojure imenu support
(setq clojure-imenu-generic-expression
'((nil "^\\s-*(\\(?:s\\|t/\\)?defn-?\\s-+\\(?:\\^[^[:space:]\n]+\\s-+\\)?\\([^[:space:]\n]+\\)" 1)
("Variable""^\\s-*(\\(?:s\\|t/\\)?def[[:space:]\n]+\\(?:\\(?:\\^{[^}]+}[[:space:]\n]+\\)\\|\\(?:\\^:[^[:space:]\n]+\\s-+\\)\\)?\\([^[:space:]\n\)]+\\)" 1)
("Macro" "^\\s-*(defmacro\\s-+\\([^[:space:]\n]+\\)" 1)
("Record" "^\\s-*(\\(?:s/\\)?defrecord\\s-+\\([^[:space:]\n]+\\)" 1)
("Type" "^\\s-*(deftype\\+?\\s-+\\([^[:space:]\n]+\\)" 1)
("Protocol" "^\\s-*(\\(?:def\\(?:-abstract-type\\|interface\\+?\\|protocol\\)\\)\\s-+\\([^[:space:]\n]+\\)" 1)
("Multimethod" "^\\s-*(defmulti\\s-+\\([^[:space:]\n]+\\)" 1)
("Multimethod" "^\\s-*(defmethod\\s-+\\([^[:space:]\n]+\\)" 1)))
(eval-after-load "clojure-mode"
'(progn
(add-hook
'clojure-mode-hook
(lambda ()
(progn
(setq imenu-generic-expression clojure-imenu-generic-expression
imenu-create-index-function 'imenu-default-create-index-function))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.