From e425f1df871ecd3ea96214ed51acfa8c3db0896e Mon Sep 17 00:00:00 2001 From: David Chen Date: Fri, 6 Dec 2019 22:36:52 -0800 Subject: [PATCH] suggested keybinding improvements --- pkg/config/app_config.go | 18 +++++++++--------- pkg/gui/keybindings.go | 20 ++++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pkg/config/app_config.go b/pkg/config/app_config.go index 1ff49da51..9c6e6467c 100644 --- a/pkg/config/app_config.go +++ b/pkg/config/app_config.go @@ -283,6 +283,7 @@ keybinding: optionMenu: 'x' optionMenu-alt1: '?' select: '' + goInto: '' remove: 'd' new: 'n' edit: 'e' @@ -293,14 +294,17 @@ keybinding: scrollDownMain-alt1: 'J' scrollUpMain-alt2: '' scrollDownMain-alt2: '' + executeCustomCommand: 'X' createRebaseOptionsMenu: 'm' pushFiles: 'P' pullFiles: 'p' refresh: 'R' createPatchOptionsMenu: '' + nextBranchTab: ']' + prevBranchTab: '[' status: checkForUpdate: 'u' - recentRepos: 's' + recentRepos: '' files: commitChanges: 'c' commitChangesWithoutHook: 'w' @@ -313,24 +317,21 @@ keybinding: toggleStagedAll: 'a' viewResetOptions: 'D' fetch: 'f' - executeCustomCommand: 'X' branches: createPullRequest: 'o' - checkoutBranchesByName: 'c' + checkoutBranchByName: 'c' forceCheckoutBranch: 'F' rebaseBranch: 'r' mergeIntoCurrentBranch: 'M' - FastForward: 'f' + fastForward: 'f' pushTag: 'P' - nextBranchTab: ']' - prevBranchTab: '[' setUpstream: 'u' commits: squashDown: 's' renameCommit: 'r' renameCommitWithEditor: 'R' - resetToThisCommit: 'g' - fixupCommit: 'f' + viewResetOptions: 'g' + markCommitAsFixup: 'f' createFixupCommit: 'F' squashAboveCommits: 'S' moveDownCommit: '' @@ -341,7 +342,6 @@ keybinding: cherryPickCopy: 'c' cherryPickCopyRange: 'C' pasteCommits: 'v' - viewCommitFiles: '' tagCommit: 'T' stash: popStash: 'g' diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go index b009f8f3d..558038714 100644 --- a/pkg/gui/keybindings.go +++ b/pkg/gui/keybindings.go @@ -594,7 +594,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { }, { ViewName: "files", - Key: gocui.KeyEnter, + Key: gui.getKey("universal.goInto"), Modifier: gocui.ModNone, Handler: gui.handleEnterFile, Description: gui.Tr.SLocalize("StageLines"), @@ -608,7 +608,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { }, { ViewName: "files", - Key: gui.getKey("files.executeCustomCommand"), + Key: gui.getKey("universal.executeCustomCommand"), Modifier: gocui.ModNone, Handler: gui.handleCustomCommand, Description: gui.Tr.SLocalize("executeCustomCommand"), @@ -632,7 +632,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { { ViewName: "branches", Contexts: []string{"local-branches"}, - Key: gui.getKey("branches.checkoutBranchesByName"), + Key: gui.getKey("branches.checkoutBranchByName"), Modifier: gocui.ModNone, Handler: gui.handleCheckoutByName, Description: gui.Tr.SLocalize("checkoutByName"), @@ -719,13 +719,13 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { }, { ViewName: "branches", - Key: gui.getKey("branches.nextBranchTab"), + Key: gui.getKey("universal.nextBranchTab"), Modifier: gocui.ModNone, Handler: gui.handleNextBranchesTab, }, { ViewName: "branches", - Key: gui.getKey("branches.prevBranchTab"), + Key: gui.getKey("universal.prevBranchTab"), Modifier: gocui.ModNone, Handler: gui.handlePrevBranchesTab, }, @@ -760,14 +760,14 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { }, { ViewName: "commits", - Key: gui.getKey("commits.resetToThisCommit"), + Key: gui.getKey("commits.viewResetOptions"), Modifier: gocui.ModNone, Handler: gui.handleCreateCommitResetMenu, Description: gui.Tr.SLocalize("resetToThisCommit"), }, { ViewName: "commits", - Key: gui.getKey("commits.fixupCommit"), + Key: gui.getKey("commits.markCommitAsFixup"), Modifier: gocui.ModNone, Handler: gui.handleCommitFixup, Description: gui.Tr.SLocalize("fixupCommit"), @@ -858,7 +858,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { }, { ViewName: "commits", - Key: gui.getKey("commits.viewCommitFiles"), + Key: gui.getKey("universal.goInto"), Modifier: gocui.ModNone, Handler: gui.handleSwitchToCommitFilesPanel, Description: gui.Tr.SLocalize("viewCommitFiles"), @@ -977,7 +977,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { }, { ViewName: "commitFiles", - Key: gocui.KeyEnter, + Key: gui.getKey("universal.goInto"), Modifier: gocui.ModNone, Handler: gui.handleEnterCommitFile, Description: gui.Tr.SLocalize("enterFile"), @@ -1341,7 +1341,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { { ViewName: "branches", Contexts: []string{"remotes"}, - Key: gocui.KeyEnter, + Key: gui.getKey("universal.goInto"), Modifier: gocui.ModNone, Handler: gui.handleRemoteEnter, },