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 <josh@joshtriplett.org> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Paul Mackerras <paulus@samba.org>

Jonathan Nieder committed Sep 19, 2011 at 11:49 UTC 811c70fc8369cfeae2f1e843c695c37e3b0c3109
1 file changed +6 -6
gitk
+6 -6
@@ -2431,9 +2431,9 @@ proc makewindow {} {
2431 bindkey n "selnextline 1"
2432 bindkey z "goback"
2433 bindkey x "goforw"
2434 - bindkey i "selnextline -1"
2435 - bindkey k "selnextline 1"
2436 - bindkey j "goback"
2434 + bindkey k "selnextline -1"
2435 + bindkey j "selnextline 1"
2436 + bindkey h "goback"
2437 bindkey l "goforw"
2438 bindkey b prevfile
2439 bindkey d "$ctext yview scroll 18 units"
@@ -2844,9 +2844,9 @@ proc keys {} {
2844 [mc "<%s-W> Close window" $M1T]
2845 [mc "<Home> Move to first commit"]
2846 [mc "<End> Move to last commit"]
2847 -[mc "<Up>, p, i Move up one commit"]
2848 -[mc "<Down>, n, k Move down one commit"]
2849 -[mc "<Left>, z, j Go back in history list"]
2847 +[mc "<Up>, p, k Move up one commit"]
2848 +[mc "<Down>, n, j Move down one commit"]
2849 +[mc "<Left>, z, h Go back in history list"]
2850 [mc "<Right>, x, l Go forward in history list"]
2851 [mc "<PageUp> Move up one page in commit list"]
2852 [mc "<PageDown> Move down one page in commit list"]