forked from redguardtoo/emacs.d
/
init-smartparens.el
33 lines (26 loc) · 1.02 KB
/
init-smartparens.el
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
27
28
29
30
31
32
33
(defun my-smartparens-config ()
(smartparens-global-mode t)
;; highlights matching pairs
(show-smartparens-global-mode t)
(sp-local-pair 'minibuffer-inactive-mode "'" nil :actions nil)
;;; markdown-mode
(sp-with-modes '(markdown-mode gfm-mode rst-mode)
(sp-local-pair "*" "*" :bind "C-*")
(sp-local-tag "2" "**" "**")
(sp-local-tag "s" "```scheme" "```")
(sp-local-tag "<" "<_>" "</_>" :transform 'sp-match-sgml-tags))
;;; tex-mode latex-mode
(sp-with-modes '(tex-mode plain-tex-mode latex-mode)
(sp-local-tag "i" "1d5f8e69396c521f645375107197ea4dfbc7b792quot;<" "1d5f8e69396c521f645375107197ea4dfbc7b792quot;>"))
;;; html-mode
(sp-with-modes '(html-mode sgml-mode nxml-mode)
(sp-local-pair "<" ">"))
;;; lisp modes
(sp-with-modes sp--lisp-modes
(sp-local-pair "(" nil :bind "C-("))
)
(add-hook 'prog-mode-hook (lambda ()
(require 'smartparens-config)
(my-smartparens-config)
))
(provide 'init-smartparens)