3

When writing elisp for evil mode, how can you check the currently active evil state?
(normal, visual, insert... etc)

8

The state can be accessed via evil-state, eg:

(cond
 ((eq evil-state 'visual) (do-something))
 ((eq evil-state 'normal) (do-other-thing))
 ((eq evil-state 'insert) (do-another-thing)))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.