|
@@ -7,24 +7,31 @@
|
|
|
#include "keybind.h"
|
|
#include "keybind.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+#define AAGK app_add_global_keybind
|
|
|
|
|
+
|
|
|
void config(struct app *app);
|
|
void config(struct app *app);
|
|
|
void config(struct app *app) {
|
|
void config(struct app *app) {
|
|
|
- /* app_add_global_keybing(app, "C-u", keybing_universal_cmd, -1); */
|
|
|
|
|
- app_add_global_keybind(app, "C-d", keybind_delete_char, DIR_FORWARD);
|
|
|
|
|
- app_add_global_keybind(app, "A-d", keybind_delete_word, DIR_FORWARD);
|
|
|
|
|
|
|
+ AAGK(app, "<left>", keybind_mv_cur_char, DIR_BACKWARD);
|
|
|
|
|
+ AAGK(app, "<down>", keybind_mv_cur_line, DIR_FORWARD);
|
|
|
|
|
+ AAGK(app, "<up>", keybind_mv_cur_line, DIR_BACKWARD);
|
|
|
|
|
+ AAGK(app, "<right>", keybind_mv_cur_char, DIR_FORWARD);
|
|
|
|
|
+
|
|
|
|
|
+ AAGK(app, "C-k", keybind_delete_to_edg_line, DIR_FORWARD);
|
|
|
|
|
|
|
|
- app_add_global_keybind(app, "C-e", keybind_mv_cur_end_line, DIR_NO);
|
|
|
|
|
- app_add_global_keybind(app, "C-a", keybind_mv_cur_beg_line, DIR_NO);
|
|
|
|
|
- app_add_global_keybind(app, "A-b", keybind_mv_cur_word, DIR_BACKWARD);
|
|
|
|
|
- app_add_global_keybind(app, "A-f", keybind_mv_cur_word, DIR_FORWARD);
|
|
|
|
|
|
|
+ AAGK(app, "C-d", keybind_delete_char, DIR_FORWARD);
|
|
|
|
|
+ AAGK(app, "A-d", keybind_delete_word, DIR_FORWARD);
|
|
|
|
|
|
|
|
- app_add_global_keybind(app, "C-s", keybind_save_buffer, DIR_NO);
|
|
|
|
|
|
|
+ AAGK(app, "C-e", keybind_mv_cur_edg_line, DIR_FORWARD);
|
|
|
|
|
+ AAGK(app, "C-a", keybind_mv_cur_edg_line, DIR_BACKWARD);
|
|
|
|
|
+ AAGK(app, "A-b", keybind_mv_cur_word, DIR_BACKWARD);
|
|
|
|
|
+ AAGK(app, "A-f", keybind_mv_cur_word, DIR_FORWARD);
|
|
|
|
|
+
|
|
|
|
|
+ AAGK(app, "C-s", keybind_save_buffer, DIR_NO);
|
|
|
|
|
|
|
|
char *k = calloc(sizeof(char), 2);
|
|
char *k = calloc(sizeof(char), 2);
|
|
|
for ( char c = 32; c < 127; ++c) {
|
|
for ( char c = 32; c < 127; ++c) {
|
|
|
k[0] = c;
|
|
k[0] = c;
|
|
|
- app_add_global_keybind(app, k,
|
|
|
|
|
- keybind_insert_last_pressed_key, DIR_NO);
|
|
|
|
|
|
|
+ AAGK(app, k, keybind_insert_last_pressed_key, DIR_NO);
|
|
|
}
|
|
}
|
|
|
/* app_add_global_keybind(app, "C-s", keybind_save_buffer, DIR_NO); */
|
|
/* app_add_global_keybind(app, "C-s", keybind_save_buffer, DIR_NO); */
|
|
|
/* app_add_mode_keybing(app, BUFFER_MODE_TEXT, "<delete>", */
|
|
/* app_add_mode_keybing(app, BUFFER_MODE_TEXT, "<delete>", */
|
|
@@ -35,6 +42,8 @@ void config(struct app *app) {
|
|
|
/* exit(1); */
|
|
/* exit(1); */
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+#undef AAGK
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
/* #define KEYBINDS_MAX_SIZE 1048 */
|
|
/* #define KEYBINDS_MAX_SIZE 1048 */
|