From 18a508b29c82af6e2929860c93b69227ba4ed9c0 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Mon, 17 Jul 2023 20:01:16 +1000 Subject: [PATCH] Update cheatsheets --- docs/keybindings/Keybindings_en.md | 17 +++++++++++++++++ docs/keybindings/Keybindings_ja.md | 17 +++++++++++++++++ docs/keybindings/Keybindings_ko.md | 17 +++++++++++++++++ docs/keybindings/Keybindings_nl.md | 17 +++++++++++++++++ docs/keybindings/Keybindings_pl.md | 17 +++++++++++++++++ docs/keybindings/Keybindings_ru.md | 17 +++++++++++++++++ docs/keybindings/Keybindings_zh-CN.md | 17 +++++++++++++++++ docs/keybindings/Keybindings_zh-TW.md | 17 +++++++++++++++++ pkg/gui/controllers/worktrees_controller.go | 20 ++++++++++---------- 9 files changed, 146 insertions(+), 10 deletions(-) diff --git a/docs/keybindings/Keybindings_en.md b/docs/keybindings/Keybindings_en.md index 5e682be7e..2d8701483 100644 --- a/docs/keybindings/Keybindings_en.md +++ b/docs/keybindings/Keybindings_en.md @@ -89,6 +89,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_ t: Revert commit T: Tag commit <c-l>: Open log menu + w: View worktree options <space>: Checkout commit y: Copy commit attribute o: Open commit in browser @@ -154,6 +155,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_ g: View reset options R: Rename branch u: Set/Unset upstream + w: View worktree options <enter>: View commits /: Filter the current view by text @@ -231,6 +233,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_
   <c-o>: Copy commit SHA to clipboard
+  w: View worktree options
   <space>: Checkout commit
   y: Copy commit attribute
   o: Open commit in browser
@@ -254,6 +257,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_
   d: Delete branch
   u: Set as upstream of checked-out branch
   g: View reset options
+  w: View worktree options
   <enter>: View commits
   /: Filter the current view by text
 
@@ -276,6 +280,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_ d: Drop n: New branch r: Rename stash + w: View worktree options <enter>: View selected item's files /: Filter the current view by text @@ -294,6 +299,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_
   <c-o>: Copy commit SHA to clipboard
+  w: View worktree options
   <space>: Checkout commit
   y: Copy commit attribute
   o: Open commit in browser
@@ -328,6 +334,17 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_
   P: Push tag
   n: Create tag
   g: View reset options
+  w: View worktree options
   <enter>: View commits
   /: Filter the current view by text
 
+ +## Worktrees + +
+  n: Create worktree
+  <space>: Switch to worktree
+  o: Open in editor
+  d: Remove worktree
+  /: Filter the current view by text
+
diff --git a/docs/keybindings/Keybindings_ja.md b/docs/keybindings/Keybindings_ja.md index 787796679..ff41c92a2 100644 --- a/docs/keybindings/Keybindings_ja.md +++ b/docs/keybindings/Keybindings_ja.md @@ -52,6 +52,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_ d: Drop n: 新しいブランチを作成 r: Stashを変更 + w: View worktree options <enter>: View selected item's files /: Filter the current view by text @@ -60,6 +61,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_
   <c-o>: コミットのSHAをクリップボードにコピー
+  w: View worktree options
   <space>: コミットをチェックアウト
   y: コミットの情報をコピー
   o: ブラウザでコミットを開く
@@ -72,6 +74,16 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_
   /: 検索を開始
 
+## Worktrees + +
+  n: Create worktree
+  <space>: Switch to worktree
+  o: Open in editor
+  d: Remove worktree
+  /: Filter the current view by text
+
+ ## コミット
@@ -95,6 +107,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_
   t: コミットをrevert
   T: タグを作成
   <c-l>: ログメニューを開く
+  w: View worktree options
   <space>: コミットをチェックアウト
   y: コミットの情報をコピー
   o: ブラウザでコミットを開く
