about summary refs log tree commit diff stats
path: root/emacs-prelude/personal/lisp/init-paredit.el
blob: 6eb20d8418695c8cefe36df47c2212631d188620 (plain) (blame)
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
(defun add-hooks (modes func)
 (dolist (mode modes)
  (add-hook (intern (concat (symbol-name mode) "-hook")) func)))

(setq lisp-modes
 '(scheme-mode emacs-lisp-mode lisp-mode clojure-mode cider-repl-mode
   eval-expression-minibuffer-setup ielm-mode lisp-interaction-mode))

(defun add-lisp-hook (func)
  (add-hooks lisp-modes func))

(prelude-require-package 'paredit)
(use-package paredit
  :diminish
  :bind (([remap mark-sexp] . sp-mark-sexp) ;; sp does this better!
         ("M-[" . paredit-wrap-square))
  :config
  (add-lisp-hook #'turn-off-smartparens-mode)
  (add-lisp-hook #'enable-paredit-mode))

(use-package paredit-functions
  :after paredit
  :ensure nil
  :load-path "~/.emacs.d/personal/lisp/paredit-functions.el")

(provide 'init-paredit)