- use standard bindings string to all CMDx() definitions - remove CMDx() key and alt_key - remove compact key macros: KEY_CTRLX, KEY_CTRLXRET, KEY_CTRLH, KEY_CTRLC - removed qe_register_binding2, - qe_register_cmd_table() takes array length - remove CMD_DEF_END and CmdDef chaining - add CmdDefArray to store commands in const arrays - strtokeys() takes end pointer - add C-@ as name for null control key - removed many hacks in CmdDef handling - merge electric key commands - fix ~ minibuffer behavior - bumped version to 5.3.2
25 lines
513 B
C
25 lines
513 B
C
/*
|
|
* Simple plugin example
|
|
*/
|
|
#include "qe.h"
|
|
|
|
/* insert 'hello' at the current cursor position */
|
|
static void insert_hello(EditState *s)
|
|
{
|
|
s->offset += eb_insert_str(s->b, s->offset, "Hello world\n");
|
|
}
|
|
|
|
static const CmdDef my_commands[] = {
|
|
CMD2( "insert-hello", "C-c h",
|
|
insert_hello, ES, "*", "")
|
|
};
|
|
|
|
static int my_plugin_init(void)
|
|
{
|
|
/* commands and default keys */
|
|
qe_register_cmd_table(my_commands, countof(my_commands), NULL);
|
|
|
|
return 0;
|
|
}
|
|
|
|
qe_module_init(my_plugin_init);
|