2

I want to avoid conflicts between evil-mode and paredit by disabling the former for the buffers in which the latter is active.

The following code didn't work:

(add-hook 'emacs-lisp-mode-hook 'turn-off-evil-mode)
(add-hook 'lisp-mode-hook 'turn-off-evil-mode)
(add-hook 'lisp-interaction-mode-hook 'turn-off-evil-mode)
(add-hook 'inferior-lisp-mode-hook 'turn-off-evil-mode)
(add-hook 'clojure-mode-hook 'turn-off-evil-mode)
(add-hook 'scheme-mode-hook 'turn-off-evil-mode)
(add-hook 'ielm-mode-hook 'turn-off-evil-mode)
(add-hook 'eval-expression-minibuffer-setup-hook 'turn-off-evil-mode)

In other words, how to auto-disable evil-mode for all Lisp buffers?

krn
  • 6,715
  • 14
  • 59
  • 82

1 Answers1

3

You could just advice paredit-mode:

(defadvice paredit-mode (around paredit-disable-evil activate)
  (if paredit-mode
      ad-do-it
    (turn-off-evil-mode)
    ad-do-it))

Also, did you try lispy? It's my Paredit-like package that's inspired by vi. It has more features than Paredit, like inline-eval, region manipulation and outlines.

abo-abo
  • 20,038
  • 3
  • 50
  • 71
  • Lispy looks great! What features would I miss by replacing paredit-mode with lispy-mode? And how well can it coexist with evil-mode? – krn Jan 19 '15 at 18:06
  • You will lose no features. But it takes a different approach: you have to be at-paren for doing things, while with Paredit you are allowed to be anywhere inside the list. I think it can work if you are in the insert mode of evil. Some adaptation may be required. – abo-abo Jan 19 '15 at 18:09
  • 1
    A nice intro that I just published: http://oremacs.com/2015/01/19/lispy.0.21.0-is-out/ – abo-abo Jan 19 '15 at 18:19