summary refs log tree commit diff
path: root/input.c
diff options
context:
space:
mode:
authorokan <okan>2008-04-15 18:33:13 +0000
committerokan <okan>2008-04-15 18:33:13 +0000
commit4bbb472a25c62b8266de2225c5f98b96ab829e1c (patch)
tree12a623aff82883076ca55b6a663a3efd12ee64d4 /input.c
parentfe80d400634a3b5e38ad8d1e9b5a3146306305d2 (diff)
downloadcwm-4bbb472a25c62b8266de2225c5f98b96ab829e1c.tar.gz
cwm-4bbb472a25c62b8266de2225c5f98b96ab829e1c.tar.xz
cwm-4bbb472a25c62b8266de2225c5f98b96ab829e1c.zip
- add vi keybindings to search
- allow for ctrl-h as well

discussion with and ok oga@
Diffstat (limited to 'input.c')
-rw-r--r--input.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/input.c b/input.c
index 5a1a3bc..e5a4a00 100644
--- a/input.c
+++ b/input.c
@@ -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);