From 811c70fc8369cfeae2f1e843c695c37e3b0c3109 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Mon, 19 Sep 2011 11:49:50 -0500 Subject: [PATCH] gitk: Make vi-style keybindings more vi-like When commit 6e2dda35 (Add new keybindings, 2005-09-22) added vi-style keybindings to gitk (an excellent idea!), instead of adopting the usual "hjkl = left, down, up, right" bindings used by less, vi, rogue, and many other programs, it used "ijkl = up, left, down, right" to mimic the inverted-T formation of the arrow keys on a qwerty keyboard, in the style of Lode runner. So using 'j' and 'k' to scroll through commits produces utterly confusing results to the vi user, as 'k' moves down and 'j' moves to the previous commit. Luckily most non-vi-users are probably using an alternate set of keys (cursor keys or z/x + n/p) anyway. Switch to the expected vi/nethack convention. Requested-by: Josh Triplett Signed-off-by: Jonathan Nieder Signed-off-by: Paul Mackerras --- gitk | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gitk b/gitk index a701e0d1a..64ef3c401 100755 --- a/gitk +++ b/gitk @@ -2431,9 +2431,9 @@ proc makewindow {} { bindkey n "selnextline 1" bindkey z "goback" bindkey x "goforw" - bindkey i "selnextline -1" - bindkey k "selnextline 1" - bindkey j "goback" + bindkey k "selnextline -1" + bindkey j "selnextline 1" + bindkey h "goback" bindkey l "goforw" bindkey b prevfile bindkey d "$ctext yview scroll 18 units" @@ -2844,9 +2844,9 @@ proc keys {} { [mc "<%s-W> Close window" $M1T] [mc " Move to first commit"] [mc " Move to last commit"] -[mc ", p, i Move up one commit"] -[mc ", n, k Move down one commit"] -[mc ", z, j Go back in history list"] +[mc ", p, k Move up one commit"] +[mc ", n, j Move down one commit"] +[mc ", z, h Go back in history list"] [mc ", x, l Go forward in history list"] [mc " Move up one page in commit list"] [mc " Move down one page in commit list"] -- 2.11.0