emacsevil-mode

Disabling evil-mode for Nav in Emacs? Or any read-only buffers?


I'm trying to get something like Nerd Tree in Emacs and found Nav, which is like the basic emacs file navigator, and it suits me.

The problem is, when I open Nav and switch to its buffer, evil-mode is still on and I have to press C-z if I want to use any Nav specific commands (e.g. . for nav-toggle-hidden-files). And it annoys me.

It's been a few hours I'm trying to fix that issue, by pasting

(require 'evil)
    (evil-mode 0)

everywhere in the Nav files, but obviously I'm doing it wrong.. And I'm pretty sure it will happen again while using other plugins.. How do I do that?


Solution

  • You want nav-mode buffers to open in Emacs state rather than in Evil's normal state. I don't know what nav-mode is actually called, but do the following, adjusting the name of the mode accordingly:

    (add-to-list 'evil-emacs-state-modes 'nav-mode)