]> git.mdlowis.com Git - projs/tide.git/commitdiff
Implemented two more unix shortcuts
authorMichael D. Lowis <mike.lowis@gentex.com>
Thu, 1 Dec 2016 20:21:49 +0000 (15:21 -0500)
committerMichael D. Lowis <mike.lowis@gentex.com>
Thu, 1 Dec 2016 20:21:49 +0000 (15:21 -0500)
xedit.c

diff --git a/xedit.c b/xedit.c
index 7351ace26bfa7501c414cfab6e77b1c24b69eaef..793c0883a407882519de8ebfc1a5d79105981547 100644 (file)
--- a/xedit.c
+++ b/xedit.c
@@ -25,6 +25,7 @@ static void redraw(int width, int height);
 
 // UI Callbacks
 static void delete(void);
+static void del_to_bol(void);
 static void backspace(void);
 static void cursor_home(void);
 static void cursor_end(void);
@@ -108,9 +109,9 @@ static KeyBinding Bindings[] = {
     //{ KEY_CTRL_F11,   fullscreen  },
 
     /* Standard Unix Shortcuts */
-    //{ KEY_CTRL_U,    del_to_bol   },
+    { ModCtrl, 'u', del_to_bol  },
     //{ KEY_CTRL_W,    del_to_bow   },
-    //{ KEY_CTRL_H,    del_prev_char},
+    { ModCtrl, 'h', backspace   },
     { ModCtrl, 'a', cursor_home },
     { ModCtrl, 'e', cursor_end  },
 
@@ -359,6 +360,11 @@ static void delete(void) {
     view_delete(currview(), RIGHT, byword);
 }
 
+static void del_to_bol(void) {
+    view_bol(currview(), true);
+    delete();
+}
+
 static void backspace(void) {
     bool byword = x11_keymodsset(ModCtrl);
     view_delete(currview(), LEFT, byword);