diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-10-02 07:32:48 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-10-02 08:09:42 +1000 |
commit | 7be474bd83a0fc01e67e1cfd92f1ed9e098b3bee (patch) | |
tree | 36b01e7b6531ef98f9f507f1ecc610070ebf52db | |
parent | 30b347861101a4a3f38a009ed8ef8b50860472ae (diff) |
update keybindings
-rw-r--r-- | docs/keybindings/Keybindings_en.md | 110 | ||||
-rw-r--r-- | docs/keybindings/Keybindings_nl.md | 110 | ||||
-rw-r--r-- | docs/keybindings/Keybindings_pl.md | 110 | ||||
-rw-r--r-- | pkg/gui/keybindings.go | 56 | ||||
-rw-r--r-- | pkg/gui/list_context.go | 20 | ||||
-rw-r--r-- | pkg/i18n/dutch.go | 10 | ||||
-rw-r--r-- | pkg/i18n/english.go | 19 | ||||
-rw-r--r-- | scripts/generate_cheatsheet.go | 46 |
8 files changed, 229 insertions, 252 deletions
diff --git a/docs/keybindings/Keybindings_en.md b/docs/keybindings/Keybindings_en.md index e28142755..93e16e306 100644 --- a/docs/keybindings/Keybindings_en.md +++ b/docs/keybindings/Keybindings_en.md @@ -17,14 +17,20 @@ <kbd>_</kbd>: prev screen mode <kbd>:</kbd>: execute custom command <kbd>|</kbd>: view scoping options - <kbd>∂</kbd>: open diff menu + <kbd>W</kbd>: open diff menu + <kbd>ctrl+e</kbd>: open diff menu </pre> -## Branches Panel +## List Panel Navigation <pre> <kbd>]</kbd>: next tab <kbd>[</kbd>: previous tab + <kbd>,</kbd>: previous page + <kbd>.</kbd>: next page + <kbd><</kbd>: scroll to top + <kbd>/</kbd>: start search + <kbd>></kbd>: scroll to bottom </pre> ## Branches Panel (Branches Tab) @@ -43,11 +49,7 @@ <kbd>g</kbd>: view reset options <kbd>R</kbd>: rename branch <kbd>ctrl+o</kbd>: copy branch name to clipboard - <kbd>,</kbd>: previous page - <kbd>.</kbd>: next page - <kbd><</kbd>: scroll to top - <kbd>/</kbd>: start search - <kbd>></kbd>: scroll to bottom + <kbd>enter</kbd>: view commits </pre> ## Branches Panel (Remote Branches (in Remotes tab)) @@ -55,17 +57,13 @@ <pre> <kbd>esc</kbd>: Return to remotes list <kbd>g</kbd>: view reset options + <kbd>enter</kbd>: view commits <kbd>space</kbd>: checkout <kbd>n</kbd>: new branch <kbd>M</kbd>: merge into currently checked out branch <kbd>d</kbd>: delete branch <kbd>r</kbd>: rebase checked-out branch onto this branch <kbd>u</kbd>: set as upstream of checked-out branch - <kbd>,</kbd>: previous page - <kbd>.</kbd>: next page - <kbd><</kbd>: scroll to top - <kbd>/</kbd>: start search - <kbd>></kbd>: scroll to bottom </pre> ## Branches Panel (Remotes Tab) @@ -75,11 +73,19 @@ <kbd>n</kbd>: add new remote <kbd>d</kbd>: remove remote <kbd>e</kbd>: edit remote - <kbd>,</kbd>: previous page - <kbd>.</kbd>: next page - <kbd><</kbd>: scroll to top - <kbd>/</kbd>: start search - <kbd>></kbd>: scroll to bottom +</pre> + +## Branches Panel (Sub-commits) + +<pre> + <kbd>enter</kbd>: view commit's files + <kbd>space</kbd>: checkout commit + <kbd>g</kbd>: view reset options + <kbd>n</kbd>: new branch + <kbd>c</kbd>: copy commit (cherry-pick) + <kbd>C</kbd>: copy commit range (cherry-pick) + <kbd>ctrl+r</kbd>: reset cherry-picked (copied) commits selection + <kbd>ctrl+o</kbd>: copy commit SHA to clipboard </pre> ## Branches Panel (Tags Tab) @@ -90,38 +96,22 @@ <kbd>P</kbd>: push tag <kbd>n</kbd>: create tag <kbd>g</kbd>: view reset options - <kbd>,</kbd>: previous page - <kbd>.</kbd>: next page - <kbd><</kbd>: scroll to top - <kbd>/</kbd>: start search - <kbd>></kbd>: scroll to bottom + <kbd>enter</kbd>: view commits </pre> ## Commit Files Panel <pre> - <kbd>esc</kbd>: go back + <kbd>ctrl+o</kbd>: copy the committed file name to the clipboard <kbd>c</kbd>: checkout file <kbd>d</kbd>: discard this commit's changes to this file <kbd>o</kbd>: open file <kbd>e</kbd>: edit file <kbd>space</kbd>: toggle file included in patch <kbd>enter</kbd>: enter file to add selected lines to the patch - <kbd>,</kbd>: previous page - <kbd>.</kbd>: next page - <kbd><</kbd>: scroll to top - <kbd>/</kbd>: start search - <kbd>></kbd>: scroll to bottom </pre> -## Commits Panel - -<pre> - <kbd>]</kbd>: next tab - <kbd>[</kbd>: previous tab -</pre> - -## Commits Panel (Commits Tab) +## Commits Panel (Commits) <pre> <kbd>s</kbd>: squash down @@ -147,26 +137,21 @@ <kbd>n</kbd>: create new branch off of commit <kbd>T</kbd>: tag commit <kbd>ctrl+r</kbd>: reset cherry-picked (copied) commits selection - <kbd>,</kbd>: previous page - <kbd>.</kbd>: next page - <kbd><</kbd>: scroll to top - <kbd>/</kbd>: start search - <kbd>></kbd>: scroll to bottom </pre> ## Commits Panel (Reflog Tab) <pre> + <kbd>enter</kbd>: view commit's files <kbd>space</kbd>: checkout commit <kbd>g</kbd>: view reset options - <kbd>,</kbd>: previous page - <kbd>.</kbd>: next page - <kbd><</kbd>: scroll to top - <kbd>/</kbd>: start search - <kbd>></kbd>: scroll to bottom + <kbd>c</kbd>: copy commit (cherry-pick) + <kbd>C</kbd>: copy commit range (cherry-pick) + <kbd>ctrl+r</kbd>: reset cherry-picked (copied) commits selection + <kbd>ctrl+o</kbd>: copy commit SHA to clipboard </pre> -## Files Panel +## Files Panel (Files) <pre> <kbd>c</kbd>: commit changes @@ -185,12 +170,21 @@ <kbd>D</kbd>: view reset options <kbd>enter</kbd>: stage individual hunks/lines <kbd>f</kbd>: fetch + <kbd>ctrl+o</kbd>: copy the file name to the clipboard <kbd>g</kbd>: view upstream reset options - <kbd>,</kbd>: previous page - <kbd>.</kbd>: next page - <kbd><</kbd>: scroll to top - <kbd>/</kbd>: start search - <kbd>></kbd>: scroll to bottom +</pre> + +## Files Panel (Submodules) + +<pre> + <kbd>ctrl+o</kbd>: copy submodule name to clipboard + <kbd>enter</kbd>: enter submodule + <kbd>d</kbd>: view reset and remove submodule options + <kbd>u</kbd>: update submodule + <kbd>n</kbd>: add new submodule + <kbd>e</kbd>: update submodule URL + <kbd>i</kbd>: initialize submodule + <kbd>b</kbd>: view bulk submodule options </pre> ## Main Panel (Merging) @@ -254,24 +248,16 @@ <pre> <kbd>esc</kbd>: close menu - <kbd>,</kbd>: previous page - <kbd>.</kbd>: next page - <kbd><</kbd>: scroll to top - <kbd>/</kbd>: start search - <kbd>></kbd>: scroll to bottom </pre> ## Stash Panel <pre> + <kbd>enter</kbd>: view stash entry's files <kbd>space</kbd>: apply <kbd>g</kbd>: pop <kbd>d</kbd>: drop - <kbd>,</kbd>: previous page - <kbd>.</kbd>: next page - <kbd><</kbd>: scroll to top - <kbd>/</kbd>: start search - <kbd>></kbd>: scroll to bottom + <kbd>n</kbd>: new branch </pre> ## Status Panel diff --git a/docs/keybindings/Keybindings_nl.md b/docs/keybindings/Keybindings_nl.md index 567bf4d25..f5d4cf0d9 100644 --- a/docs/keybindings/Keybindings_nl.md +++ b/docs/keybindings/Keybindings_nl.md @@ -17,14 +17,20 @@ <kbd>_</kbd>: vorige schermmode <kbd>:</kbd>: voor aangepast commando uit <kbd>|</kbd>: bekijk scoping opties - <kbd>∂</kbd>: open diff menu + <kbd>W</kbd>: open diff menu + <kbd>ctrl+e</kbd>: open diff menu </pre> -## Branches Paneel +## List Panel Navigation <pre> <kbd>]</kbd>: volgende tab <kbd>[</kbd>: vorige tab + <kbd>,</kbd>: vorige pagina + <kbd>.</kbd>: volgende pagina + <kbd><</kbd>: scroll naar boven + <kbd>/</kbd>: start met zoekken + <kbd>></kbd>: scroll naar beneden </pre> ## Branches Paneel (Branches Tab) @@ -43,11 +49,7 @@ <kbd>g</kbd>: bekijk reset opties <kbd>R</kbd>: hernoem branch <kbd>ctrl+o</kbd>: copieer branch name naar clipboard - <kbd>,</kbd>: vorige pagina - <kbd>.</kbd>: volgende pagina - <kbd><</kbd>: scroll naar boven - <kbd>/</kbd>: start met zoekken - <kbd>></kbd>: scroll naar beneden + <kbd>enter</kbd>: view commits </pre> ## Branches Paneel (Remote Branches (in Remotes tab)) @@ -55,17 +57,13 @@ <pre> <kbd>esc</kbd>: Ga terug naar remotes lijst <kbd>g</kbd>: bekijk reset opties + <kbd>enter</kbd>: view commits <kbd>space</kbd>: uitchecken <kbd>n</kbd>: nieuwe branch <kbd>M</kbd>: merge in met huidige checked out branch <kbd>d</kbd>: verwijder branch <kbd>r</kbd>: rebase branch <kbd>u</kbd>: stel in als upstream van uitgecheckte branch - <kbd>,</kbd>: vorige pagina - <kbd>.</kbd>: volgende pagina - <kbd><</kbd>: scroll naar boven - <kbd>/</kbd>: start met zoekken - <kbd>></kbd>: scroll naar beneden </pre> ## Branches Paneel (Remotes Tab) @@ -75,11 +73,19 @@ <kbd>n</kbd>: voeg een nieuwe remote toe <kbd>d</kbd>: verwijder remote <kbd>e</kbd>: wijzig remote - <kbd>,</kbd>: vorige pagina - <kbd>.</kbd>: volgende pagina - <kbd><</kbd>: scroll naar boven - <kbd>/</kbd>: start met zoekken - <kbd>></kbd>: scroll naar beneden +</pre> + +## Branches Paneel (Sub-commits) + +<pre> + <kbd>enter</kbd>: bekijk gecommite bestanden + <kbd>space</kbd>: checkout commit + <kbd>g</kbd>: bekijk reset opties + <kbd>n</kbd>: nieuwe branch + <kbd>c</kbd>: kopiëer commit (cherry-pick) + <kbd>C</kbd>: kopiëer commit reeks (cherry-pick) + <kbd>ctrl+r</kbd>: reset cherry-picked (gecopieerde) commits selectie + <kbd>ctrl+o</kbd>: copieer commit SHA naar clipboard </pre> ## Branches Paneel (Tags Tab) @@ -90,38 +96,22 @@ <kbd>P</kbd>: push tag <kbd>n</kbd>: creëer tag <kbd>g</kbd>: bekijk reset opties - <kbd>,</kbd>: vorige pagina - <kbd>.</kbd>: volgende pagina - <kbd><</kbd>: scroll naar boven - <kbd>/</kbd>: start met zoekken - <kbd>></kbd>: scroll naar beneden + <kbd>enter</kbd>: view commits </pre> ## Commit bestanden Paneel <pre> - <kbd>esc</kbd>: ga terug + <kbd>ctrl+o</kbd>: kopieer de vastgelegde bestandsnaam naar het klembord <kbd>c</kbd>: bestand uitchecken <kbd>d</kbd>: uitsluit deze commit zijn veranderingen aan dit bestand <kbd>o</kbd>: open bestand <kbd>e</kbd>: verander bestand <kbd>space</kbd>: toggle bestand inbegrepen in patch <kbd>enter</kbd>: enter bestand to add selecteered lines to the patch - <kbd>,</kbd>: vorige pagina - <kbd>.</kbd>: volgende pagina - <kbd><</kbd>: scroll naar boven - <kbd>/</kbd>: start met zoekken - <kbd>></kbd>: scroll naar beneden </pre> -## Commits Paneel - -<pre> - <kbd>]</kbd>: volgende tab - <kbd>[</kbd>: vorige tab -</pre> - -## Commits Paneel (Commits Tab) +## Commits Paneel (Commits) <pre> <kbd>s</kbd>: squash beneden @@ -147,26 +137,21 @@ <kbd>n</kbd>: create new branch off of commit <kbd>T</kbd>: tag commit <kbd>ctrl+r</kbd>: reset cherry-picked (gecopieerde) commits selectie - <kbd>,</kbd>: vorige pagina - <kbd>.</kbd>: volgende pagina - <kbd><</kbd>: scroll naar boven - <kbd>/</kbd>: start met zoekken - <kbd>></kbd>: scroll naar beneden </pre> ## Commits Paneel (Reflog Tab) <pre> + <kbd>enter</kbd>: bekijk gecommite bestanden <kbd>space</kbd>: checkout commit <kbd>g</kbd>: bekijk reset opties - <kbd>,</kbd>: vorige pagina - <kbd>.</kbd>: volgende pagina - <kbd><</kbd>: scroll naar boven - <kbd>/</kbd>: start met zoekken - <kbd>></kbd>: scroll naar beneden + <kbd>c</kbd>: kopiëer commit (cherry-pick) + <kbd>C</kbd>: kopiëer commit reeks (cherry-pick) + <kbd>ctrl+r</kbd>: reset cherry-picked (gecopieerde) commits selectie + <kbd>ctrl+o</kbd>: copieer commit SHA naar clipboard </pre> -## Bestanden Paneel +## Bestanden Paneel (Bestanden) <pre> <kbd>c</kbd>: Commit veranderingen @@ -185,12 +170,21 @@ <kbd>D</kbd>: bekijk reset opties <kbd>enter</kbd>: stage individuele hunks/lijnen <kbd>f</kbd>: fetch + <kbd>ctrl+o</kbd>: kopieer de bestandsnaam naar het klembord <kbd>g</kbd>: bekijk upstream reset opties - <kbd>,</kbd>: vorige pagina - <kbd>.</kbd>: volgende pagina - <kbd><</kbd>: scroll naar boven - <kbd>/</kbd>: start met zoekken - <kbd>></kbd>: scroll naar beneden +</pre> + +## Bestanden Paneel (Submodules) + +<pre> + <kbd>ctrl+o</kbd>: copy submodule name to clipboard + <kbd>enter</kbd>: enter submodule + <kbd>d</kbd>: view reset and remove submodule options + <kbd>u</kbd>: update submodule + <kbd>n</kbd>: add new submodule + <kbd>e</kbd>: update submodule URL + <kbd>i</kbd>: initialize submodule + <kbd>b</kbd>: view bulk submodule options </pre> ## Hooft Paneel (Merggen) @@ -254,24 +248,16 @@ <pre> <kbd>esc</kbd>: sluit menu - <kbd>,</kbd>: vorige pagina - <kbd>.</kbd>: volgende pagina - <kbd><</kbd>: scroll naar boven - <kbd>/</kbd>: start met zoekken - <kbd>></kbd>: scroll naar beneden </pre> ## Stash Paneel <pre> + <kbd>enter</kbd>: view stash entry's files <kbd>space</kbd>: toepassen <kbd>g</kbd>: pop <kbd>d</kbd>: laten vallen - <kbd>,</kbd>: vorige pagina - <kbd>.</kbd>: volgende pagina - <kbd><</kbd>: scroll naar boven - <kbd>/</kbd>: start met zoekken - <kbd>></kbd>: scroll naar beneden + <kbd>n</kbd>: nieuwe branch </pre> ## Status Paneel diff --git a/docs/keybindings/Keybindings_pl.md b/docs/keybindings/Keybindings_pl.md index bc288f107..cf936c9f4 100644 --- a/docs/keybindings/Keybindings_pl.md +++ b/docs/keybindings/Keybindings_pl.md @@ -17,14 +17,20 @@ <kbd>_</kbd>: prev screen mode <kbd>:</kbd>: execute custom command <kbd>|</kbd>: view scoping options - <kbd>∂</kbd>: open diff menu + <kbd>W</kbd>: open diff menu + <kbd>ctrl+e</kbd>: open diff menu </pre> -## Gałęzie Panel +## List Panel Navigation <pre> <kbd>]</kbd>: next tab <kbd>[</kbd>: previous tab + <kbd>,</kbd>: previous page + <kbd>.</kbd>: next page + <kbd><</kbd>: scroll to top + <kbd>/</kbd>: start search + <kbd>></kbd>: scroll to bottom </pre> ## Gałęzie Panel (Branches Tab) @@ -43,11 +49,7 @@ <kbd>g</kbd>: view reset options <kbd>R</kbd>: rename branch <kbd>ctrl+o</kbd>: copy branch name to clipboard - <kbd>,</kbd>: previous page - <kbd>.</kbd>: next page - <kbd><</kbd>: scroll to top - <kbd>/</kbd>: start search - <kbd>></kbd>: scroll to bottom + <kbd>enter</kbd>: view commits </pre> ## Gałęzie Panel (Remote Branches (in Remotes tab)) @@ -55,17 +57,13 @@ <pre> <kbd>esc</kbd>: return to remotes list <kbd>g</kbd>: view reset options + <kbd>enter</kbd>: view commits <kbd>space</kbd>: przełącz <kbd>n</kbd>: nowa gałąź <kbd>M</kbd>: scal do obecnej gałęzi <kbd>d</kbd>: usuń gałąź <kbd>r</kbd>: rebase branch <kbd>u</kbd>: set as upstream of checked-out branch - <kbd>,</kbd>: previous page - <kbd>.</kbd>: next page - <kbd><</kbd>: scroll to top - <kbd>/</kbd>: start search - <kbd>></kbd>: scroll to bottom </pre> ## Gałęzie Panel (Remotes Tab) @@ -75,11 +73,19 @@ <kbd>n</kbd>: add new remote <kbd>d</kbd>: remove remote <kbd>e</kbd>: edit remote - <kbd>,</kbd>: previous page - <kbd>.</kbd>: next page - <kbd><</kbd>: scroll to top - <kbd>/</kbd>: start search - <kbd>></kbd>: scroll to bottom +</pre> + +## Gałęzie Panel (Sub-commits) + +<pre> + <kbd>enter</kbd>: view commit's files + <kbd>space</kbd>: checkout commit + <kbd>g</kbd>: view reset options + <kbd>n</kbd>: nowa gałąź + <kbd>c</kbd>: copy commit (cherry-pick) + <kbd>C</kbd>: copy commit range (cherry-pick) + <kbd>ctrl+r</kbd>: reset cherry-picked (copied) commits selection + <kbd>ctrl+o</kbd>: copy commit SHA to clipboard </pre> ## Gałęzie Panel (Tags Tab) @@ -90,38 +96,22 @@ <kbd>P</kbd>: push tag <kbd>n</kbd>: create tag <kbd>g</kbd>: view reset options - <kbd>,</kbd>: previous page - <kbd>.</kbd>: next page - <kbd><</kbd>: scroll to top - <kbd>/</kbd>: start search - <kbd>></kbd>: scroll to bottom + <kbd>enter</kbd>: view commits </pre> ## Commit files Panel <pre> - <kbd>esc</kbd>: go back + <kbd>ctrl+o</kbd>: copy the committed file name to the clipboard <kbd>c</kbd>: checkout file <kbd>d</kbd>: discard this commit's changes to this file <kbd>o</kbd>: otwórz plik <kbd>e</kbd>: edytuj plik <kbd>space</kbd>: toggle file included in patch <kbd>enter</kbd>: enter file to add selected lines to the patch - <kbd>,</kbd>: previous page - <kbd>.</kbd>: next page - <kbd><</kbd>: scroll to top - <kbd>/</kbd>: start search - <kbd>></kbd>: scroll to bottom </pre> -## Commity Panel - -<pre> - <kbd>]</kbd>: next tab - <kbd>[</kbd>: previous tab -</pre> - -## Commity Panel (Commits Tab) +## Commity Panel (Commity) <pre> <kbd>s</kbd>: ściśnij w dół @@ -147,26 +137,21 @@ <kbd>n</kbd>: create new branch off of commit <kbd>T</kbd>: tag commit <kbd>ctrl+r</kbd>: reset cherry-picked (copied) commits selection - <kbd>,</kbd>: previous page - <kbd>.</kbd>: next page - <kbd><</kbd>: scroll to top - <kbd>/</kbd>: start search - <kbd>></kbd>: scroll to bottom </pre> ## Commity Panel (Reflog Tab) <pre> + <kbd>enter</kbd>: view commit's files <kbd>space</kbd>: checkout commit <kbd>g</kbd>: view reset options - <kbd>,</kbd>: previous page - <kbd>.</kbd>: next page - <kbd><</kbd>: scroll to top - <kbd>/</kbd>: start search - <kbd>></kbd>: scroll to bottom + <kbd>c</kbd>: copy commit (cherry-pick) + <kbd>C</kbd>: copy commit range (cherry-pick) + <kbd>ctrl+r</kbd>: reset cherry-picked (copied) commits selection + <kbd>ctrl+o</kbd>: copy commit SHA to clipboard </pre> -## Pliki Panel +## Pliki Panel (Pliki) <pre> <kbd>c</kbd>: commituj zmiany @@ -185,12 +170,21 @@ <kbd>D</kbd>: view reset options <kbd>enter</kbd>: zatwierdź pojedyncze linie <kbd>f</kbd>: fetch + <kbd>ctrl+o</kbd>: copy the file name to the clipboard <kbd>g</kbd>: view upstream reset options - <kbd>,</kbd>: previous page - <kbd>.</kbd>: next page - <kbd><</kbd>: scroll to top - <kbd>/</kbd>: start search - <kbd>></kbd>: scroll to bottom +</pre> + +## Pliki Panel (Submodules) + +<pre> + <kbd>ctrl+o</kbd>: copy submodule name to clipboard + <kbd>enter</kbd>: enter submodule + <kbd>d</kbd>: view reset and remove submodule options + <kbd>u</kbd>: update submodule + <kbd>n</kbd>: add new submodule + <kbd>e</kbd>: update submodule URL + <kbd>i</kbd>: initialize submodule + <kbd>b</kbd>: view bulk submodule options </pre> ## Main Panel (Merging) @@ -254,24 +248,16 @@ <pre> <kbd>esc</kbd>: close menu - <kbd>,</kbd>: previous page - <kbd>.</kbd>: next page - <kbd><</kbd>: scroll to top - <kbd>/</kbd>: start search - <kbd>></kbd>: scroll to bottom </pre> ## Schowek Panel <pre> + <kbd>enter</kbd>: view stash entry's files <kbd>space</kbd>: zastosuj <kbd>g</kbd>: wyciągnij <kbd>d</kbd>: porzuć - <kbd>,</kbd>: previous page - <kbd>.</kbd>: next page - <kbd><</kbd>: scroll to top - <kbd>/</kbd>: start search - <kbd>></kbd>: scroll to bottom + <kbd>n</kbd>: nowa gałąź </pre> ## Status Panel diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go index 97b720b49..40f15ba56 100644 --- a/pkg/gui/keybindings.go +++ b/pkg/gui/keybindings.go @@ -21,6 +21,7 @@ type Binding struct { Modifier gocui.Modifier Description string Alternative string + Tag string // e.g. 'navigation'. Used for grouping things in the cheatsheet } // GetDisplayStrings returns the display string of a file @@ -635,18 +636,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { }, { ViewName: "branches", - Key: gui.getKey("universal.nextTab"), - Handler: gui.handleNextTab, - Description: gui.Tr.SLocalize("nextTab"), - }, - { - ViewName: "branches", - Key: gui.getKey("universal.prevTab"), - Handler: gui.handlePrevTab, - Description: gui.Tr.SLocalize("prevTab"), - }, - { - ViewName: "branches", Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY}, Key: gui.getKey("universal.return"), Handler: gui.handleRemoteBranchesEscape, @@ -675,18 +664,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { }, { ViewName: "commits", - Key: gui.getKey("universal.nextTab"), - Handler: gui.handleNextTab, - Description: gui.Tr.SLocalize("nextTab"), - }, - { - ViewName: "commits", - Key: gui.getKey("universal.prevTab"), - Handler: gui.handlePrevTab, - Description: gui.Tr.SLocalize("prevTab"), - }, - { - ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey("commits.squashDown"), Handler: gui.handleCommitSquashDown, @@ -1562,18 +1539,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { }, { ViewName: "files", - Key: gui.getKey("universal.nextTab"), - Handler: gui.handleNextTab, - Description: gui.Tr.SLocalize("nextTab"), - }, - { - ViewName: "files", - Key: gui.getKey("universal.prevTab"), - Handler: gui.handlePrevTab, - Description: gui.Tr.SLocalize("prevTab"), - }, - { - ViewName: "files", Contexts: []string{SUBMODULES_CONTEXT_KEY}, Key: gui.getKey("universal.copyToClipboard"), Handler: gui.wrappedHandler(gui.handleCopySelectedSideContextItemToClipboard), @@ -1644,6 +1609,25 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { bindings = append(bindings, &Binding{ViewName: "", Key: rune(i+1) + '0', Modifier: gocui.ModNone, Handler: gui.goToSideWindow(window)}) } + for viewName := range gui.viewTabContextMap() { + bindings = append(bindings, []*Binding{ + { + ViewName: viewName, + Key: gui.getKey("universal.nextTab"), + Handler: gui.handleNextTab, + Description: gui.Tr.SLocalize("nextTab"), + Tag: "navigation", + }, + { + ViewName: viewName, + Key: gui.getKey("universal.prevTab"), + Handler: gui.handlePrevTab, + Description: gui.Tr.SLocalize("prevTab"), + Tag: "navigation", + }, + }...) + } + bindings = append(bindings, gui.getListContextKeyBindings()...) return bindings diff --git a/pkg/gui/list_context.go b/pkg/gui/list_context.go index 0edd80873..3e5bf8467 100644 --- a/pkg/gui/list_context.go +++ b/pkg/gui/list_context.go @@ -510,15 +510,15 @@ func (gui *Gui) getListContextKeyBindings() []*Binding { for _, listContext := range gui.getListContexts() { bindings = append(bindings, []*Binding{ - {ViewName: listContext.ViewName, Contexts: []string{listContext.ContextKey}, Key: gui.getKey("universal.prevItem-alt"), Modifier: gocui.ModNone, Handler: listContext.handlePrevLine}, - {ViewName: listContext.ViewName, Contexts: []string{listContext.ContextKey}, Key: gui.getKey("universal.prevItem"), Modifier: gocui.ModNone, Handler: listContext.handlePrevLine}, - {ViewName: listContext.ViewName, Contexts: []string{listContext.ContextKey}, Key: gocui.MouseWheelUp, Modifier: gocui.ModNone, Handler: listContext.handlePrevLine}, - {ViewName: listContext.ViewName, Contexts: []string{listContext.ContextKey}, Key: gui.getKey("universal.nextItem-alt"), Modifier: gocui.ModNone, Handler: listContext.handleNextLine}, - {ViewName: listContext.ViewName, Contexts: []string{listContext.ContextKey}, Key: gui.getKey("universal.nextItem"), Modifier: gocui.ModNone, Handler: listContext.handleNextLine}, - {ViewName: listContext.ViewName, Contexts: []string{listContext.ContextKey}, Key: gui.getKey("universal.prevPage"), Modifier: gocui.ModNone, Handler: listContext.handlePrevPage, Description: gui.Tr.SLocalize("prevPage")}, - {ViewName: listContext.ViewName, Contexts: []string{listContext.ContextKey}, Key: gui.getKey("universal.nextPage"), Modifier: gocui.ModNone, Handler: listContext.handleNextPage, Description: gui.Tr.SLocalize("nextPage")}, - {ViewName: listContext.ViewName, Contexts: []string{listContext.ContextKey}, Key: gui.getKey("universal.gotoTop"), Modifier: gocui.ModNone, Handler: listContext.handleGotoTop, Description: gui.Tr.SLocalize("gotoTop")}, - {ViewName: listContext.ViewName, Contexts: []string{listContext.ContextKey}, Key: gocui.MouseWheelDown, Modifier: gocui.ModNone, Handler: listContext.handleNextLine}, + {ViewName: listContext.ViewName, Tag: "navigation", Contexts: []string{listContext.ContextKey}, Key: gui.getKey("universal.prevItem-alt"), Modifier: gocui.ModNone, Handler: listContext.handlePrevLine}, + {ViewName: listContext.ViewName, Tag: "navigation", Contexts: []string{listContext.ContextKey}, Key: gui.getKey("universal.prevItem"), Modifier: gocui.ModNone, Handler: listContext.handlePrevLine}, + {ViewName: listContext.ViewName, Tag: "navigation", Contexts: []string{listContext.ContextKey}, Key: gocui.MouseWheelUp, Modifier: gocui.ModNone, Handler: listContext.handlePrevLine}, + {ViewName: listContext.ViewName, Tag: "navigation", Contexts: []string{listContext.ContextKey}, Key: gui.getKey("universal.nextItem-alt"), Modifier: gocui.ModNone, Handler: listContext.handleNextLine}, + {ViewName: listContext.ViewName, Tag: "navigation", Contexts: []string{listContext.ContextKey}, Key: gui.getKey("universal.nextItem"), Modifier: gocui.ModNone, Handler: listContext.handleNextLine}, + {ViewName: listContext.ViewName, Tag: "navigation", Contexts: []string{listContext.ContextKey}, Key: gui.getKey("universal.prevPage"), Modifier: gocui.ModNone, Handler: listContext.handlePrevPage, Description: gui.Tr.SLocalize("prevPage")}, + {ViewName: listContext.ViewName, Tag: "navigation", Contexts: []string{listContext.ContextKey}, Key: gui.getKey("universal.nextPage"), Modifier: gocui.ModNone, Handler: listContext.handleNextPage, Description: gui.Tr.SLocalize("nextPage")}, + {ViewName: listContext.ViewName, Tag: "navigation", Contexts: []string{listContext.ContextKey}, Key: gui.getKey("universal.gotoTop"), Modifier: gocui.ModNone, Handler: listContext.handleGotoTop, Description: gui.Tr.SLocalize("gotoTop")}, + {ViewName: listContext.ViewName, Tag: "navigation", Contexts: []string{listContext.ContextKey}, Key: gocui.MouseWheelDown, Modifier: gocui.ModNone, Handler: listContext.handleNextLine}, {ViewName: listContext.ViewName, Contexts: []string{listContext.ContextKey}, Key: gocui.MouseLeft, Modifier: gocui.ModNone, Handler: listContext.handleClick}, }...) @@ -537,6 +537,7 @@ func (gui *Gui) getListContextKeyBindings() []*Binding { Key: gui.getKey("universal.startSearch"), Handler: openSearchHandler, Description: gui.Tr.SLocalize("startSearch"), + Tag: "navigation", }, { ViewName: listContext.ViewName, @@ -544,6 +545,7 @@ func (gui *Gui) getListContextKeyBindings() []*Binding { Key: gui.getKey("universal.gotoBottom"), Handler: gotoBottomHandler, Description: gui.Tr.SLocalize("gotoBottom"), + Tag: "navigation", }, }...) } diff --git a/pkg/i18n/dutch.go b/pkg/i18n/dutch.go index c90017896..f56d4c1c7 100644 --- a/pkg/i18n/dutch.go +++ b/pkg/i18n/dutch.go @@ -572,7 +572,7 @@ func addDutch(i18nObject *i18n.Bundle) error { ID: "CommitMessageTitle", Other: "Commit Bericht", }, &i18n.Message{ - ID: "Local-BranchesTitle", + ID: "LocalBranchesTitle", Other: "Branches Tab", }, &i18n.Message{ ID: "SearchTitle", @@ -581,7 +581,7 @@ func addDutch(i18nObject *i18n.Bundle) error { ID: "TagsTitle", Other: "Tags Tab", }, &i18n.Message{ - ID: "Branch-CommitsTitle", + ID: "BranchCommitsTitle", Other: "Commits Tab", }, &i18n.Message{ ID: "MenuTitle", @@ -593,10 +593,10 @@ func addDutch(i18nObject *i18n.Bundle) error { ID: "CredentialsTitle", |