emacs-evil / evil

The extensible vi layer for Emacs.
GNU General Public License v3.0
3.33k stars 282 forks source link

Disable evil states for a given major mode #1672

Open sasinhe opened 1 year ago

sasinhe commented 1 year ago

I'm having some problems when using pdf-tools along with evil, some commands don't work when in visual state. How can I disable visual state only on pdf-mode?

Issue type

Environment

Emacs version: 28.2 Operating System: Arch Linux Evil version: 1.15.0 Evil installation type: MELPA Graphical/Terminal: Graphical Tested in a make emacs session (see CONTRIBUTING.md): No

tomdl89 commented 1 year ago

Is this a duplicate of #1671 ?

sasinhe commented 1 year ago

I think it's the same problem, but while #1671 asks for a variable/extra function get implemented to prevent evil from entering 'visual-state' after a mouse-drag I just want to know how to disable visual state.

axelf4 commented 1 year ago

How can I disable visual state only on pdf-mode?

Just do not execute any commands that enter Visual state, either by unbinding or not typing them? I do not see the issue.

Or add an advice to evil-visual-state that errors if major-mode is some value.