Skip to content

Commit

Permalink
gitk: Make vi-style keybindings more vi-like
Browse files Browse the repository at this point in the history
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 <josh@joshtriplett.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
jrn authored and paulusmack committed Oct 8, 2011
1 parent de665fd commit 811c70f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions gitk
Expand Up @@ -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"
Expand Down Expand Up @@ -2844,9 +2844,9 @@ proc keys {} {
[mc "<%s-W> Close window" $M1T]
[mc "<Home> Move to first commit"]
[mc "<End> Move to last commit"]
[mc "<Up>, p, i Move up one commit"]
[mc "<Down>, n, k Move down one commit"]
[mc "<Left>, z, j Go back in history list"]
[mc "<Up>, p, k Move up one commit"]
[mc "<Down>, n, j Move down one commit"]
[mc "<Left>, z, h Go back in history list"]
[mc "<Right>, x, l Go forward in history list"]
[mc "<PageUp> Move up one page in commit list"]
[mc "<PageDown> Move down one page in commit list"]
Expand Down

0 comments on commit 811c70f

Please sign in to comment.