@@ -160,6 +173,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_
   P: タグをpush
   n: タグを作成
   g: View reset options
+  w: View worktree options
   <enter>: コミットを閲覧
   /: Filter the current view by text
 
@@ -211,6 +225,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_ g: View reset options R: ブランチ名を変更 u: Set/Unset upstream + w: View worktree options <enter>: コミットを閲覧 /: Filter the current view by text @@ -305,6 +320,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_ d: ブランチを削除 u: Set as upstream of checked-out branch g: View reset options + w: View worktree options <enter>: コミットを閲覧 /: Filter the current view by text @@ -313,6 +329,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_
   <c-o>: コミットのSHAをクリップボードにコピー
+  w: View worktree options
   <space>: コミットをチェックアウト
   y: コミットの情報をコピー
   o: ブラウザでコミットを開く
diff --git a/docs/keybindings/Keybindings_ko.md b/docs/keybindings/Keybindings_ko.md
index 3ebe1f3ad..adafbe1e5 100644
--- a/docs/keybindings/Keybindings_ko.md
+++ b/docs/keybindings/Keybindings_ko.md
@@ -48,6 +48,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_
 
 
   <c-o>: 커밋 SHA를 클립보드에 복사
+  w: View worktree options
   <space>: 커밋을 체크아웃
   y: 커밋 attribute 복사
   o: 브라우저에서 커밋 열기
@@ -68,6 +69,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_
   d: Drop
   n: 새 브랜치 생성
   r: Rename stash
+  w: View worktree options
   <enter>: View selected item's files
   /: Filter the current view by text
 
@@ -76,6 +78,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_
   <c-o>: 커밋 SHA를 클립보드에 복사
+  w: View worktree options
   <space>: 커밋을 체크아웃
   y: 커밋 attribute 복사
   o: 브라우저에서 커밋 열기
@@ -88,6 +91,16 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_
   /: 검색 시작
 
+## Worktrees + +
+  n: Create worktree
+  <space>: Switch to worktree
+  o: Open in editor
+  d: Remove worktree
+  /: Filter the current view by text
+
+ ## 메뉴
@@ -177,6 +190,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_
   g: View reset options
   R: 브랜치 이름 변경
   u: Set/Unset upstream
+  w: View worktree options
   <enter>: 커밋 보기
   /: Filter the current view by text
 
@@ -226,6 +240,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_ d: 브랜치 삭제 u: Set as upstream of checked-out branch g: View reset options + w: View worktree options <enter>: 커밋 보기 /: Filter the current view by text
@@ -253,6 +268,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_ t: 커밋 되돌리기 T: Tag commit <c-l>: 로그 메뉴 열기 + w: View worktree options <space>: 커밋을 체크아웃 y: 커밋 attribute 복사 o: 브라우저에서 커밋 열기 @@ -294,6 +310,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_ P: 태그를 push n: 태그를 생성 g: View reset options + w: View worktree options <enter>: 커밋 보기 /: Filter the current view by text diff --git a/docs/keybindings/Keybindings_nl.md b/docs/keybindings/Keybindings_nl.md index feae84761..e63fde865 100644 --- a/docs/keybindings/Keybindings_nl.md +++ b/docs/keybindings/Keybindings_nl.md @@ -98,6 +98,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_ g: Bekijk reset opties R: Hernoem branch u: Set/Unset upstream + w: View worktree options <enter>: Bekijk commits /: Filter the current view by text @@ -147,6 +148,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_ t: Commit ongedaan maken T: Tag commit <c-l>: Open log menu + w: View worktree options <space>: Checkout commit y: Copy commit attribute o: Open commit in browser @@ -209,6 +211,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_
   <c-o>: Kopieer commit SHA naar klembord
+  w: View worktree options
   <space>: Checkout commit
   y: Copy commit attribute
   o: Open commit in browser
@@ -232,6 +235,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_
   d: Verwijder branch
   u: Stel in als upstream van uitgecheckte branch
   g: Bekijk reset opties
