From: Daniel Carl Date: Fri, 27 Apr 2018 22:35:34 +0000 (+0200) Subject: Allow basic motion commands for hinting too. X-Git-Url: https://git.owens.tech///git?a=commitdiff_plain;h=30d670f2e204ee8e6912a102707c102562c31021;p=vimb.git Allow basic motion commands for hinting too. --- diff --git a/doc/vimb.1 b/doc/vimb.1 index cdcfd85..7504fab 100644 --- a/doc/vimb.1 +++ b/doc/vimb.1 @@ -297,6 +297,35 @@ remain visible so that another one can be selected with the same action as the first. Note that the extended hint mode can only be combined with the following hint modes \fII o p P s t y Y\fP. +.PD +.TP +.B Motion +.RS +Motions commands are like those for normal mode except that CTRL is used as +modifier. +But they can not be used together with a count. +.PP +.PD 0 +.TP +.B CTRL-F +Scroll one page down. +.TP +.B CTRL-B +Scroll one page up. +.TP +.B CTRL-D +Scroll half page down. +.TP +.B CTRL-U +Scroll half page up. +.TP +.B CTRL-J +Scroll one step down. +.TP +.B CTRL-K +Scroll one step up. +.PD +.RE .SS Searching .TP .BI / QUERY ", ?" QUERY diff --git a/src/ascii.h b/src/ascii.h index cd47876..92906c7 100644 --- a/src/ascii.h +++ b/src/ascii.h @@ -78,6 +78,7 @@ static const unsigned char chartable[256] = { /* get internal representation for conrol character ^C */ #define CTRL(c) ((c) ^ 0x40) +#define UNCTRL(c) (((c) ^ 0x40) + 'a' - 'A') #define IS_SPECIAL(c) (c < 0) diff --git a/src/hints.c b/src/hints.c index 8905ec3..c5be1d8 100644 --- a/src/hints.c +++ b/src/hints.c @@ -29,6 +29,7 @@ #include "command.h" #include "input.h" #include "map.h" +#include "normal.h" #include "ext-proxy.h" static struct { @@ -74,6 +75,10 @@ VbResult hints_keypress(Client *c, int key) hints_focus_next(c, TRUE); return RESULT_COMPLETE; + } else if (key == CTRL('D') || key == CTRL('F') || key == CTRL('B') || key == CTRL('U')) { + return normal_keypress(c, key); + } else if (key == CTRL('J') || key == CTRL('K')) { + return normal_keypress(c, UNCTRL(key)); } else { fire_timeout(c, TRUE); /* try to handle the key by the javascript */