Added ^ as normal mode alias of 0 (#236).
authorDaniel Carl <danielcarl@gmx.de>
Sun, 23 Aug 2015 20:06:33 +0000 (22:06 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Sun, 23 Aug 2015 20:06:33 +0000 (22:06 +0200)
Use the ^ to scroll to the absolute left of the document like
pentadactyl does.

doc/vimb.1
src/normal.c

index bb96e0a..9d03ca8 100644 (file)
@@ -205,11 +205,12 @@ Or if \fIN\fP is given to \fIN\fP% of the page.
 Scroll to the bottom of the current page.
 Or if \fIN\fP is given to \fIN\fP% of the page.
 .TP
-.BI [ N ]0
-Scroll \fIN\fP steps to the left of current page.
+.B 0, ^
+Scroll to the absolute left of the document.
+Unlike in Vim, 0 and ^ work exactly the same way.
 .TP
-.BI [ N ]$
-Scroll \fIN\fP steps to the right of current page.
+.B $
+Scroll to the absolute right of the document.
 .TP
 .BI [ N ]h
 Scroll \fIN\fP steps to the left of page.
index 9d11c26..57e0c0d 100644 (file)
@@ -171,7 +171,7 @@ static struct {
 /* [   0x5b */ {normal_prevnext},
 /* \   0x5c */ {NULL},
 /* ]   0x5d */ {normal_prevnext},
-/* ^   0x5e */ {NULL},
+/* ^   0x5e */ {normal_scroll},
 /* _   0x5f */ {NULL},
 /* `   0x60 */ {NULL},
 /* a   0x61 */ {NULL},
@@ -700,7 +700,8 @@ static VbResult normal_scroll(const NormalCmdInfo *info)
             /* save the position to mark ' */
             vb.state.marks[VB_MARK_TICK] = gtk_adjustment_get_value(adjust);
             break;
-        case '0':
+        case '0': /* fall through */
+        case '^':
             adjust = vb.gui.adjust_h;
             new    = gtk_adjustment_get_lower(adjust);
             break;