+  w: View worktree options
   <enter>: Bekijk commits
   /: Filter the current view by text
 
@@ -276,6 +280,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_ d: Laten vallen n: Nieuwe branch r: Rename stash + w: View worktree options <enter>: Bekijk gecommite bestanden /: Filter the current view by text @@ -294,6 +299,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_
   <c-o>: Kopieer commit SHA naar klembord
+  w: View worktree options
   <space>: Checkout commit
   y: Copy commit attribute
   o: Open commit in browser
@@ -328,6 +334,17 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_
   P: Push tag
   n: Creëer tag
   g: Bekijk reset opties
+  w: View worktree options
   <enter>: Bekijk commits
   /: Filter the current view by text
 
+ +## Worktrees + +
+  n: Create worktree
+  <space>: Switch to worktree
+  o: Open in editor
+  d: Remove worktree
+  /: Filter the current view by text
+
diff --git a/docs/keybindings/Keybindings_pl.md b/docs/keybindings/Keybindings_pl.md index c619bfff8..ce666dd0a 100644 --- a/docs/keybindings/Keybindings_pl.md +++ b/docs/keybindings/Keybindings_pl.md @@ -74,6 +74,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_ t: Odwróć commit T: Tag commit <c-l>: Open log menu + w: View worktree options <space>: Checkout commit y: Copy commit attribute o: Open commit in browser @@ -112,6 +113,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_ g: Wyświetl opcje resetu R: Rename branch u: Set/Unset upstream + w: View worktree options <enter>: View commits /: Filter the current view by text @@ -208,6 +210,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_
   <c-o>: Copy commit SHA to clipboard
+  w: View worktree options
   <space>: Checkout commit
   y: Copy commit attribute
   o: Open commit in browser
@@ -231,6 +234,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_
   d: Usuń gałąź
   u: Set as upstream of checked-out branch
   g: Wyświetl opcje resetu
+  w: View worktree options
   <enter>: View commits
   /: Filter the current view by text
 
@@ -269,6 +273,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_ d: Porzuć n: Nowa gałąź r: Rename stash + w: View worktree options <enter>: Przeglądaj pliki commita /: Filter the current view by text @@ -287,6 +292,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_
   <c-o>: Copy commit SHA to clipboard
+  w: View worktree options
   <space>: Checkout commit
   y: Copy commit attribute
   o: Open commit in browser
@@ -321,10 +327,21 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_
   P: Push tag
   n: Create tag
   g: Wyświetl opcje resetu
+  w: View worktree options
   <enter>: View commits
   /: Filter the current view by text
 
