Skip to content

Commit 811c70f

Browse files
jrnpaulusmack
authored andcommitted
gitk: Make vi-style keybindings more vi-like
When commit 6e2dda3 (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 <[email protected]> Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent de665fd commit 811c70f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

gitk

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2431,9 +2431,9 @@ proc makewindow {} {
24312431
bindkey n "selnextline 1"
24322432
bindkey z "goback"
24332433
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"
24372437
bindkey l "goforw"
24382438
bindkey b prevfile
24392439
bindkey d "$ctext yview scroll 18 units"
@@ -2844,9 +2844,9 @@ proc keys {} {
28442844
[mc "<%s-W> Close window" $M1T]
28452845
[mc "<Home> Move to first commit"]
28462846
[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"]
28502850
[mc "<Right>, x, l Go forward in history list"]
28512851
[mc "<PageUp> Move up one page in commit list"]
28522852
[mc "<PageDown> Move down one page in commit list"]

0 commit comments

Comments
 (0)