evil-qemacs/plugins/my_plugin.c
Charlie Gordon a6db66f470 Add command descriptions
- improve command definitions
- add descriptions for most commands
- bumped version to 5.3.2b
2022-08-18 01:33:00 +02:00

26 lines
555 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, "*",
"Insert the string Hello world\\n")
};
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);