From 00cd3801d9c4a25c527a378add86c705efa671d6 Mon Sep 17 00:00:00 2001 From: okan Date: Tue, 15 Apr 2008 18:33:13 +0000 Subject: - add vi keybindings to search - allow for ctrl-h as well discussion with and ok oga@ --- input.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'input.c') diff --git a/input.c b/input.c index d2d4b6b..28c973b 100644 --- a/input.c +++ b/input.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: input.c,v 1.4 2008/01/11 16:06:44 oga Exp $ + * $Id: input.c,v 1.5 2008/04/15 18:33:13 okan Exp $ */ #include "headers.h" @@ -70,6 +70,10 @@ input_keycodetrans(KeyCode kc, u_int state, case XK_U: *ctl = CTL_WIPE; break; + case XK_h: + case XK_H: + *ctl = CTL_ERASEONE; + break; case XK_a: case XK_A: *ctl = CTL_ALL; @@ -77,6 +81,21 @@ input_keycodetrans(KeyCode kc, u_int state, } } + if (*ctl == CTL_NONE && (state & Mod1Mask)) { + switch (ks) { + case XK_j: + case XK_J: + /* Vi "down" */ + *ctl = CTL_DOWN; + break; + case XK_k: + case XK_K: + /* Vi "up" */ + *ctl = CTL_UP; + break; + } + } + if (*ctl != CTL_NONE) return (0); -- cgit v1.2.3-2-gb3c3