summaryrefslogtreecommitdiff
path: root/settings/setup-markdown-mode.el
blob: 0e68d1ca36eff64507b06c129939d8fb1cb9e199 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
(require '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-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.md' ." markdown-mode))

(autoload 'gfm-mode "markdown-mode"
  (add-to-list 'auto-mode-alist '("README\\.md]]'" .gfm-mode)))

(setq markdown-command "pandoc")

(add-hook 'markdown-mode-hook
	  (lambda ()
	    (setq imenu-generic-expression markdown-imenu-generic-expression)))

(provide 'setup-markdown-mode)