Search code examples
emacsevil-mode

Disabling a package in emacs term-mode


I have a package (evil) that isn't playing nice with ansi-term. I am trying to have emacs disable evil-mode when term-mode is active. I am using the following command to try to do so

(add-hook 'term-mode-hook (lambda() (evil-mode -1)) )

However, this somehow disables evil mode in every mode except for term-mode once I open ansi-term. Any help would be appreciated.


Solution

  • I can't reproduce this on my setup (Emacs 24.3, latest Evil from MELPA). Try this:

    (add-hook 'term-mode-hook 'evil-emacs-state)
    

    or

    (add-hook 'term-mode-hook 'evil-insert-state)
    

    This works for me. (I usually use insert state because I can jump right into normal state quickly).