summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/mode-key.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-10-06 07:09:01 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-10-06 07:09:01 +0000
commitd5a448bb3f07df7581aec4fb1f4ae1d580940f9b (patch)
tree7a2743f840a0c56873c7a12486559956adda2ace /usr.bin/tmux/mode-key.c
parentac7379e425d74a8cf8688959ad150d72aa1d195b (diff)
Make C-Up and C-Down in copy mode scroll the screen up and down one line
without moving the cursor, like Up and Down in scroll mode (which will shortly disappear).
Diffstat (limited to 'usr.bin/tmux/mode-key.c')
-rw-r--r--usr.bin/tmux/mode-key.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.bin/tmux/mode-key.c b/usr.bin/tmux/mode-key.c
index c4e431d4753..13bb2399538 100644
--- a/usr.bin/tmux/mode-key.c
+++ b/usr.bin/tmux/mode-key.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mode-key.c,v 1.20 2009/10/04 11:18:26 nicm Exp $ */
+/* $OpenBSD: mode-key.c,v 1.21 2009/10/06 07:09:00 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -89,6 +89,8 @@ struct mode_key_cmdstr mode_key_cmdstr_copy[] = {
{ MODEKEYCOPY_PREVIOUSPAGE, "page-up" },
{ MODEKEYCOPY_PREVIOUSWORD, "previous-word" },
{ MODEKEYCOPY_RIGHT, "cursor-right" },
+ { MODEKEYCOPY_SCROLLDOWN, "scroll-down" },
+ { MODEKEYCOPY_SCROLLUP, "scroll-up" },
{ MODEKEYCOPY_SEARCHAGAIN, "search-again" },
{ MODEKEYCOPY_SEARCHDOWN, "search-forward" },
{ MODEKEYCOPY_SEARCHUP, "search-backward" },
@@ -177,11 +179,13 @@ const struct mode_key_entry mode_key_vi_copy[] = {
{ 'q', 0, MODEKEYCOPY_CANCEL },
{ 'w', 0, MODEKEYCOPY_NEXTWORD },
{ KEYC_BSPACE, 0, MODEKEYCOPY_LEFT },
+ { KEYC_DOWN | KEYC_CTRL,0, MODEKEYCOPY_SCROLLDOWN },
{ KEYC_DOWN, 0, MODEKEYCOPY_DOWN },
{ KEYC_LEFT, 0, MODEKEYCOPY_LEFT },
{ KEYC_NPAGE, 0, MODEKEYCOPY_NEXTPAGE },
{ KEYC_PPAGE, 0, MODEKEYCOPY_PREVIOUSPAGE },
{ KEYC_RIGHT, 0, MODEKEYCOPY_RIGHT },
+ { KEYC_UP | KEYC_CTRL, 0, MODEKEYCOPY_SCROLLUP },
{ KEYC_UP, 0, MODEKEYCOPY_UP },
{ 0, -1, 0 }
@@ -262,12 +266,14 @@ const struct mode_key_entry mode_key_emacs_copy[] = {
{ 'q', 0, MODEKEYCOPY_CANCEL },
{ 'v' | KEYC_ESCAPE, 0, MODEKEYCOPY_PREVIOUSPAGE },
{ 'w' | KEYC_ESCAPE, 0, MODEKEYCOPY_COPYSELECTION },
+ { KEYC_DOWN | KEYC_CTRL,0, MODEKEYCOPY_SCROLLDOWN },
{ KEYC_DOWN | KEYC_ESCAPE, 0, MODEKEYCOPY_HALFPAGEDOWN },
{ KEYC_DOWN, 0, MODEKEYCOPY_DOWN },
{ KEYC_LEFT, 0, MODEKEYCOPY_LEFT },
{ KEYC_NPAGE, 0, MODEKEYCOPY_NEXTPAGE },
{ KEYC_PPAGE, 0, MODEKEYCOPY_PREVIOUSPAGE },
{ KEYC_RIGHT, 0, MODEKEYCOPY_RIGHT },
+ { KEYC_UP | KEYC_CTRL, 0, MODEKEYCOPY_SCROLLUP },
{ KEYC_UP | KEYC_ESCAPE, 0, MODEKEYCOPY_HALFPAGEUP },
{ KEYC_UP, 0, MODEKEYCOPY_UP },