+## Worktrees + +
+  n: Create worktree
+  <space>: Switch to worktree
+  o: Open in editor
+  d: Remove worktree
+  /: Filter the current view by text
+
+ ## Zwykłe
diff --git a/docs/keybindings/Keybindings_ru.md b/docs/keybindings/Keybindings_ru.md
index cfd05fec8..8da16f7f6 100644
--- a/docs/keybindings/Keybindings_ru.md
+++ b/docs/keybindings/Keybindings_ru.md
@@ -44,6 +44,16 @@ _Связки клавиш_
   [: Предыдущая вкладка
 
+## Worktrees + +
+  n: Create worktree
+  <space>: Switch to worktree
+  o: Open in editor
+  d: Remove worktree
+  /: Filter the current view by text
+
+ ## Главная панель (Индексирование)
@@ -109,6 +119,7 @@ _Связки клавиш_
 
 
   <c-o>: Скопировать SHA коммита в буфер обмена
+  w: View worktree options
   <space>: Переключить коммит
   y: Скопировать атрибут коммита
   o: Открыть коммит в браузере
@@ -144,6 +155,7 @@ _Связки клавиш_
   t: Отменить коммит
   T: Пометить коммит тегом
   <c-l>: Открыть меню журнала
+  w: View worktree options
   <space>: Переключить коммит
   y: Скопировать атрибут коммита
   o: Открыть коммит в браузере
@@ -175,6 +187,7 @@ _Связки клавиш_
   g: Просмотреть параметры сброса
   R: Переименовать ветку
   u: Установить/убрать upstream-ветку
+  w: View worktree options
   <enter>: Просмотреть коммиты
   /: Filter the current view by text
 
@@ -198,6 +211,7 @@ _Связки клавиш_
   <c-o>: Скопировать SHA коммита в буфер обмена
+  w: View worktree options
   <space>: Переключить коммит
   y: Скопировать атрибут коммита
   o: Открыть коммит в браузере
@@ -264,6 +278,7 @@ _Связки клавиш_
   P: Отправить тег
   n: Создать тег
   g: Просмотреть параметры сброса
+  w: View worktree options
   <enter>: Просмотреть коммиты
   /: Filter the current view by text
 
@@ -279,6 +294,7 @@ _Связки клавиш_ d: Удалить ветку u: Установить как upstream-ветку переключённую ветку g: Просмотреть параметры сброса + w: View worktree options <enter>: Просмотреть коммиты /: Filter the current view by text
@@ -328,6 +344,7 @@ _Связки клавиш_ d: Удалить припрятанные изменения из хранилища n: Новая ветка r: Переименовать хранилище + w: View worktree options <enter>: Просмотреть файлы выбранного элемента /: Filter the current view by text diff --git a/docs/keybindings/Keybindings_zh-CN.md b/docs/keybindings/Keybindings_zh-CN.md index 3274b1a0c..0bb8336cf 100644 --- a/docs/keybindings/Keybindings_zh-CN.md +++ b/docs/keybindings/Keybindings_zh-CN.md @@ -48,6 +48,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_
   <c-o>: 将提交的 SHA 复制到剪贴板
+  w: View worktree options
   <space>: 检出提交
   y: Copy commit attribute
   o: 在浏览器中打开提交
@@ -60,6 +61,16 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_
   /: Filter the current view by text
 
+## Worktrees + +
+  n: Create worktree
+  <space>: Switch to worktree
+  o: Open in editor
+  d: Remove worktree
+  /: Filter the current view by text
+
+ ## 分支页面
@@ -80,6 +91,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_
   g: 查看重置选项
   R: 重命名分支
   u: Set/Unset upstream
+  w: View worktree options
   <enter>: 查看提交
   /: Filter the current view by text
 
@@ -88,6 +100,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_
   <c-o>: 将提交的 SHA 复制到剪贴板
+  w: View worktree options
   <space>: 检出提交
   y: Copy commit attribute
   o: 在浏览器中打开提交
@@ -137,6 +150,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_
   t: 还原提交
   T: 标签提交
   <c-l>: 打开日志菜单
+  w: View worktree options
   <space>: 检出提交
   y: Copy commit attribute
   o: 在浏览器中打开提交
@@ -221,6 +235,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_
   P: 推送标签
   n: 创建标签
   g: 查看重置选项
+  w: View worktree options
   <enter>: 查看提交
   /: Filter the current view by text
 
@@ -303,6 +318,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_ d: 删除 n: 新分支 r: Rename stash + w: View worktree options <enter>: 查看提交的文件 /: Filter the current view by text @@ -318,6 +334,7 @@ _Legend: `` means ctrl+b, `` means alt+b, `B` means shift+b_ d: 删除分支 u: 设置为检出分支的上游 g: 查看重置选项 + w: View worktree options <enter>: 查看提交 /: Filter the current view by text diff --git a/docs/keybindings/Keybindings_zh-TW.md b/docs/keybindings/Keybindings_zh-TW.md index 68859a23d..75a36ccbe 100644 --- a/docs/keybindings/Keybindings_zh-TW.md +++ b/docs/keybindings/Keybindings_zh-TW.md @@ -48,6 +48,7 @@ _說明:`` 表示 Ctrl+B、`` 表示 Alt+B,`B`表示 Shift+B_
   <c-o>: 複製提交 SHA 到剪貼簿
+  w: View worktree options
   <space>: 檢出提交
   y: 複製提交屬性
   o: 在瀏覽器中開啟提交
@@ -60,6 +61,16 @@ _說明:`` 表示 Ctrl+B、`` 表示 Alt+B,`B`表示 Shift+B_
   /: Filter the current view by text
 
+## Worktrees + +
+  n: Create worktree
+  <space>: Switch to worktree
+  o: Open in editor
+  d: Remove worktree
+  /: Filter the current view by text
+
+ ## 主視窗 (一般)
@@ -133,6 +144,7 @@ _說明:`` 表示 Ctrl+B、`` 表示 Alt+B,`B`表示 Shift+B_
 
 
   <c-o>: 複製提交 SHA 到剪貼簿
+  w: View worktree options
   <space>: 檢出提交
   y: 複製提交屬性
   o: 在瀏覽器中開啟提交
@@ -182,6 +194,7 @@ _說明:`` 表示 Ctrl+B、`` 表示 Alt+B,`B`表示 Shift+B_
   t: 還原提交
   T: 打標籤到提交
   <c-l>: 開啟記錄選單
+  w: View worktree options
   <space>: 檢出提交
   y: 複製提交屬性
   o: 在瀏覽器中開啟提交
@@ -223,6 +236,7 @@ _說明:`` 表示 Ctrl+B、`` 表示 Alt+B,`B`表示 Shift+B_
   d: 捨棄
   n: 新分支
   r: 重新命名收藏
+  w: View worktree options
   <enter>: 檢視所選項目的檔案
   /: Filter the current view by text
 
@@ -247,6 +261,7 @@ _說明:`` 表示 Ctrl+B、`` 表示 Alt+B,`B`表示 Shift+B_ g: 檢視重設選項 R: 重新命名分支 u: 設定/取消設定上游 + w: View worktree options <enter>: 檢視提交 /: Filter the current view by text
@@ -259,6 +274,7 @@ _說明:`` 表示 Ctrl+B、`` 表示 Alt+B,`B`表示 Shift+B_ P: 推送標籤 n: 建立標籤 g: 檢視重設選項 + w: View worktree options <enter>: 檢視提交 /: Filter the current view by text @@ -328,6 +344,7 @@ _說明:`` 表示 Ctrl+B、`` 表示 Alt+B,`B`表示 Shift+B_ d: 刪除分支 u: 將此分支設為當前分支之上游 g: 檢視重設選項 + w: View worktree options <enter>: 檢視提交 /: Filter the current view by text diff --git a/pkg/gui/controllers/worktrees_controller.go b/pkg/gui/controllers/worktrees_controller.go index c38a679da..3a051e719 100644 --- a/pkg/gui/controllers/worktrees_controller.go +++ b/pkg/gui/controllers/worktrees_controller.go @@ -29,26 +29,26 @@ func NewWorktreesController( func (self *WorktreesController) GetKeybindings(opts types.KeybindingsOpts) []*types.Binding { bindings := []*types.Binding{ - { - Key: opts.GetKey(opts.Config.Universal.Select), - Handler: self.checkSelected(self.enter), - Description: self.c.Tr.SwitchToWorktree, - }, - { - Key: opts.GetKey(opts.Config.Universal.Remove), - Handler: self.checkSelected(self.remove), - Description: self.c.Tr.RemoveWorktree, - }, { Key: opts.GetKey(opts.Config.Universal.New), Handler: self.add, Description: self.c.Tr.CreateWorktree, }, + { + Key: opts.GetKey(opts.Config.Universal.Select), + Handler: self.checkSelected(self.enter), + Description: self.c.Tr.SwitchToWorktree, + }, { Key: opts.GetKey(opts.Config.Universal.OpenFile), Handler: self.checkSelected(self.open), Description: self.c.Tr.OpenInEditor, }, + { + Key: opts.GetKey(opts.Config.Universal.Remove), + Handler: self.checkSelected(self.remove), + Description: self.c.Tr.RemoveWorktree, + }, } return bindings