From c0f1d73df3fef83cb6a60825c08620de0ded39d5 Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Wed, 7 Aug 2019 20:44:34 +0100 Subject: Make aliases smarter --- src/imv.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/imv.c') diff --git a/src/imv.c b/src/imv.c index d0467eb..40831fb 100644 --- a/src/imv.c +++ b/src/imv.c @@ -510,18 +510,12 @@ struct imv *imv_create(void) ); imv_command_register(imv->commands, "quit", &command_quit); - imv_command_register(imv->commands, "q", &command_quit); imv_command_register(imv->commands, "pan", &command_pan); imv_command_register(imv->commands, "next", &command_next); - imv_command_register(imv->commands, "n", &command_next); imv_command_register(imv->commands, "prev", &command_prev); - imv_command_register(imv->commands, "p", &command_prev); imv_command_register(imv->commands, "goto", &command_goto); - imv_command_register(imv->commands, "g", &command_goto); imv_command_register(imv->commands, "zoom", &command_zoom); - imv_command_register(imv->commands, "z", &command_zoom); imv_command_register(imv->commands, "open", &command_open); - imv_command_register(imv->commands, "o", &command_open); imv_command_register(imv->commands, "close", &command_close); imv_command_register(imv->commands, "fullscreen", &command_fullscreen); imv_command_register(imv->commands, "overlay", &command_overlay); @@ -533,7 +527,15 @@ struct imv *imv_create(void) imv_command_register(imv->commands, "scaling", &command_set_scaling_mode); imv_command_register(imv->commands, "slideshow", &command_set_slideshow_duration); imv_command_register(imv->commands, "background", &command_set_background); - imv_command_register(imv->commands, "bg", &command_set_background); + + imv_command_alias(imv->commands, "q", "quit"); + imv_command_alias(imv->commands, "n", "next"); + imv_command_alias(imv->commands, "p", "prev"); + imv_command_alias(imv->commands, "g", "goto"); + imv_command_alias(imv->commands, "z", "zoom"); + imv_command_alias(imv->commands, "o", "open"); + imv_command_alias(imv->commands, "bg", "background"); + imv_command_alias(imv->commands, "ss", "slideshow"); add_bind(imv, "q", "quit"); add_bind(imv, "", "prev"); @@ -563,8 +565,8 @@ struct imv *imv_create(void) add_bind(imv, "r", "reset"); add_bind(imv, "", "next_frame"); add_bind(imv, "", "toggle_playing"); - add_bind(imv, "t", "slideshow_duration +1"); - add_bind(imv, "", "slideshow_duration -1"); + add_bind(imv, "t", "slideshow +1"); + add_bind(imv, "", "slideshow -1"); return imv; } -- cgit v1.2.3