Add imenu support for markdown-mode.
This commit is contained in:
parent
97bab294cc
commit
91a4c94730
2 changed files with 19 additions and 0 deletions
1
init.el
1
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)
|
||||
|
|
18
modules/prelude-markdown.el
Normal file
18
modules/prelude-markdown.el
Normal file
|
@ -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)
|
Loading…
Reference in a new issue