diff --git a/init.el b/init.el index 36bc73c..da51ca2 100644 --- a/init.el +++ b/init.el @@ -102,6 +102,7 @@ Emacs load path." (require 'prelude-js) (require 'prelude-latex) (require 'prelude-lisp) +(require 'prelude-markdown) (require 'prelude-mediawiki) (require 'prelude-org) (require 'prelude-perl) diff --git a/modules/prelude-markdown.el b/modules/prelude-markdown.el new file mode 100644 index 0000000..7f6167a --- /dev/null +++ b/modules/prelude-markdown.el @@ -0,0 +1,18 @@ +(prelude-ensure-module-deps '(markdown-mode)) + +(setq markdown-imenu-generic-expression + '(("title" "^\\(.*\\)[\n]=+$" 1) + ("h2-" "^\\(.*\\)[\n]-+$" 1) + ("h1" "^# \\(.*\\)$" 1) + ("h2" "^## \\(.*\\)$" 1) + ("h3" "^### \\(.*\\)$" 1) + ("h4" "^#### \\(.*\\)$" 1) + ("h5" "^##### \\(.*\\)$" 1) + ("h6" "^###### \\(.*\\)$" 1) + ("fn" "^\\[\\^\\(.*\\)\\]" 1))) + +(add-hook 'markdown-mode-hook + (lambda () + (setq imenu-generic-expression markdown-imenu-generic-expression))) + +(provide 'prelude-markdown)