From 3a3625d85580789fac3b770f6883e0f8035c6247 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Sun, 10 May 2026 09:09:57 +0200 Subject: [PATCH] Fold remaining alt bindings into their main fields Convert the remaining *Alt/*Alt[12] sibling fields (PrevItem/NextItem, GotoTop/GotoBottom, PrevBlock/NextBlock, ScrollUpMain/ScrollDownMain, OptionMenu, ConfirmInEditor, DiffingMenu) so the merge mechanism folds their values into the corresponding main multi-key binding at config load. The redundant alt-only Binding registrations across the various controllers and the global keybindings file are gone: the merged main field already carries every key, so the for-loop in SetKeybinding registers them all. --- docs-master/Config.md | 34 +--- docs-master/keybindings/Keybindings_en.md | 15 +- docs-master/keybindings/Keybindings_ja.md | 15 +- docs-master/keybindings/Keybindings_ko.md | 15 +- docs-master/keybindings/Keybindings_nl.md | 15 +- docs-master/keybindings/Keybindings_pl.md | 15 +- docs-master/keybindings/Keybindings_pt.md | 15 +- docs-master/keybindings/Keybindings_ru.md | 15 +- docs-master/keybindings/Keybindings_zh-CN.md | 15 +- docs-master/keybindings/Keybindings_zh-TW.md | 15 +- pkg/config/user_config.go | 186 ++++++++++-------- pkg/gui/command_log_panel.go | 5 +- .../commit_description_controller.go | 30 +-- pkg/gui/controllers/global_controller.go | 7 - pkg/gui/controllers/list_controller.go | 8 +- .../controllers/merge_conflicts_controller.go | 8 - .../controllers/patch_explorer_controller.go | 20 -- pkg/gui/controllers/side_window_controller.go | 4 - .../controllers/view_selection_controller.go | 8 +- pkg/gui/keybindings.go | 62 ------ pkg/gui/menu_panel.go | 4 + pkg/i18n/english.go | 2 - schema-master/config.json | 68 ++++++- 23 files changed, 254 insertions(+), 327 deletions(-) diff --git a/docs-master/Config.md b/docs-master/Config.md index 90ddde045..882baec63 100644 --- a/docs-master/Config.md +++ b/docs-master/Config.md @@ -602,27 +602,19 @@ keybinding: return: quitWithoutChangingDirectory: Q togglePanel: - prevItem: - nextItem: - prevItem-alt: k - nextItem-alt: j + prevItem: [, k] + nextItem: [, j] prevPage: ',' nextPage: . scrollLeft: H scrollRight: L - gotoTop: < - gotoBottom: '>' - gotoTop-alt: - gotoBottom-alt: + gotoTop: [<, ] + gotoBottom: ['>', ] toggleRangeSelect: v rangeSelectDown: rangeSelectUp: - prevBlock: - nextBlock: - prevBlock-alt: h - nextBlock-alt: l - nextBlock-alt2: - prevBlock-alt2: + prevBlock: [, h, ] + nextBlock: [, l, ] jumpToBlock: - "1" - "2" @@ -653,18 +645,13 @@ keybinding: confirmSuggestion: # on Mac - confirmInEditor: - confirmInEditor-alt: + confirmInEditor: [, ] remove: d new: "n" edit: e openFile: o - scrollUpMain: - scrollDownMain: - scrollUpMain-alt1: K - scrollDownMain-alt1: J - scrollUpMain-alt2: - scrollDownMain-alt2: + scrollUpMain: [, K, ] + scrollDownMain: [, J, ] executeShellCommand: ':' createRebaseOptionsMenu: m @@ -683,8 +670,7 @@ keybinding: undo: z redo: Z filteringMenu: - diffingMenu: W - diffingMenu-alt: + diffingMenu: [W, ] copyToClipboard: openRecentRepos: submitEditorText: diff --git a/docs-master/keybindings/Keybindings_en.md b/docs-master/keybindings/Keybindings_en.md index fafa7312d..71ecdae5b 100644 --- a/docs-master/keybindings/Keybindings_en.md +++ b/docs-master/keybindings/Keybindings_en.md @@ -7,8 +7,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | Key | Action | Info | |-----|--------|-------------| | `` `` | Switch to a recent repo | | -| `` (fn+up/shift+k) `` | Scroll up main window | | -| `` (fn+down/shift+j) `` | Scroll down main window | | +| `` , K, (fn+up/shift+k) `` | Scroll up main window | | +| `` , J, (fn+down/shift+j) `` | Scroll down main window | | | `` @ `` | View command log options | View options for the command log e.g. show/hide the command log and focus the command log. | | `` P `` | Push | Push the current branch to its upstream branch. If no upstream is configured, you will be prompted to configure an upstream branch. | | `` p `` | Pull | Pull changes from the remote for the current branch. If no upstream is configured, you will be prompted to configure an upstream branch. | @@ -26,8 +26,7 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | `` `` | Cancel | | | `` ? `` | Open keybindings menu | | | `` `` | View filter options | View options for filtering the commit log, so that only commits matching the filter are shown. | -| `` W `` | View diffing options | View options relating to diffing two refs e.g. diffing against selected ref, entering ref to diff against, and reversing the diff direction. | -| `` `` | View diffing options | View options relating to diffing two refs e.g. diffing against selected ref, entering ref to diff against, and reversing the diff direction. | +| `` W, `` | View diffing options | View options relating to diffing two refs e.g. diffing against selected ref, entering ref to diff against, and reversing the diff direction. | | `` q, `` | Quit | | | `` `` | Suspend the application | | | `` `` | Toggle whitespace | Toggle whether or not whitespace changes are shown in the diff view.

The default can be changed in the config file with the key 'git.ignoreWhitespaceInDiffView'. | @@ -40,8 +39,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct |-----|--------|-------------| | `` , `` | Previous page | | | `` . `` | Next page | | -| `` < () `` | Scroll to top | | -| `` > () `` | Scroll to bottom | | +| `` <, `` | Scroll to top | | +| `` >, `` | Scroll to bottom | | | `` v `` | Toggle range select | | | `` `` | Range select down | | | `` `` | Range select up | | @@ -205,8 +204,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct |-----|--------|-------------| | `` `` | Pick hunk | | | `` b `` | Pick all hunks | | -| `` `` | Previous hunk | | -| `` `` | Next hunk | | +| `` , k `` | Previous hunk | | +| `` , j `` | Next hunk | | | `` , h `` | Previous conflict | | | `` , l `` | Next conflict | | | `` z `` | Undo | Undo last merge conflict resolution. | diff --git a/docs-master/keybindings/Keybindings_ja.md b/docs-master/keybindings/Keybindings_ja.md index 4b5bfc9f3..5a958f80e 100644 --- a/docs-master/keybindings/Keybindings_ja.md +++ b/docs-master/keybindings/Keybindings_ja.md @@ -7,8 +7,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | Key | Action | Info | |-----|--------|-------------| | `` `` | 最近のリポジトリをチェックアウト | | -| `` (fn+up/shift+k) `` | メインウィンドウを上にスクロール | | -| `` (fn+down/shift+j) `` | メインウィンドウを下にスクロール | | +| `` , K, (fn+up/shift+k) `` | メインウィンドウを上にスクロール | | +| `` , J, (fn+down/shift+j) `` | メインウィンドウを下にスクロール | | | `` @ `` | コマンドログオプションを表示 | コマンドログのオプションを表示します(例:コマンドログの表示/非表示、コマンドログへのフォーカスなど)。 | | `` P `` | プッシュ | 現在のブランチを対応するアップストリームブランチにプッシュします。アップストリームが設定されていない場合、アップストリームブランチの設定を求められます。 | | `` p `` | プル | 現在のブランチのリモートから変更をプルします。アップストリームが設定されていない場合、アップストリームブランチの設定を求められます。 | @@ -26,8 +26,7 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | `` `` | キャンセル | | | `` ? `` | キーバインディングメニューを開く | | | `` `` | フィルターオプションを表示 | コミットログのフィルタリングオプションを表示し、フィルタに一致するコミットのみを表示します。 | -| `` W `` | 差分オプションを表示 | 2つのrefの差分に関連するオプションを表示します(例:選択したrefとの差分表示、差分を取るrefの入力、差分方向の反転など)。 | -| `` `` | 差分オプションを表示 | 2つのrefの差分に関連するオプションを表示します(例:選択したrefとの差分表示、差分を取るrefの入力、差分方向の反転など)。 | +| `` W, `` | 差分オプションを表示 | 2つのrefの差分に関連するオプションを表示します(例:選択したrefとの差分表示、差分を取るrefの入力、差分方向の反転など)。 | | `` q, `` | 終了 | | | `` `` | Suspend the application | | | `` `` | 空白表示の切り替え | Toggle whether or not whitespace changes are shown in the diff view.

The default can be changed in the config file with the key 'git.ignoreWhitespaceInDiffView'. | @@ -40,8 +39,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct |-----|--------|-------------| | `` , `` | 前のページ | | | `` . `` | 次のページ | | -| `` < () `` | 先頭にスクロール | | -| `` > () `` | 末尾にスクロール | | +| `` <, `` | 先頭にスクロール | | +| `` >, `` | 末尾にスクロール | | | `` v `` | 範囲選択を切り替え | | | `` `` | 範囲選択を下に | | | `` `` | 範囲選択を上に | | @@ -288,8 +287,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct |-----|--------|-------------| | `` `` | ハンクを選択 | | | `` b `` | すべてのハンクを選択 | | -| `` `` | 前のハンク | | -| `` `` | 次のハンク | | +| `` , k `` | 前のハンク | | +| `` , j `` | 次のハンク | | | `` , h `` | 前のコンフリクト | | | `` , l `` | 次のコンフリクト | | | `` z `` | 元に戻す | 最後のマージコンフリクト解決を元に戻します。 | diff --git a/docs-master/keybindings/Keybindings_ko.md b/docs-master/keybindings/Keybindings_ko.md index 157984a9c..d6121452b 100644 --- a/docs-master/keybindings/Keybindings_ko.md +++ b/docs-master/keybindings/Keybindings_ko.md @@ -7,8 +7,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | Key | Action | Info | |-----|--------|-------------| | `` `` | 최근에 사용한 저장소로 전환 | | -| `` (fn+up/shift+k) `` | 메인 패널을 위로 스크롤 | | -| `` (fn+down/shift+j) `` | 메인 패널을 아래로로 스크롤 | | +| `` , K, (fn+up/shift+k) `` | 메인 패널을 위로 스크롤 | | +| `` , J, (fn+down/shift+j) `` | 메인 패널을 아래로로 스크롤 | | | `` @ `` | 명령어 로그 메뉴 열기 | View options for the command log e.g. show/hide the command log and focus the command log. | | `` P `` | 푸시 | Push the current branch to its upstream branch. If no upstream is configured, you will be prompted to configure an upstream branch. | | `` p `` | 업데이트 | Pull changes from the remote for the current branch. If no upstream is configured, you will be prompted to configure an upstream branch. | @@ -26,8 +26,7 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | `` `` | 취소 | | | `` ? `` | 매뉴 열기 | | | `` `` | View filter-by-path options | View options for filtering the commit log, so that only commits matching the filter are shown. | -| `` W `` | Diff 메뉴 열기 | View options relating to diffing two refs e.g. diffing against selected ref, entering ref to diff against, and reversing the diff direction. | -| `` `` | Diff 메뉴 열기 | View options relating to diffing two refs e.g. diffing against selected ref, entering ref to diff against, and reversing the diff direction. | +| `` W, `` | Diff 메뉴 열기 | View options relating to diffing two refs e.g. diffing against selected ref, entering ref to diff against, and reversing the diff direction. | | `` q, `` | 종료 | | | `` `` | Suspend the application | | | `` `` | 공백문자를 Diff 뷰에서 표시 여부 전환 | Toggle whether or not whitespace changes are shown in the diff view.

The default can be changed in the config file with the key 'git.ignoreWhitespaceInDiffView'. | @@ -40,8 +39,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct |-----|--------|-------------| | `` , `` | 이전 페이지 | | | `` . `` | 다음 페이지 | | -| `` < () `` | 맨 위로 스크롤 | | -| `` > () `` | 맨 아래로 스크롤 | | +| `` <, `` | 맨 위로 스크롤 | | +| `` >, `` | 맨 아래로 스크롤 | | | `` v `` | 드래그 선택 전환 | | | `` `` | Range select down | | | `` `` | Range select up | | @@ -144,8 +143,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct |-----|--------|-------------| | `` `` | Pick hunk | | | `` b `` | Pick all hunks | | -| `` `` | 이전 hunk를 선택 | | -| `` `` | 다음 hunk를 선택 | | +| `` , k `` | 이전 hunk를 선택 | | +| `` , j `` | 다음 hunk를 선택 | | | `` , h `` | 이전 충돌을 선택 | | | `` , l `` | 다음 충돌을 선택 | | | `` z `` | 되돌리기 | Undo last merge conflict resolution. | diff --git a/docs-master/keybindings/Keybindings_nl.md b/docs-master/keybindings/Keybindings_nl.md index ca3449cf9..23a08aae4 100644 --- a/docs-master/keybindings/Keybindings_nl.md +++ b/docs-master/keybindings/Keybindings_nl.md @@ -7,8 +7,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | Key | Action | Info | |-----|--------|-------------| | `` `` | Wissel naar een recente repo | | -| `` (fn+up/shift+k) `` | Scroll naar beneden vanaf hoofdpaneel | | -| `` (fn+down/shift+j) `` | Scroll naar beneden vanaf hoofdpaneel | | +| `` , K, (fn+up/shift+k) `` | Scroll naar beneden vanaf hoofdpaneel | | +| `` , J, (fn+down/shift+j) `` | Scroll naar beneden vanaf hoofdpaneel | | | `` @ `` | View command log options | View options for the command log e.g. show/hide the command log and focus the command log. | | `` P `` | Push | Push the current branch to its upstream branch. If no upstream is configured, you will be prompted to configure an upstream branch. | | `` p `` | Pull | Pull changes from the remote for the current branch. If no upstream is configured, you will be prompted to configure an upstream branch. | @@ -26,8 +26,7 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | `` `` | Annuleren | | | `` ? `` | Open menu | | | `` `` | Bekijk scoping opties | View options for filtering the commit log, so that only commits matching the filter are shown. | -| `` W `` | Open diff menu | View options relating to diffing two refs e.g. diffing against selected ref, entering ref to diff against, and reversing the diff direction. | -| `` `` | Open diff menu | View options relating to diffing two refs e.g. diffing against selected ref, entering ref to diff against, and reversing the diff direction. | +| `` W, `` | Open diff menu | View options relating to diffing two refs e.g. diffing against selected ref, entering ref to diff against, and reversing the diff direction. | | `` q, `` | Quit | | | `` `` | Suspend the application | | | `` `` | Toggle whitespace | Toggle whether or not whitespace changes are shown in the diff view.

The default can be changed in the config file with the key 'git.ignoreWhitespaceInDiffView'. | @@ -40,8 +39,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct |-----|--------|-------------| | `` , `` | Vorige pagina | | | `` . `` | Volgende pagina | | -| `` < () `` | Scroll naar boven | | -| `` > () `` | Scroll naar beneden | | +| `` <, `` | Scroll naar boven | | +| `` >, `` | Scroll naar beneden | | | `` v `` | Toggle drag selecteer | | | `` `` | Range select down | | | `` `` | Range select up | | @@ -213,8 +212,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct |-----|--------|-------------| | `` `` | Kies stuk | | | `` b `` | Kies beide stukken | | -| `` `` | Selecteer bovenste hunk | | -| `` `` | Selecteer onderste hunk | | +| `` , k `` | Selecteer bovenste hunk | | +| `` , j `` | Selecteer onderste hunk | | | `` , h `` | Selecteer voorgaand conflict | | | `` , l `` | Selecteer volgende conflict | | | `` z `` | Ongedaan maken | Undo last merge conflict resolution. | diff --git a/docs-master/keybindings/Keybindings_pl.md b/docs-master/keybindings/Keybindings_pl.md index 69e60b78d..b233fd6d4 100644 --- a/docs-master/keybindings/Keybindings_pl.md +++ b/docs-master/keybindings/Keybindings_pl.md @@ -7,8 +7,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | Key | Action | Info | |-----|--------|-------------| | `` `` | Przełącz na ostatnie repozytorium | | -| `` (fn+up/shift+k) `` | Przewiń główne okno w górę | | -| `` (fn+down/shift+j) `` | Przewiń główne okno w dół | | +| `` , K, (fn+up/shift+k) `` | Przewiń główne okno w górę | | +| `` , J, (fn+down/shift+j) `` | Przewiń główne okno w dół | | | `` @ `` | Pokaż opcje dziennika poleceń | Pokaż opcje dla dziennika poleceń, np. pokazywanie/ukrywanie dziennika poleceń i skupienie na dzienniku poleceń. | | `` P `` | Wypchnij | Wypchnij bieżącą gałąź do jej gałęzi nadrzędnej. Jeśli nie skonfigurowano gałęzi nadrzędnej, zostaniesz poproszony o skonfigurowanie gałęzi nadrzędnej. | | `` p `` | Pociągnij | Pociągnij zmiany z zdalnego dla bieżącej gałęzi. Jeśli nie skonfigurowano gałęzi nadrzędnej, zostaniesz poproszony o skonfigurowanie gałęzi nadrzędnej. | @@ -26,8 +26,7 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | `` `` | Anuluj | | | `` ? `` | Otwórz menu przypisań klawiszy | | | `` `` | Pokaż opcje filtrowania | Pokaż opcje filtrowania dziennika commitów, tak aby pokazywane były tylko commity pasujące do filtra. | -| `` W `` | Pokaż opcje różnicowania | Pokaż opcje dotyczące różnicowania dwóch refów, np. różnicowanie względem wybranego refa, wprowadzanie refa do różnicowania i odwracanie kierunku różnic. | -| `` `` | Pokaż opcje różnicowania | Pokaż opcje dotyczące różnicowania dwóch refów, np. różnicowanie względem wybranego refa, wprowadzanie refa do różnicowania i odwracanie kierunku różnic. | +| `` W, `` | Pokaż opcje różnicowania | Pokaż opcje dotyczące różnicowania dwóch refów, np. różnicowanie względem wybranego refa, wprowadzanie refa do różnicowania i odwracanie kierunku różnic. | | `` q, `` | Wyjdź | | | `` `` | Suspend the application | | | `` `` | Przełącz białe znaki | Toggle whether or not whitespace changes are shown in the diff view.

The default can be changed in the config file with the key 'git.ignoreWhitespaceInDiffView'. | @@ -40,8 +39,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct |-----|--------|-------------| | `` , `` | Poprzednia strona | | | `` . `` | Następna strona | | -| `` < () `` | Przewiń do góry | | -| `` > () `` | Przewiń do dołu | | +| `` <, `` | Przewiń do góry | | +| `` >, `` | Przewiń do dołu | | | `` v `` | Przełącz zaznaczenie zakresu | | | `` `` | Zaznacz zakres w dół | | | `` `` | Zaznacz zakres w górę | | @@ -189,8 +188,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct |-----|--------|-------------| | `` `` | Wybierz fragment | | | `` b `` | Wybierz wszystkie fragmenty | | -| `` `` | Poprzedni fragment | | -| `` `` | Następny fragment | | +| `` , k `` | Poprzedni fragment | | +| `` , j `` | Następny fragment | | | `` , h `` | Poprzedni konflikt | | | `` , l `` | Następny konflikt | | | `` z `` | Cofnij | Cofnij ostatnie rozwiązanie konfliktu scalania. | diff --git a/docs-master/keybindings/Keybindings_pt.md b/docs-master/keybindings/Keybindings_pt.md index 0152530f0..22d5cbb55 100644 --- a/docs-master/keybindings/Keybindings_pt.md +++ b/docs-master/keybindings/Keybindings_pt.md @@ -7,8 +7,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | Key | Action | Info | |-----|--------|-------------| | `` `` | Mudar para um repositório recente | | -| `` (fn+up/shift+k) `` | Rolar janela principal para cima | | -| `` (fn+down/shift+j) `` | Rolar a janela principal para baixo | | +| `` , K, (fn+up/shift+k) `` | Rolar janela principal para cima | | +| `` , J, (fn+down/shift+j) `` | Rolar a janela principal para baixo | | | `` @ `` | View command log options | View options for the command log e.g. show/hide the command log and focus the command log. | | `` P `` | Empurre (Push) | Faça push do branch atual para o seu branch upstream. Se nenhum upstream estiver configurado, você será solicitado a configurar um branch a montante. | | `` p `` | Puxar (Pull) | Puxe alterações do controle remoto para o ramo atual. Se nenhum upstream estiver configurado, será solicitado configurar um ramo a montante. | @@ -26,8 +26,7 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | `` `` | Cancelar | | | `` ? `` | Abrir o menu de atalhos do teclado | | | `` `` | Ver opções de filtro | View options for filtering the commit log, so that only commits matching the filter are shown. | -| `` W `` | View diffing options | View options relating to diffing two refs e.g. diffing against selected ref, entering ref to diff against, and reversing the diff direction. | -| `` `` | View diffing options | View options relating to diffing two refs e.g. diffing against selected ref, entering ref to diff against, and reversing the diff direction. | +| `` W, `` | View diffing options | View options relating to diffing two refs e.g. diffing against selected ref, entering ref to diff against, and reversing the diff direction. | | `` q, `` | Sair | | | `` `` | Suspender a aplicação | | | `` `` | Toggle whitespace | Toggle whether or not whitespace changes are shown in the diff view.

The default can be changed in the config file with the key 'git.ignoreWhitespaceInDiffView'. | @@ -40,8 +39,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct |-----|--------|-------------| | `` , `` | Aba anterior | | | `` . `` | Próxima aba | | -| `` < () `` | Voltar ao topo | | -| `` > () `` | Ir para o final | | +| `` <, `` | Voltar ao topo | | +| `` >, `` | Ir para o final | | | `` v `` | Toggle range select | | | `` `` | Range select down | | | `` `` | Range select up | | @@ -273,8 +272,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct |-----|--------|-------------| | `` `` | Escolha o local | | | `` b `` | Pegar todos os pedaços | | -| `` `` | Trecho anterior | | -| `` `` | Próximo trecho | | +| `` , k `` | Trecho anterior | | +| `` , j `` | Próximo trecho | | | `` , h `` | Conflito anterior | | | `` , l `` | Próximo conflito | | | `` z `` | Desfazer | Desfazer resolução de conflitos de última mesclagem. | diff --git a/docs-master/keybindings/Keybindings_ru.md b/docs-master/keybindings/Keybindings_ru.md index 697912e5a..3b81d2433 100644 --- a/docs-master/keybindings/Keybindings_ru.md +++ b/docs-master/keybindings/Keybindings_ru.md @@ -7,8 +7,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | Key | Action | Info | |-----|--------|-------------| | `` `` | Переключиться на последний репозиторий | | -| `` (fn+up/shift+k) `` | Прокрутить вверх главную панель | | -| `` (fn+down/shift+j) `` | Прокрутить вниз главную панель | | +| `` , K, (fn+up/shift+k) `` | Прокрутить вверх главную панель | | +| `` , J, (fn+down/shift+j) `` | Прокрутить вниз главную панель | | | `` @ `` | Открыть меню журнала команд | View options for the command log e.g. show/hide the command log and focus the command log. | | `` P `` | Отправить изменения | Push the current branch to its upstream branch. If no upstream is configured, you will be prompted to configure an upstream branch. | | `` p `` | Получить и слить изменения | Pull changes from the remote for the current branch. If no upstream is configured, you will be prompted to configure an upstream branch. | @@ -26,8 +26,7 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | `` `` | Отменить | | | `` ? `` | Открыть меню | | | `` `` | Просмотреть параметры фильтрации по пути | View options for filtering the commit log, so that only commits matching the filter are shown. | -| `` W `` | Открыть меню сравнении | View options relating to diffing two refs e.g. diffing against selected ref, entering ref to diff against, and reversing the diff direction. | -| `` `` | Открыть меню сравнении | View options relating to diffing two refs e.g. diffing against selected ref, entering ref to diff against, and reversing the diff direction. | +| `` W, `` | Открыть меню сравнении | View options relating to diffing two refs e.g. diffing against selected ref, entering ref to diff against, and reversing the diff direction. | | `` q, `` | Выйти | | | `` `` | Suspend the application | | | `` `` | Переключить отображение изменении пробелов в просмотрщике сравнении | Toggle whether or not whitespace changes are shown in the diff view.

The default can be changed in the config file with the key 'git.ignoreWhitespaceInDiffView'. | @@ -40,8 +39,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct |-----|--------|-------------| | `` , `` | Предыдущая страница | | | `` . `` | Следующая страница | | -| `` < () `` | Пролистать наверх | | -| `` > () `` | Прокрутить вниз | | +| `` <, `` | Пролистать наверх | | +| `` >, `` | Прокрутить вниз | | | `` v `` | Переключить выборку перетаскивания | | | `` `` | Range select down | | | `` `` | Range select up | | @@ -114,8 +113,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct |-----|--------|-------------| | `` `` | Выбрать эту часть | | | `` b `` | Выбрать все части | | -| `` `` | Выбрать предыдущую часть | | -| `` `` | Выбрать следующую часть | | +| `` , k `` | Выбрать предыдущую часть | | +| `` , j `` | Выбрать следующую часть | | | `` , h `` | Выбрать предыдущий конфликт | | | `` , l `` | Выбрать следующий конфликт | | | `` z `` | Отменить | Undo last merge conflict resolution. | diff --git a/docs-master/keybindings/Keybindings_zh-CN.md b/docs-master/keybindings/Keybindings_zh-CN.md index fcd78596a..76e378695 100644 --- a/docs-master/keybindings/Keybindings_zh-CN.md +++ b/docs-master/keybindings/Keybindings_zh-CN.md @@ -7,8 +7,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | Key | Action | Info | |-----|--------|-------------| | `` `` | 切换到最近的仓库 | | -| `` (fn+up/shift+k) `` | 向上滚动主面板 | | -| `` (fn+down/shift+j) `` | 向下滚动主面板 | | +| `` , K, (fn+up/shift+k) `` | 向上滚动主面板 | | +| `` , J, (fn+down/shift+j) `` | 向下滚动主面板 | | | `` @ `` | 打开命令日志菜单 | 查看命令日志的选项,例如显示/隐藏命令日志以及聚焦命令日志 | | `` P `` | 推送 | 推送当前分支到它的上游。如果上游未配置,您可以在弹窗中配置上游分支。 | | `` p `` | 拉取 | 从当前分支的远程分支获取改动。如果上游未配置,您可以在弹窗中配置上游分支。 | @@ -26,8 +26,7 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | `` `` | 取消 | | | `` ? `` | 打开菜单 | | | `` `` | 查看按路径过滤选项 | 查看用于过滤提交日志的选项,以便仅显示与过滤器匹配的提交。 | -| `` W `` | 打开 diff 菜单 | 查看与比较两个引用相关的选项,例如与选定的 ref 进行比较,输入要比较的 ref,然后反转比较方向。 | -| `` `` | 打开 diff 菜单 | 查看与比较两个引用相关的选项,例如与选定的 ref 进行比较,输入要比较的 ref,然后反转比较方向。 | +| `` W, `` | 打开 diff 菜单 | 查看与比较两个引用相关的选项,例如与选定的 ref 进行比较,输入要比较的 ref,然后反转比较方向。 | | `` q, `` | 退出 | | | `` `` | 挂起应用程序 | | | `` `` | 切换是否在差异视图中显示空白字符差异 | 切换是否在差异视图中显示空白字符更改。

默认值可在配置文件中通过键 'git.ignoreWhitespaceInDiffView' 更改。 | @@ -40,8 +39,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct |-----|--------|-------------| | `` , `` | 上一页 | | | `` . `` | 下一页 | | -| `` < () `` | 滚动到顶部 | | -| `` > () `` | 滚动到底部 | | +| `` <, `` | 滚动到顶部 | | +| `` >, `` | 滚动到底部 | | | `` v `` | 切换拖动选择 | | | `` `` | 向下扩展选择范围 | | | `` `` | 向上扩展选择范围 | | @@ -294,8 +293,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct |-----|--------|-------------| | `` `` | 选中区块 | | | `` b `` | 选中所有区块 | | -| `` `` | 选择顶部块 | | -| `` `` | 选择底部块 | | +| `` , k `` | 选择顶部块 | | +| `` , j `` | 选择底部块 | | | `` , h `` | 选择上一个冲突 | | | `` , l `` | 选择下一个冲突 | | | `` z `` | 撤销 | 撤消上次合并冲突解决 | diff --git a/docs-master/keybindings/Keybindings_zh-TW.md b/docs-master/keybindings/Keybindings_zh-TW.md index 2c2456e4a..6ebfa5c68 100644 --- a/docs-master/keybindings/Keybindings_zh-TW.md +++ b/docs-master/keybindings/Keybindings_zh-TW.md @@ -7,8 +7,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | Key | Action | Info | |-----|--------|-------------| | `` `` | 切換到最近使用的版本庫 | | -| `` (fn+up/shift+k) `` | 向上捲動主面板 | | -| `` (fn+down/shift+j) `` | 向下捲動主面板 | | +| `` , K, (fn+up/shift+k) `` | 向上捲動主面板 | | +| `` , J, (fn+down/shift+j) `` | 向下捲動主面板 | | | `` @ `` | 開啟命令記錄選單 | View options for the command log e.g. show/hide the command log and focus the command log. | | `` P `` | 推送 | 推送到遠端。如果沒有設定遠端,會開啟設定視窗。 | | `` p `` | 拉取 | 從遠端同步當前分支。如果沒有設定遠端,會開啟設定視窗。 | @@ -26,8 +26,7 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct | `` `` | 取消 | | | `` ? `` | 開啟選單 | | | `` `` | 檢視篩選路徑選項 | View options for filtering the commit log, so that only commits matching the filter are shown. | -| `` W `` | 開啟差異比較選單 | View options relating to diffing two refs e.g. diffing against selected ref, entering ref to diff against, and reversing the diff direction. | -| `` `` | 開啟差異比較選單 | View options relating to diffing two refs e.g. diffing against selected ref, entering ref to diff against, and reversing the diff direction. | +| `` W, `` | 開啟差異比較選單 | View options relating to diffing two refs e.g. diffing against selected ref, entering ref to diff against, and reversing the diff direction. | | `` q, `` | 結束 | | | `` `` | Suspend the application | | | `` `` | 切換是否在差異檢視中顯示空格變更 | Toggle whether or not whitespace changes are shown in the diff view.

The default can be changed in the config file with the key 'git.ignoreWhitespaceInDiffView'. | @@ -40,8 +39,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct |-----|--------|-------------| | `` , `` | 上一頁 | | | `` . `` | 下一頁 | | -| `` < () `` | 捲動到頂部 | | -| `` > () `` | 捲動到底部 | | +| `` <, `` | 捲動到頂部 | | +| `` >, `` | 捲動到底部 | | | `` v `` | 切換拖曳選擇 | | | `` `` | Range select down | | | `` `` | Range select up | | @@ -90,8 +89,8 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct |-----|--------|-------------| | `` `` | 挑選程式碼片段 | | | `` b `` | 挑選所有程式碼片段 | | -| `` `` | 選擇上一段 | | -| `` `` | 選擇下一段 | | +| `` , k `` | 選擇上一段 | | +| `` , j `` | 選擇下一段 | | | `` , h `` | 選擇上一個衝突 | | | `` , l `` | 選擇下一個衝突 | | | `` z `` | 復原 | Undo last merge conflict resolution. | diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go index 6956d4366..0b2dcac0c 100644 --- a/pkg/config/user_config.go +++ b/pkg/config/user_config.go @@ -425,85 +425,99 @@ type KeybindingConfig struct { type KeybindingUniversalConfig struct { Quit Keybinding `yaml:"quit"` // Deprecated: add the key to `quit` instead. - QuitAlt1 Keybinding `yaml:"quit-alt1"` - SuspendApp Keybinding `yaml:"suspendApp"` - Return Keybinding `yaml:"return"` - QuitWithoutChangingDirectory Keybinding `yaml:"quitWithoutChangingDirectory"` - TogglePanel Keybinding `yaml:"togglePanel"` - PrevItem Keybinding `yaml:"prevItem"` - NextItem Keybinding `yaml:"nextItem"` - PrevItemAlt Keybinding `yaml:"prevItem-alt"` - NextItemAlt Keybinding `yaml:"nextItem-alt"` - PrevPage Keybinding `yaml:"prevPage"` - NextPage Keybinding `yaml:"nextPage"` - ScrollLeft Keybinding `yaml:"scrollLeft"` - ScrollRight Keybinding `yaml:"scrollRight"` - GotoTop Keybinding `yaml:"gotoTop"` - GotoBottom Keybinding `yaml:"gotoBottom"` - GotoTopAlt Keybinding `yaml:"gotoTop-alt"` - GotoBottomAlt Keybinding `yaml:"gotoBottom-alt"` - ToggleRangeSelect Keybinding `yaml:"toggleRangeSelect"` - RangeSelectDown Keybinding `yaml:"rangeSelectDown"` - RangeSelectUp Keybinding `yaml:"rangeSelectUp"` - PrevBlock Keybinding `yaml:"prevBlock"` - NextBlock Keybinding `yaml:"nextBlock"` - PrevBlockAlt Keybinding `yaml:"prevBlock-alt"` - NextBlockAlt Keybinding `yaml:"nextBlock-alt"` - NextBlockAlt2 Keybinding `yaml:"nextBlock-alt2"` - PrevBlockAlt2 Keybinding `yaml:"prevBlock-alt2"` - JumpToBlock []Keybinding `yaml:"jumpToBlock"` - FocusMainView Keybinding `yaml:"focusMainView"` - NextMatch Keybinding `yaml:"nextMatch"` - PrevMatch Keybinding `yaml:"prevMatch"` - StartSearch Keybinding `yaml:"startSearch"` - MoveWordLeft Keybinding `yaml:"moveWordLeft"` // on Mac - MoveWordRight Keybinding `yaml:"moveWordRight"` // on Mac - BackspaceWord Keybinding `yaml:"backspaceWord"` // on Mac - ForwardDeleteWord Keybinding `yaml:"forwardDeleteWord"` // on Mac - OptionMenu Keybinding `yaml:"optionMenu"` - Select Keybinding `yaml:"select"` - GoInto Keybinding `yaml:"goInto"` - Confirm Keybinding `yaml:"confirm"` - ConfirmMenu Keybinding `yaml:"confirmMenu"` - ConfirmSuggestion Keybinding `yaml:"confirmSuggestion"` - ConfirmInEditor Keybinding `yaml:"confirmInEditor"` // on Mac - ConfirmInEditorAlt Keybinding `yaml:"confirmInEditor-alt"` - Remove Keybinding `yaml:"remove"` - New Keybinding `yaml:"new"` - Edit Keybinding `yaml:"edit"` - OpenFile Keybinding `yaml:"openFile"` - ScrollUpMain Keybinding `yaml:"scrollUpMain"` - ScrollDownMain Keybinding `yaml:"scrollDownMain"` - ScrollUpMainAlt1 Keybinding `yaml:"scrollUpMain-alt1"` - ScrollDownMainAlt1 Keybinding `yaml:"scrollDownMain-alt1"` - ScrollUpMainAlt2 Keybinding `yaml:"scrollUpMain-alt2"` - ScrollDownMainAlt2 Keybinding `yaml:"scrollDownMain-alt2"` - ExecuteShellCommand Keybinding `yaml:"executeShellCommand"` - CreateRebaseOptionsMenu Keybinding `yaml:"createRebaseOptionsMenu"` - Push Keybinding `yaml:"pushFiles"` // 'Files' appended for legacy reasons - Pull Keybinding `yaml:"pullFiles"` // 'Files' appended for legacy reasons - Refresh Keybinding `yaml:"refresh"` - CreatePatchOptionsMenu Keybinding `yaml:"createPatchOptionsMenu"` - NextTab Keybinding `yaml:"nextTab"` - PrevTab Keybinding `yaml:"prevTab"` - NextScreenMode Keybinding `yaml:"nextScreenMode"` - PrevScreenMode Keybinding `yaml:"prevScreenMode"` - CyclePagers Keybinding `yaml:"cyclePagers"` - Undo Keybinding `yaml:"undo"` - Redo Keybinding `yaml:"redo"` - FilteringMenu Keybinding `yaml:"filteringMenu"` - DiffingMenu Keybinding `yaml:"diffingMenu"` - DiffingMenuAlt Keybinding `yaml:"diffingMenu-alt"` - CopyToClipboard Keybinding `yaml:"copyToClipboard"` - OpenRecentRepos Keybinding `yaml:"openRecentRepos"` - SubmitEditorText Keybinding `yaml:"submitEditorText"` - ExtrasMenu Keybinding `yaml:"extrasMenu"` - ToggleWhitespaceInDiffView Keybinding `yaml:"toggleWhitespaceInDiffView"` - IncreaseContextInDiffView Keybinding `yaml:"increaseContextInDiffView"` - DecreaseContextInDiffView Keybinding `yaml:"decreaseContextInDiffView"` - IncreaseRenameSimilarityThreshold Keybinding `yaml:"increaseRenameSimilarityThreshold"` - DecreaseRenameSimilarityThreshold Keybinding `yaml:"decreaseRenameSimilarityThreshold"` - OpenDiffTool Keybinding `yaml:"openDiffTool"` + QuitAlt1 Keybinding `yaml:"quit-alt1"` + SuspendApp Keybinding `yaml:"suspendApp"` + Return Keybinding `yaml:"return"` + QuitWithoutChangingDirectory Keybinding `yaml:"quitWithoutChangingDirectory"` + TogglePanel Keybinding `yaml:"togglePanel"` + PrevItem Keybinding `yaml:"prevItem"` + NextItem Keybinding `yaml:"nextItem"` + // Deprecated: add the key to `prevItem` instead. + PrevItemAlt Keybinding `yaml:"prevItem-alt"` + // Deprecated: add the key to `nextItem` instead. + NextItemAlt Keybinding `yaml:"nextItem-alt"` + PrevPage Keybinding `yaml:"prevPage"` + NextPage Keybinding `yaml:"nextPage"` + ScrollLeft Keybinding `yaml:"scrollLeft"` + ScrollRight Keybinding `yaml:"scrollRight"` + GotoTop Keybinding `yaml:"gotoTop"` + GotoBottom Keybinding `yaml:"gotoBottom"` + // Deprecated: add the key to `gotoTop` instead. + GotoTopAlt Keybinding `yaml:"gotoTop-alt"` + // Deprecated: add the key to `gotoBottom` instead. + GotoBottomAlt Keybinding `yaml:"gotoBottom-alt"` + ToggleRangeSelect Keybinding `yaml:"toggleRangeSelect"` + RangeSelectDown Keybinding `yaml:"rangeSelectDown"` + RangeSelectUp Keybinding `yaml:"rangeSelectUp"` + PrevBlock Keybinding `yaml:"prevBlock"` + NextBlock Keybinding `yaml:"nextBlock"` + // Deprecated: add the key to `prevBlock` instead. + PrevBlockAlt Keybinding `yaml:"prevBlock-alt"` + // Deprecated: add the key to `nextBlock` instead. + NextBlockAlt Keybinding `yaml:"nextBlock-alt"` + // Deprecated: add the key to `nextBlock` instead. + NextBlockAlt2 Keybinding `yaml:"nextBlock-alt2"` + // Deprecated: add the key to `prevBlock` instead. + PrevBlockAlt2 Keybinding `yaml:"prevBlock-alt2"` + JumpToBlock []Keybinding `yaml:"jumpToBlock"` + FocusMainView Keybinding `yaml:"focusMainView"` + NextMatch Keybinding `yaml:"nextMatch"` + PrevMatch Keybinding `yaml:"prevMatch"` + StartSearch Keybinding `yaml:"startSearch"` + MoveWordLeft Keybinding `yaml:"moveWordLeft"` // on Mac + MoveWordRight Keybinding `yaml:"moveWordRight"` // on Mac + BackspaceWord Keybinding `yaml:"backspaceWord"` // on Mac + ForwardDeleteWord Keybinding `yaml:"forwardDeleteWord"` // on Mac + OptionMenu Keybinding `yaml:"optionMenu"` + Select Keybinding `yaml:"select"` + GoInto Keybinding `yaml:"goInto"` + Confirm Keybinding `yaml:"confirm"` + ConfirmMenu Keybinding `yaml:"confirmMenu"` + ConfirmSuggestion Keybinding `yaml:"confirmSuggestion"` + ConfirmInEditor Keybinding `yaml:"confirmInEditor"` // on Mac + // Deprecated: add the key to `confirmInEditor` instead. + ConfirmInEditorAlt Keybinding `yaml:"confirmInEditor-alt"` + Remove Keybinding `yaml:"remove"` + New Keybinding `yaml:"new"` + Edit Keybinding `yaml:"edit"` + OpenFile Keybinding `yaml:"openFile"` + ScrollUpMain Keybinding `yaml:"scrollUpMain"` + ScrollDownMain Keybinding `yaml:"scrollDownMain"` + // Deprecated: add the key to `scrollUpMain` instead. + ScrollUpMainAlt1 Keybinding `yaml:"scrollUpMain-alt1"` + // Deprecated: add the key to `scrollDownMain` instead. + ScrollDownMainAlt1 Keybinding `yaml:"scrollDownMain-alt1"` + // Deprecated: add the key to `scrollUpMain` instead. + ScrollUpMainAlt2 Keybinding `yaml:"scrollUpMain-alt2"` + // Deprecated: add the key to `scrollDownMain` instead. + ScrollDownMainAlt2 Keybinding `yaml:"scrollDownMain-alt2"` + ExecuteShellCommand Keybinding `yaml:"executeShellCommand"` + CreateRebaseOptionsMenu Keybinding `yaml:"createRebaseOptionsMenu"` + Push Keybinding `yaml:"pushFiles"` // 'Files' appended for legacy reasons + Pull Keybinding `yaml:"pullFiles"` // 'Files' appended for legacy reasons + Refresh Keybinding `yaml:"refresh"` + CreatePatchOptionsMenu Keybinding `yaml:"createPatchOptionsMenu"` + NextTab Keybinding `yaml:"nextTab"` + PrevTab Keybinding `yaml:"prevTab"` + NextScreenMode Keybinding `yaml:"nextScreenMode"` + PrevScreenMode Keybinding `yaml:"prevScreenMode"` + CyclePagers Keybinding `yaml:"cyclePagers"` + Undo Keybinding `yaml:"undo"` + Redo Keybinding `yaml:"redo"` + FilteringMenu Keybinding `yaml:"filteringMenu"` + DiffingMenu Keybinding `yaml:"diffingMenu"` + // Deprecated: add the key to `diffingMenu` instead. + DiffingMenuAlt Keybinding `yaml:"diffingMenu-alt"` + CopyToClipboard Keybinding `yaml:"copyToClipboard"` + OpenRecentRepos Keybinding `yaml:"openRecentRepos"` + SubmitEditorText Keybinding `yaml:"submitEditorText"` + ExtrasMenu Keybinding `yaml:"extrasMenu"` + ToggleWhitespaceInDiffView Keybinding `yaml:"toggleWhitespaceInDiffView"` + IncreaseContextInDiffView Keybinding `yaml:"increaseContextInDiffView"` + DecreaseContextInDiffView Keybinding `yaml:"decreaseContextInDiffView"` + IncreaseRenameSimilarityThreshold Keybinding `yaml:"increaseRenameSimilarityThreshold"` + DecreaseRenameSimilarityThreshold Keybinding `yaml:"decreaseRenameSimilarityThreshold"` + OpenDiffTool Keybinding `yaml:"openDiffTool"` } type KeybindingStatusConfig struct { @@ -778,6 +792,20 @@ type IconProperties struct { // release. func (c *KeybindingConfig) MergeLegacyAltKeybindings() { mergeLegacyAlt(&c.Universal.Quit, c.Universal.QuitAlt1) + mergeLegacyAlt(&c.Universal.PrevItem, c.Universal.PrevItemAlt) + mergeLegacyAlt(&c.Universal.NextItem, c.Universal.NextItemAlt) + mergeLegacyAlt(&c.Universal.GotoTop, c.Universal.GotoTopAlt) + mergeLegacyAlt(&c.Universal.GotoBottom, c.Universal.GotoBottomAlt) + mergeLegacyAlt(&c.Universal.PrevBlock, c.Universal.PrevBlockAlt) + mergeLegacyAlt(&c.Universal.NextBlock, c.Universal.NextBlockAlt) + mergeLegacyAlt(&c.Universal.PrevBlock, c.Universal.PrevBlockAlt2) + mergeLegacyAlt(&c.Universal.NextBlock, c.Universal.NextBlockAlt2) + mergeLegacyAlt(&c.Universal.ConfirmInEditor, c.Universal.ConfirmInEditorAlt) + mergeLegacyAlt(&c.Universal.ScrollUpMain, c.Universal.ScrollUpMainAlt1) + mergeLegacyAlt(&c.Universal.ScrollUpMain, c.Universal.ScrollUpMainAlt2) + mergeLegacyAlt(&c.Universal.ScrollDownMain, c.Universal.ScrollDownMainAlt1) + mergeLegacyAlt(&c.Universal.ScrollDownMain, c.Universal.ScrollDownMainAlt2) + mergeLegacyAlt(&c.Universal.DiffingMenu, c.Universal.DiffingMenuAlt) } func GetDefaultConfig() *UserConfig { diff --git a/pkg/gui/command_log_panel.go b/pkg/gui/command_log_panel.go index 3381f371a..8f2e06b98 100644 --- a/pkg/gui/command_log_panel.go +++ b/pkg/gui/command_log_panel.go @@ -136,9 +136,8 @@ func (gui *Gui) getRandomTip() string { config.Universal.NextPage, ), fmt.Sprintf( - "You can jump to the top/bottom of a panel using '%s (or %s)' and '%s (or %s)'", - config.Universal.GotoTop, config.Universal.GotoTopAlt, - config.Universal.GotoBottom, config.Universal.GotoBottomAlt, + "You can jump to the top/bottom of a panel using '%s' and '%s'", + config.Universal.GotoTop, config.Universal.GotoBottom, ), fmt.Sprintf( "To collapse/expand a directory, press '%s'", diff --git a/pkg/gui/controllers/commit_description_controller.go b/pkg/gui/controllers/commit_description_controller.go index 755fddb56..41ec54103 100644 --- a/pkg/gui/controllers/commit_description_controller.go +++ b/pkg/gui/controllers/commit_description_controller.go @@ -37,10 +37,6 @@ func (self *CommitDescriptionController) GetKeybindings(opts types.KeybindingsOp Keys: opts.GetKeys(opts.Config.Universal.ConfirmInEditor), Handler: self.confirm, }, - { - Keys: opts.GetKeys(opts.Config.Universal.ConfirmInEditorAlt), - Handler: self.confirm, - }, { Keys: opts.GetKeys(opts.Config.CommitMessage.CommitMenu), Handler: self.openCommitMenu, @@ -68,26 +64,12 @@ func (self *CommitDescriptionController) GetMouseKeybindings(opts types.Keybindi func (self *CommitDescriptionController) GetOnFocus() func(types.OnFocusOpts) { return func(types.OnFocusOpts) { footer := "" - mainDisabled := len(self.c.UserConfig().Keybinding.Universal.ConfirmInEditor) > 0 - altDisabled := len(self.c.UserConfig().Keybinding.Universal.ConfirmInEditorAlt) > 0 - if !mainDisabled || !altDisabled { - if mainDisabled { - footer = utils.ResolvePlaceholderString(self.c.Tr.CommitDescriptionFooter, - map[string]string{ - "confirmInEditorKeybinding": self.c.UserConfig().Keybinding.Universal.ConfirmInEditorAlt.String(), - }) - } else if altDisabled { - footer = utils.ResolvePlaceholderString(self.c.Tr.CommitDescriptionFooter, - map[string]string{ - "confirmInEditorKeybinding": self.c.UserConfig().Keybinding.Universal.ConfirmInEditor.String(), - }) - } else { - footer = utils.ResolvePlaceholderString(self.c.Tr.CommitDescriptionFooterTwoBindings, - map[string]string{ - "confirmInEditorKeybinding1": self.c.UserConfig().Keybinding.Universal.ConfirmInEditor.String(), - "confirmInEditorKeybinding2": self.c.UserConfig().Keybinding.Universal.ConfirmInEditorAlt.String(), - }) - } + keys := self.c.UserConfig().Keybinding.Universal.ConfirmInEditor + if len(keys) > 0 { + footer = utils.ResolvePlaceholderString(self.c.Tr.CommitDescriptionFooter, + map[string]string{ + "confirmInEditorKeybinding": keys.String(), + }) } self.c.Views().CommitDescription.Footer = footer } diff --git a/pkg/gui/controllers/global_controller.go b/pkg/gui/controllers/global_controller.go index 8e5013a55..1043ee88f 100644 --- a/pkg/gui/controllers/global_controller.go +++ b/pkg/gui/controllers/global_controller.go @@ -99,13 +99,6 @@ func (self *GlobalController) GetKeybindings(opts types.KeybindingsOpts) []*type Tooltip: self.c.Tr.ViewDiffingOptionsTooltip, OpensMenu: true, }, - { - Keys: opts.GetKeys(opts.Config.Universal.DiffingMenuAlt), - Handler: opts.Guards.NoPopupPanel(self.createDiffingMenu), - Description: self.c.Tr.ViewDiffingOptions, - Tooltip: self.c.Tr.ViewDiffingOptionsTooltip, - OpensMenu: true, - }, { Keys: opts.GetKeys(opts.Config.Universal.Quit), Description: self.c.Tr.Quit, diff --git a/pkg/gui/controllers/list_controller.go b/pkg/gui/controllers/list_controller.go index 854e14ffa..b2d45679b 100644 --- a/pkg/gui/controllers/list_controller.go +++ b/pkg/gui/controllers/list_controller.go @@ -271,16 +271,12 @@ func (self *ListController) isFocused() bool { func (self *ListController) GetKeybindings(opts types.KeybindingsOpts) []*types.Binding { bindings := []*types.Binding{ - {Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.PrevItemAlt), Handler: self.HandlePrevLine}, {Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.PrevItem), Handler: self.HandlePrevLine}, - {Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.NextItemAlt), Handler: self.HandleNextLine}, {Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.NextItem), Handler: self.HandleNextLine}, {Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.PrevPage), Handler: self.HandlePrevPage, Description: self.c.Tr.PrevPage}, {Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.NextPage), Handler: self.HandleNextPage, Description: self.c.Tr.NextPage}, - {Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.GotoTop), Handler: self.HandleGotoTop, Description: self.c.Tr.GotoTop, Alternative: ""}, - {Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.GotoBottom), Handler: self.HandleGotoBottom, Description: self.c.Tr.GotoBottom, Alternative: ""}, - {Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.GotoTopAlt), Handler: self.HandleGotoTop}, - {Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.GotoBottomAlt), Handler: self.HandleGotoBottom}, + {Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.GotoTop), Handler: self.HandleGotoTop, Description: self.c.Tr.GotoTop}, + {Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.GotoBottom), Handler: self.HandleGotoBottom, Description: self.c.Tr.GotoBottom}, {Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.ScrollLeft), Handler: self.HandleScrollLeft}, {Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.ScrollRight), Handler: self.HandleScrollRight}, } diff --git a/pkg/gui/controllers/merge_conflicts_controller.go b/pkg/gui/controllers/merge_conflicts_controller.go index 322d1cd39..e1e3f8e2c 100644 --- a/pkg/gui/controllers/merge_conflicts_controller.go +++ b/pkg/gui/controllers/merge_conflicts_controller.go @@ -83,14 +83,6 @@ func (self *MergeConflictsController) GetKeybindings(opts types.KeybindingsOpts) Description: self.c.Tr.OpenFile, Tooltip: self.c.Tr.OpenFileTooltip, }, - { - Keys: opts.GetKeys(opts.Config.Universal.PrevItemAlt), - Handler: self.withRenderAndFocus(self.PrevConflictHunk), - }, - { - Keys: opts.GetKeys(opts.Config.Universal.NextItemAlt), - Handler: self.withRenderAndFocus(self.NextConflictHunk), - }, { Keys: opts.GetKeys(opts.Config.Universal.ScrollLeft), Handler: self.withRenderAndFocus(self.HandleScrollLeft), diff --git a/pkg/gui/controllers/patch_explorer_controller.go b/pkg/gui/controllers/patch_explorer_controller.go index 6f7e766af..aa5fd54bb 100644 --- a/pkg/gui/controllers/patch_explorer_controller.go +++ b/pkg/gui/controllers/patch_explorer_controller.go @@ -39,21 +39,11 @@ func (self *PatchExplorerController) Context() types.Context { func (self *PatchExplorerController) GetKeybindings(opts types.KeybindingsOpts) []*types.Binding { return []*types.Binding{ - { - Tag: "navigation", - Keys: opts.GetKeys(opts.Config.Universal.PrevItemAlt), - Handler: self.withRenderAndFocus(self.HandlePrevLine), - }, { Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.PrevItem), Handler: self.withRenderAndFocus(self.HandlePrevLine), }, - { - Tag: "navigation", - Keys: opts.GetKeys(opts.Config.Universal.NextItemAlt), - Handler: self.withRenderAndFocus(self.HandleNextLine), - }, { Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.NextItem), @@ -123,16 +113,6 @@ func (self *PatchExplorerController) GetKeybindings(opts types.KeybindingsOpts) Description: self.c.Tr.GotoBottom, Handler: self.withRenderAndFocus(self.HandleGotoBottom), }, - { - Tag: "navigation", - Keys: opts.GetKeys(opts.Config.Universal.GotoTopAlt), - Handler: self.withRenderAndFocus(self.HandleGotoTop), - }, - { - Tag: "navigation", - Keys: opts.GetKeys(opts.Config.Universal.GotoBottomAlt), - Handler: self.withRenderAndFocus(self.HandleGotoBottom), - }, { Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.ScrollLeft), diff --git a/pkg/gui/controllers/side_window_controller.go b/pkg/gui/controllers/side_window_controller.go index f09a5bbdb..67fc9f946 100644 --- a/pkg/gui/controllers/side_window_controller.go +++ b/pkg/gui/controllers/side_window_controller.go @@ -37,10 +37,6 @@ func (self *SideWindowController) GetKeybindings(opts types.KeybindingsOpts) []* return []*types.Binding{ {Keys: opts.GetKeys(opts.Config.Universal.PrevBlock), Handler: self.previousSideWindow}, {Keys: opts.GetKeys(opts.Config.Universal.NextBlock), Handler: self.nextSideWindow}, - {Keys: opts.GetKeys(opts.Config.Universal.PrevBlockAlt), Handler: self.previousSideWindow}, - {Keys: opts.GetKeys(opts.Config.Universal.NextBlockAlt), Handler: self.nextSideWindow}, - {Keys: opts.GetKeys(opts.Config.Universal.PrevBlockAlt2), Handler: self.previousSideWindow}, - {Keys: opts.GetKeys(opts.Config.Universal.NextBlockAlt2), Handler: self.nextSideWindow}, } } diff --git a/pkg/gui/controllers/view_selection_controller.go b/pkg/gui/controllers/view_selection_controller.go index 710fd37cb..31cbd3695 100644 --- a/pkg/gui/controllers/view_selection_controller.go +++ b/pkg/gui/controllers/view_selection_controller.go @@ -37,15 +37,11 @@ func (self *ViewSelectionController) Context() types.Context { func (self *ViewSelectionController) GetKeybindings(opts types.KeybindingsOpts) []*types.Binding { return []*types.Binding{ {Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.PrevItem), Handler: self.handlePrevLine}, - {Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.PrevItemAlt), Handler: self.handlePrevLine}, {Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.NextItem), Handler: self.handleNextLine}, - {Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.NextItemAlt), Handler: self.handleNextLine}, {Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.PrevPage), Handler: self.handlePrevPage, Description: self.c.Tr.PrevPage}, {Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.NextPage), Handler: self.handleNextPage, Description: self.c.Tr.NextPage}, - {Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.GotoTop), Handler: self.handleGotoTop, Description: self.c.Tr.GotoTop, Alternative: ""}, - {Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.GotoBottom), Handler: self.handleGotoBottom, Description: self.c.Tr.GotoBottom, Alternative: ""}, - {Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.GotoTopAlt), Handler: self.handleGotoTop}, - {Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.GotoBottomAlt), Handler: self.handleGotoBottom}, + {Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.GotoTop), Handler: self.handleGotoTop, Description: self.c.Tr.GotoTop}, + {Tag: "navigation", Keys: opts.GetKeys(opts.Config.Universal.GotoBottom), Handler: self.handleGotoBottom, Description: self.c.Tr.GotoBottom}, } } diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go index 7bab622b7..22d76f01b 100644 --- a/pkg/gui/keybindings.go +++ b/pkg/gui/keybindings.go @@ -99,26 +99,6 @@ func (gui *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBin Alternative: "fn+down/shift+j", Description: gui.c.Tr.ScrollDownMainWindow, }, - { - ViewName: "", - Keys: opts.GetKeys(opts.Config.Universal.ScrollUpMainAlt1), - Handler: gui.scrollUpMain, - }, - { - ViewName: "", - Keys: opts.GetKeys(opts.Config.Universal.ScrollDownMainAlt1), - Handler: gui.scrollDownMain, - }, - { - ViewName: "", - Keys: opts.GetKeys(opts.Config.Universal.ScrollUpMainAlt2), - Handler: gui.scrollUpMain, - }, - { - ViewName: "", - Keys: opts.GetKeys(opts.Config.Universal.ScrollDownMainAlt2), - Handler: gui.scrollDownMain, - }, { ViewName: "files", Keys: opts.GetKeys(opts.Config.Universal.CopyToClipboard), @@ -228,16 +208,6 @@ func (gui *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBin Keys: opts.GetKeys(opts.Config.Universal.NextItem), Handler: gui.scrollDownConfirmationPanel, }, - { - ViewName: "confirmation", - Keys: opts.GetKeys(opts.Config.Universal.PrevItemAlt), - Handler: gui.scrollUpConfirmationPanel, - }, - { - ViewName: "confirmation", - Keys: opts.GetKeys(opts.Config.Universal.NextItemAlt), - Handler: gui.scrollDownConfirmationPanel, - }, { ViewName: "confirmation", Keys: []gocui.Key{gocui.NewKeyName(gocui.MouseWheelUp)}, @@ -263,21 +233,11 @@ func (gui *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBin Keys: opts.GetKeys(opts.Config.Universal.GotoTop), Handler: gui.goToConfirmationPanelTop, }, - { - ViewName: "confirmation", - Keys: opts.GetKeys(opts.Config.Universal.GotoTopAlt), - Handler: gui.goToConfirmationPanelTop, - }, { ViewName: "confirmation", Keys: opts.GetKeys(opts.Config.Universal.GotoBottom), Handler: gui.goToConfirmationPanelBottom, }, - { - ViewName: "confirmation", - Keys: opts.GetKeys(opts.Config.Universal.GotoBottomAlt), - Handler: gui.goToConfirmationPanelBottom, - }, { ViewName: "submodules", Keys: opts.GetKeys(opts.Config.Universal.CopyToClipboard), @@ -295,12 +255,6 @@ func (gui *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBin Keys: []gocui.Key{gocui.NewKeyName(gocui.MouseWheelDown)}, Handler: gui.scrollDownExtra, }, - { - ViewName: "extras", - Tag: "navigation", - Keys: opts.GetKeys(opts.Config.Universal.PrevItemAlt), - Handler: gui.scrollUpExtra, - }, { ViewName: "extras", Tag: "navigation", @@ -313,12 +267,6 @@ func (gui *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBin Keys: opts.GetKeys(opts.Config.Universal.NextItem), Handler: gui.scrollDownExtra, }, - { - ViewName: "extras", - Tag: "navigation", - Keys: opts.GetKeys(opts.Config.Universal.NextItemAlt), - Handler: gui.scrollDownExtra, - }, { ViewName: "extras", Keys: opts.GetKeys(opts.Config.Universal.NextPage), @@ -334,21 +282,11 @@ func (gui *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBin Keys: opts.GetKeys(opts.Config.Universal.GotoTop), Handler: gui.goToExtrasPanelTop, }, - { - ViewName: "extras", - Keys: opts.GetKeys(opts.Config.Universal.GotoTopAlt), - Handler: gui.goToExtrasPanelTop, - }, { ViewName: "extras", Keys: opts.GetKeys(opts.Config.Universal.GotoBottom), Handler: gui.goToExtrasPanelBottom, }, - { - ViewName: "extras", - Keys: opts.GetKeys(opts.Config.Universal.GotoBottomAlt), - Handler: gui.goToExtrasPanelBottom, - }, { ViewName: "extras", Tag: "navigation", diff --git a/pkg/gui/menu_panel.go b/pkg/gui/menu_panel.go index 336f7601b..23016b9a5 100644 --- a/pkg/gui/menu_panel.go +++ b/pkg/gui/menu_panel.go @@ -27,6 +27,10 @@ func (gui *Gui) createMenu(opts types.CreateMenuOptions) error { maxColumnSize := 1 + // Only the primary key of each navigation binding is reserved as + // essential; alternates (e.g. the historical j/k that lived under + // `*Alt` fields) stay available to be reused by menu items, which + // take precedence over the inherited list bindings. essentialKeys := []gocui.Key{ config.GetValidatedKeyBindingKeys(gui.c.UserConfig().Keybinding.Universal.ConfirmMenu)[0], config.GetValidatedKeyBindingKeys(gui.c.UserConfig().Keybinding.Universal.Return)[0], diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go index ea8e42da4..769248375 100644 --- a/pkg/i18n/english.go +++ b/pkg/i18n/english.go @@ -337,7 +337,6 @@ type TranslationSet struct { CommitDescriptionTitle string CommitDescriptionSubTitle string CommitDescriptionFooter string - CommitDescriptionFooterTwoBindings string CommitHooksDisabledSubTitle string LocalBranchesTitle string SearchTitle string @@ -1456,7 +1455,6 @@ func EnglishTranslationSet() *TranslationSet { CommitDescriptionTitle: "Commit description", CommitDescriptionSubTitle: "Press {{.togglePanelKeyBinding}} to toggle focus, {{.commitMenuKeybinding}} to open menu", CommitDescriptionFooter: "Press {{.confirmInEditorKeybinding}} to submit", - CommitDescriptionFooterTwoBindings: "Press {{.confirmInEditorKeybinding1}} or {{.confirmInEditorKeybinding2}} to submit", CommitHooksDisabledSubTitle: "(hooks disabled)", LocalBranchesTitle: "Local branches", SearchTitle: "Search", diff --git a/schema-master/config.json b/schema-master/config.json index b879ba5c5..84fd2220e 100644 --- a/schema-master/config.json +++ b/schema-master/config.json @@ -2247,7 +2247,10 @@ "type": "array" } ], - "default": "\u003cup\u003e" + "default": [ + "\u003cup\u003e", + "k" + ] }, "nextItem": { "oneOf": [ @@ -2261,7 +2264,10 @@ "type": "array" } ], - "default": "\u003cdown\u003e" + "default": [ + "\u003cdown\u003e", + "j" + ] }, "prevItem-alt": { "oneOf": [ @@ -2275,6 +2281,7 @@ "type": "array" } ], + "description": "Deprecated: add the key to `prevItem` instead.", "default": "k" }, "nextItem-alt": { @@ -2289,6 +2296,7 @@ "type": "array" } ], + "description": "Deprecated: add the key to `nextItem` instead.", "default": "j" }, "prevPage": { @@ -2359,7 +2367,10 @@ "type": "array" } ], - "default": "\u003c" + "default": [ + "\u003c", + "\u003chome\u003e" + ] }, "gotoBottom": { "oneOf": [ @@ -2373,7 +2384,10 @@ "type": "array" } ], - "default": "\u003e" + "default": [ + "\u003e", + "\u003cend\u003e" + ] }, "gotoTop-alt": { "oneOf": [ @@ -2387,6 +2401,7 @@ "type": "array" } ], + "description": "Deprecated: add the key to `gotoTop` instead.", "default": "\u003chome\u003e" }, "gotoBottom-alt": { @@ -2401,6 +2416,7 @@ "type": "array" } ], + "description": "Deprecated: add the key to `gotoBottom` instead.", "default": "\u003cend\u003e" }, "toggleRangeSelect": { @@ -2457,7 +2473,11 @@ "type": "array" } ], - "default": "\u003cleft\u003e" + "default": [ + "\u003cleft\u003e", + "h", + "\u003cbacktab\u003e" + ] }, "nextBlock": { "oneOf": [ @@ -2471,7 +2491,11 @@ "type": "array" } ], - "default": "\u003cright\u003e" + "default": [ + "\u003cright\u003e", + "l", + "\u003ctab\u003e" + ] }, "prevBlock-alt": { "oneOf": [ @@ -2485,6 +2509,7 @@ "type": "array" } ], + "description": "Deprecated: add the key to `prevBlock` instead.", "default": "h" }, "nextBlock-alt": { @@ -2499,6 +2524,7 @@ "type": "array" } ], + "description": "Deprecated: add the key to `nextBlock` instead.", "default": "l" }, "nextBlock-alt2": { @@ -2513,6 +2539,7 @@ "type": "array" } ], + "description": "Deprecated: add the key to `nextBlock` instead.", "default": "\u003ctab\u003e" }, "prevBlock-alt2": { @@ -2527,6 +2554,7 @@ "type": "array" } ], + "description": "Deprecated: add the key to `prevBlock` instead.", "default": "\u003cbacktab\u003e" }, "jumpToBlock": { @@ -2765,7 +2793,10 @@ } ], "description": "\u003cmeta+enter\u003e on Mac", - "default": "\u003cctrl+enter\u003e" + "default": [ + "\u003cctrl+enter\u003e", + "\u003cctrl+s\u003e" + ] }, "confirmInEditor-alt": { "oneOf": [ @@ -2779,6 +2810,7 @@ "type": "array" } ], + "description": "Deprecated: add the key to `confirmInEditor` instead.", "default": "\u003cctrl+s\u003e" }, "remove": { @@ -2849,7 +2881,11 @@ "type": "array" } ], - "default": "\u003cpgup\u003e" + "default": [ + "\u003cpgup\u003e", + "K", + "\u003cctrl+u\u003e" + ] }, "scrollDownMain": { "oneOf": [ @@ -2863,7 +2899,11 @@ "type": "array" } ], - "default": "\u003cpgdown\u003e" + "default": [ + "\u003cpgdown\u003e", + "J", + "\u003cctrl+d\u003e" + ] }, "scrollUpMain-alt1": { "oneOf": [ @@ -2877,6 +2917,7 @@ "type": "array" } ], + "description": "Deprecated: add the key to `scrollUpMain` instead.", "default": "K" }, "scrollDownMain-alt1": { @@ -2891,6 +2932,7 @@ "type": "array" } ], + "description": "Deprecated: add the key to `scrollDownMain` instead.", "default": "J" }, "scrollUpMain-alt2": { @@ -2905,6 +2947,7 @@ "type": "array" } ], + "description": "Deprecated: add the key to `scrollUpMain` instead.", "default": "\u003cctrl+u\u003e" }, "scrollDownMain-alt2": { @@ -2919,6 +2962,7 @@ "type": "array" } ], + "description": "Deprecated: add the key to `scrollDownMain` instead.", "default": "\u003cctrl+d\u003e" }, "executeShellCommand": { @@ -3131,7 +3175,10 @@ "type": "array" } ], - "default": "W" + "default": [ + "W", + "\u003cctrl+e\u003e" + ] }, "diffingMenu-alt": { "oneOf": [ @@ -3145,6 +3192,7 @@ "type": "array" } ], + "description": "Deprecated: add the key to `diffingMenu` instead.", "default": "\u003cctrl+e\u003e" }, "copyToClipboard": {