From a37c385b358359b2f34a0858e6d65606184f5abc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20Sch=C3=B6ttl?= Date: Mon, 25 Apr 2016 19:19:29 +0200 Subject: [PATCH] Add Home and End for 0 and $ respectively --- README.rst | 4 ++-- man/termite.1 | 4 ++-- termite.cc | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 770e319..d170df3 100644 --- a/README.rst +++ b/README.rst @@ -106,11 +106,11 @@ SELECTION MODE +-----------------------------------+-----------------------------------------------------------+ | ``B`` or ``ctrl-left`` | backward WORD (non-whitespace) | +-----------------------------------+-----------------------------------------------------------+ -| ``0`` | move cursor to the first column in the row | +| ``0`` or ``home`` | move cursor to the first column in the row | +-----------------------------------+-----------------------------------------------------------+ | ``^`` | beginning-of-line (first non-blank character) | +-----------------------------------+-----------------------------------------------------------+ -| ``$`` | end-of-line | +| ``$`` or ``end`` | end-of-line | +-----------------------------------+-----------------------------------------------------------+ | ``g`` | jump to start of first row | +-----------------------------------+-----------------------------------------------------------+ diff --git a/man/termite.1 b/man/termite.1 index 0ea511f..bff325a 100644 --- a/man/termite.1 +++ b/man/termite.1 @@ -95,11 +95,11 @@ backward word forward \fIWORD\fP (non-whitespace) .IP "\fBB\fP or \fBctrl-left\fP" backward \fIWORD\fP (non-whitespace) -.IP "\fB0\fP" +.IP "\fB0\fP or \fBhome\fP" move cursor to the first column in the row\fP" .IP "\fB^\fP" beginning-of-line (first non-blank character) -.IP "\fB$\fP" +.IP "\fB$\fP or \fBend\fP" end-of-line .IP "\fBg\fP" jump to start of first row diff --git a/termite.cc b/termite.cc index 8807020..1d1bb0f 100644 --- a/termite.cc +++ b/termite.cc @@ -842,6 +842,7 @@ gboolean key_press_cb(VteTerminal *vte, GdkEventKey *event, keybind_info *info) move_forward_blank_word(vte, &info->select); break; case GDK_KEY_0: + case GDK_KEY_Home: set_cursor_column(vte, &info->select, 0); break; case GDK_KEY_asciicircum: @@ -849,6 +850,7 @@ gboolean key_press_cb(VteTerminal *vte, GdkEventKey *event, keybind_info *info) move_first(vte, &info->select, std::not1(std::ref(g_unichar_isspace))); break; case GDK_KEY_dollar: + case GDK_KEY_End: move_to_eol(vte, &info->select); break; case GDK_KEY_g: