Emacs:为所有 Lisp 缓冲区禁用特定的次要模式

Emacs: Disable a specific minor mode for all Lisp buffers

我想通过为后者处于活动状态的缓冲区禁用前者来避免 evil-mode and paredit 之间的冲突。

以下代码无效:

(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)

换句话说,如何为所有 Lisp 缓冲区自动禁用邪恶模式?

你可以只是建议 paredit-mode:

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

还有,你试过lispy了吗?这是我的 受 vi 启发的类似 Paredit 的软件包。它具有比 Paredit,如内联评估、区域操作和轮廓。