Skip to contentSkip to conversation

make j/k move down/up in gitk (like vi)

PATCH In review Bart Trojanowski 3 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 make j/k move down/up in gitk (like vi)

Currently gitk has i/k bound to move up and down in the commit list. I would like to make that more consistent with vi's j/k.

If this is not acceptable, I will investigate a git-config option for vi compatibility mode.

---
 gitk |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
gitk +2 -4
index b1c65d7..0ce4a12 100755
@@ -711,10 +711,8 @@ proc makewindow {} {
     bindkey n "selnextline 1"
     bindkey z "goback"
     bindkey x "goforw"
-    bindkey i "selnextline -1"
-    bindkey k "selnextline 1"
-    bindkey j "goback"
-    bindkey l "goforw"
+    bindkey k "selnextline -1"
+    bindkey j "selnextline 1"
     bindkey b "$ctext yview scroll -1 pages"
     bindkey d "$ctext yview scroll 18 units"
     bindkey u "$ctext yview scroll -18 units"
Signature · 1 line
1.5.2.rc0.56.g6169a
#1 lore raw

hoi :)

Quoted 2 lines · Bart Trojanowski

Currently gitk has i/k bound to move up and down in the commit list. I would like to make that more consistent with vi's j/k.

very nice.
if you want to keep back/forward near up/down you can use h/l, just like left/right in vi.

Signature · 1 line
Martin Waitz
#2 lore raw
In reply to Bart Trojanowski
Quoted 2 lines · Bart Trojanowski

Currently gitk has i/k bound to move up and down in the commit list. I would like to make that more consistent with vi's j/k.

I kind of second this. Any program that implements keyboard navigation and binds directions differently from vi greatly irritates me.

But it may be just me, who never used wordstar.

Quoted 2 lines

If this is not acceptable, I will investigate a git-config option for vi compatibility mode.

I think a sensible way to go would be to allow gitk to read a custom tcl script from $HOME/.gitk, and make sure when the file is written back, the custom bindings are stored there as well.