From f274ec8ddd328c9ce035628ed415e11316d0221e Mon Sep 17 00:00:00 2001 From: Doug Luce Date: Fri, 11 Sep 2015 14:26:18 -0700 Subject: [PATCH] Add some emacs-like keybindings --- urlview.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/urlview.c b/urlview.c index 4a36235..4f40b48 100644 --- a/urlview.c +++ b/urlview.c @@ -57,6 +57,8 @@ #define PAGELEN (LINES - 1 - OFFSET) #define URLSIZE 128 +#define CTRL(x) ((x)-'@') + enum { FULL = 1, @@ -491,6 +493,7 @@ into a line of its own in your \n\ done = 1; break; case KEY_DOWN: + case CTRL('N'): case 'j': if (current < urlcount - 1) { @@ -517,6 +520,7 @@ into a line of its own in your \n\ } break; case KEY_UP: + case CTRL('P'): case 'k': if (current) { @@ -543,6 +547,7 @@ into a line of its own in your \n\ } break; case KEY_HOME: + case '<': case '=': if (top != 0) { @@ -554,6 +559,7 @@ into a line of its own in your \n\ current = 0; break; case KEY_END: + case '>': case '*': case 'G': current = urlcount - 1; @@ -566,6 +572,7 @@ into a line of its own in your \n\ redraw = MOTION; break; case KEY_NPAGE: + case CTRL('V'): case '\006': if (top + PAGELEN < urlcount) {