Hooks for entering and exiting Insert State in Evil

York Zhao gtdplatform at gmail.com
Mon Aug 1 18:48:02 CEST 2011


Hi Vegard,

Thanks a lot for this elaborative list, very useful.


York


On Mon, Aug 1, 2011 at 8:52 AM, Vegard Øye <vegard_oye at hotmail.com> wrote:
On 2011-07-31 21:21 +0200, York Zhao wrote:

> It seems to me that there are no hooks for entering and exiting
> Insert State in evil.

Evil provides entry and exit hooks for all of its states:

`evil-normal-state-entry-hook'                               [Variable]
Run when entering Normal state.

`evil-normal-state-exit-hook'                                [Variable]
Run when exiting Normal state.

`evil-insert-state-entry-hook'                               [Variable]
Run when entering Insert state.

`evil-insert-state-exit-hook'                                [Variable]
Run when exiting Insert state.

`evil-visual-state-entry-hook'                               [Variable]
Run when entering Visual state.

`evil-visual-state-exit-hook'                                [Variable]
Run when exiting Visual state.

`evil-replace-state-entry-hook'                              [Variable]
Run when entering Replace state.

`evil-replace-state-exit-hook'                               [Variable]
Run when exiting Replace state.

`evil-operator-state-entry-hook'                             [Variable]
Run when entering Operator-Pending state.

`evil-operator-state-exit-hook'                              [Variable]
Run when exiting Operator-Pending state.

`evil-motion-state-entry-hook'                               [Variable]
Run when entering Motion state.

`evil-motion-state-exit-hook'                                [Variable]
Run when exiting Motion state.

`evil-emacs-state-entry-hook'                                [Variable]
Run when entering Emacs state.

`evil-emacs-state-exit-hook'                                 [Variable]
Run when exiting Emacs state.

When these hooks are run, the variables `evil-next-state' and
`evil-previous-state' hold information about the states being
switched to and from.

`evil-next-state'                                            [Variable]
The state being switched to.

`evil-previous-state'                                        [Variable]
The state being switched from.

Finally, all states have a predicate function `evil-STATE-state-p'
which returns t when STATE is active. For example,
(evil-insert-state-p) will check whether the current state is
Insert state, and (evil-insert-state-p evil-previous-state)
will check whether the previous state was Insert state.

--
Vegard

_______________________________________________
implementations-list mailing list
implementations-list at lists.ourproject.org
https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ourproject.org/pipermail/implementations-list/attachments/20110801/fe0f721c/attachment.htm 


More information about the implementations-list mailing list