summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2019-05-25 16:37:47 +1000
committerJesse Duffield <jessedduffield@gmail.com>2019-05-25 16:48:17 +1000
commit527c025a0c6a445230b88dfa2d4197554e5fc130 (patch)
tree4547d24fa33431c5e9b67f621b7625a5d9b5222e /pkg
parent53cded77f1d1fe8e1c1d874aca181f633c305404 (diff)
use shift+j/k to scroll main, ctrl+j/k to move commits
Diffstat (limited to 'pkg')
-rw-r--r--pkg/gui/keybindings.go20
1 files changed, 18 insertions, 2 deletions
diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go
index c205d3384..5cbd7b6eb 100644
--- a/pkg/gui/keybindings.go
+++ b/pkg/gui/keybindings.go
@@ -29,6 +29,12 @@ func (b *Binding) GetKey() string {
case rune:
key = int(b.Key.(rune))
case gocui.Key:
+ if b.Key.(gocui.Key) == gocui.KeyCtrlJ {
+ return "ctrl+j"
+ }
+ if b.Key.(gocui.Key) == gocui.KeyCtrlK {
+ return "ctrl+k"
+ }
key = int(b.Key.(gocui.Key))
}
@@ -89,6 +95,16 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
Alternative: "fn+down",
}, {
ViewName: "",
+ Key: 'K',
+ Modifier: gocui.ModNone,
+ Handler: gui.scrollUpMain,
+ }, {
+ ViewName: "",
+ Key: 'J',
+ Modifier: gocui.ModNone,
+ Handler: gui.scrollDownMain,
+ }, {
+ ViewName: "",
Key: gocui.KeyCtrlU,
Modifier: gocui.ModNone,
Handler: gui.scrollUpMain,
@@ -358,13 +374,13 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
Description: gui.Tr.SLocalize("deleteCommit"),
}, {
ViewName: "commits",
- Key: 'J',
+ Key: gocui.KeyCtrlJ,
Modifier: gocui.ModNone,
Handler: gui.handleCommitMoveDown,
Description: gui.Tr.SLocalize("moveDownCommit"),
}, {
ViewName: "commits",
- Key: 'K',
+ Key: gocui.KeyCtrlK,
Modifier: gocui.ModNone,
Handler: gui.handleCommitMoveUp,
Description: gui.Tr.SLocalize("moveUpCommit"),