When writing elisp for evil mode, how can you check the currently active evil state?
(normal
, visual
, insert
... etc)
Add a comment
|
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)))