aboutsummaryrefslogtreecommitdiff
path: root/src/imv.c
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2019-08-07 20:44:34 +0100
committerHarry Jeffery <harry@exec64.co.uk>2019-08-07 20:44:34 +0100
commitc0f1d73df3fef83cb6a60825c08620de0ded39d5 (patch)
treee469bf39d935ac82f5645b7449612ac5c0814886 /src/imv.c
parente889f417c7edd3d47a54b9464e1b6b72c3f7ae1c (diff)
downloadimv-c0f1d73df3fef83cb6a60825c08620de0ded39d5.tar.gz
Make aliases smarter
Diffstat (limited to 'src/imv.c')
-rw-r--r--src/imv.c20
1 files changed, 11 insertions, 9 deletions
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, "<Left>", "prev");
@@ -563,8 +565,8 @@ struct imv *imv_create(void)
add_bind(imv, "r", "reset");
add_bind(imv, "<period>", "next_frame");
add_bind(imv, "<space>", "toggle_playing");
- add_bind(imv, "t", "slideshow_duration +1");
- add_bind(imv, "<Shift+T>", "slideshow_duration -1");
+ add_bind(imv, "t", "slideshow +1");
+ add_bind(imv, "<Shift+T>", "slideshow -1");
return imv;
}