Handling keys, events, etc.

Vim’s scripting language provides several mechanisms to automatically respond to various events, including.

All of these commonly involve either snippets of Vim script or references to Vim functions that take specific arguments. This is obviously clean and pretty easy using Vim script, but frankly quite tricky when you want (for example) to map a key sequence to some Python code.

But it can be done.

VPE provides reasonably clean, Pythonic mechanisms, which are covered in the following sections.

Timers are covered in the section Timers and deferred actions.