Skip to content

Commit 7bea415

Browse files
Collapse/expand all files in tree
Co-authored-by: Stefan Haller <stefan@haller-berlin.de>
1 parent 14a91d9 commit 7bea415

21 files changed

+276
-0
lines changed

docs/Config.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,8 @@ keybinding:
571571
openMergeTool: M
572572
openStatusFilter: <c-b>
573573
copyFileInfoToClipboard: "y"
574+
collapseAll: '-'
575+
expandAll: =
574576
branches:
575577
createPullRequest: o
576578
viewPullRequestOptions: O

docs/keybindings/Keybindings_en.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
6565
| `` a `` | Toggle all files | Add/remove all commit's files to custom patch. See https://github.com/jesseduffield/lazygit#rebase-magic-custom-patches. |
6666
| `` <enter> `` | Enter file / Toggle directory collapsed | If a file is selected, enter the file so that you can add/remove individual lines to the custom patch. If a directory is selected, toggle the directory. |
6767
| `` ` `` | Toggle file tree view | Toggle file view between flat and tree layout. Flat layout shows all file paths in a single list, tree layout groups files by directory. |
68+
| `` - `` | Collapse all files | Collapse all directories in the files tree |
69+
| `` = `` | Expand all files | Expand all directories in the file tree |
6870
| `` / `` | Search the current view by text | |
6971

7072
## Commit summary
@@ -147,6 +149,8 @@ If you would instead like to start an interactive rebase from the selected commi
147149
| `` <c-t> `` | Open external diff tool (git difftool) | |
148150
| `` M `` | Open external merge tool | Run `git mergetool`. |
149151
| `` f `` | Fetch | Fetch changes from remote. |
152+
| `` - `` | Collapse all files | Collapse all directories in the files tree |
153+
| `` = `` | Expand all files | Expand all directories in the file tree |
150154
| `` / `` | Search the current view by text | |
151155

152156
## Local branches

docs/keybindings/Keybindings_ja.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ If you would instead like to start an interactive rebase from the selected commi
143143
| `` a `` | Toggle all files | Add/remove all commit's files to custom patch. See https://github.com/jesseduffield/lazygit#rebase-magic-custom-patches. |
144144
| `` <enter> `` | Enter file / Toggle directory collapsed | If a file is selected, enter the file so that you can add/remove individual lines to the custom patch. If a directory is selected, toggle the directory. |
145145
| `` ` `` | ファイルツリーの表示を切り替え | Toggle file view between flat and tree layout. Flat layout shows all file paths in a single list, tree layout groups files by directory. |
146+
| `` - `` | Collapse all files | Collapse all directories in the files tree |
147+
| `` = `` | Expand all files | Expand all directories in the file tree |
146148
| `` / `` | 検索を開始 | |
147149

148150
## コミットメッセージ
@@ -218,6 +220,8 @@ If you would instead like to start an interactive rebase from the selected commi
218220
| `` <c-t> `` | Open external diff tool (git difftool) | |
219221
| `` M `` | Git mergetoolを開く | Run `git mergetool`. |
220222
| `` f `` | Fetch | Fetch changes from remote. |
223+
| `` - `` | Collapse all files | Collapse all directories in the files tree |
224+
| `` = `` | Expand all files | Expand all directories in the file tree |
221225
| `` / `` | 検索を開始 | |
222226

223227
## ブランチ

docs/keybindings/Keybindings_ko.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,8 @@ If you would instead like to start an interactive rebase from the selected commi
308308
| `` a `` | Toggle all files included in patch | Add/remove all commit's files to custom patch. See https://github.com/jesseduffield/lazygit#rebase-magic-custom-patches. |
309309
| `` <enter> `` | Enter file to add selected lines to the patch (or toggle directory collapsed) | If a file is selected, enter the file so that you can add/remove individual lines to the custom patch. If a directory is selected, toggle the directory. |
310310
| `` ` `` | 파일 트리뷰로 전환 | Toggle file view between flat and tree layout. Flat layout shows all file paths in a single list, tree layout groups files by directory. |
311+
| `` - `` | Collapse all files | Collapse all directories in the files tree |
312+
| `` = `` | Expand all files | Expand all directories in the file tree |
311313
| `` / `` | 검색 시작 | |
312314

313315
## 커밋메시지
@@ -359,6 +361,8 @@ If you would instead like to start an interactive rebase from the selected commi
359361
| `` <c-t> `` | Open external diff tool (git difftool) | |
360362
| `` M `` | Git mergetool를 열기 | Run `git mergetool`. |
361363
| `` f `` | Fetch | Fetch changes from remote. |
364+
| `` - `` | Collapse all files | Collapse all directories in the files tree |
365+
| `` = `` | Expand all files | Expand all directories in the file tree |
362366
| `` / `` | 검색 시작 | |
363367

364368
## 확인 패널

docs/keybindings/Keybindings_nl.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
7979
| `` <c-t> `` | Open external diff tool (git difftool) | |
8080
| `` M `` | Open external merge tool | Run `git mergetool`. |
8181
| `` f `` | Fetch | Fetch changes from remote. |
82+
| `` - `` | Collapse all files | Collapse all directories in the files tree |
83+
| `` = `` | Expand all files | Expand all directories in the file tree |
8284
| `` / `` | Start met zoeken | |
8385

8486
## Bevestigingspaneel
@@ -136,6 +138,8 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
136138
| `` a `` | Toggle all files | Add/remove all commit's files to custom patch. See https://github.com/jesseduffield/lazygit#rebase-magic-custom-patches. |
137139
| `` <enter> `` | Enter bestand om geselecteerde regels toe te voegen aan de patch | If a file is selected, enter the file so that you can add/remove individual lines to the custom patch. If a directory is selected, toggle the directory. |
138140
| `` ` `` | Toggle bestandsboom weergave | Toggle file view between flat and tree layout. Flat layout shows all file paths in a single list, tree layout groups files by directory. |
141+
| `` - `` | Collapse all files | Collapse all directories in the files tree |
142+
| `` = `` | Expand all files | Expand all directories in the file tree |
139143
| `` / `` | Start met zoeken | |
140144

141145
## Commits

docs/keybindings/Keybindings_pl.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ Jeśli chcesz zamiast tego rozpocząć interaktywny rebase od wybranego commita,
229229
| `` <c-t> `` | Otwórz zewnętrzne narzędzie różnic (git difftool) | |
230230
| `` M `` | Otwórz zewnętrzne narzędzie scalania | Uruchom `git mergetool`. |
231231
| `` f `` | Pobierz | Pobierz zmiany ze zdalnego serwera. |
232+
| `` - `` | Collapse all files | Collapse all directories in the files tree |
233+
| `` = `` | Expand all files | Expand all directories in the file tree |
232234
| `` / `` | Szukaj w bieżącym widoku po tekście | |
233235

234236
## Pliki commita
@@ -245,6 +247,8 @@ Jeśli chcesz zamiast tego rozpocząć interaktywny rebase od wybranego commita,
245247
| `` a `` | Przełącz wszystkie pliki | Dodaj/usuń wszystkie pliki commita do niestandardowej łatki. Zobacz https://github.com/jesseduffield/lazygit#rebase-magic-custom-patches. |
246248
| `` <enter> `` | Wejdź do pliku / Przełącz zwiń katalog | Jeśli plik jest wybrany, wejdź do pliku, aby móc dodawać/usuwać poszczególne linie do niestandardowej łatki. Jeśli wybrany jest katalog, przełącz katalog. |
247249
| `` ` `` | Przełącz widok drzewa plików | Przełącz widok plików między płaskim a drzewem. Płaski układ pokazuje wszystkie ścieżki plików na jednej liście, układ drzewa grupuje pliki według katalogów. |
250+
| `` - `` | Collapse all files | Collapse all directories in the files tree |
251+
| `` = `` | Expand all files | Expand all directories in the file tree |
248252
| `` / `` | Szukaj w bieżącym widoku po tekście | |
249253

250254
## Podsumowanie commita

docs/keybindings/Keybindings_ru.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ If you would instead like to start an interactive rebase from the selected commi
270270
| `` a `` | Переключить все файлы, включённые в патч | Add/remove all commit's files to custom patch. See https://github.com/jesseduffield/lazygit#rebase-magic-custom-patches. |
271271
| `` <enter> `` | Введите файл, чтобы добавить выбранные строки в патч (или свернуть каталог переключения) | If a file is selected, enter the file so that you can add/remove individual lines to the custom patch. If a directory is selected, toggle the directory. |
272272
| `` ` `` | Переключить вид дерева файлов | Toggle file view between flat and tree layout. Flat layout shows all file paths in a single list, tree layout groups files by directory. |
273+
| `` - `` | Collapse all files | Collapse all directories in the files tree |
274+
| `` = `` | Expand all files | Expand all directories in the file tree |
273275
| `` / `` | Найти | |
274276

275277
## Статус
@@ -353,6 +355,8 @@ If you would instead like to start an interactive rebase from the selected commi
353355
| `` <c-t> `` | Open external diff tool (git difftool) | |
354356
| `` M `` | Открыть внешний инструмент слияния (git mergetool) | Run `git mergetool`. |
355357
| `` f `` | Получить изменения | Fetch changes from remote. |
358+
| `` - `` | Collapse all files | Collapse all directories in the files tree |
359+
| `` = `` | Expand all files | Expand all directories in the file tree |
356360
| `` / `` | Найти | |
357361

358362
## Хранилище

docs/keybindings/Keybindings_zh-CN.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ _图例:`<c-b>` 意味着ctrl+b, `<a-b>意味着Alt+b, `B` 意味着shift+b_
195195
| `` a `` | 操作所有文件 | 添加或删除所有提交中的文件到自定义的补丁中。请参阅 https://github.com/jesseduffield/lazygit#rebase-magic-custom-patches。 |
196196
| `` <enter> `` | 输入文件以将所选行添加到补丁中(或切换目录折叠) | 如果已选择一个文件,则Enter进入该文件,以便您可以向自定义补丁添加/删除单独的行。如果选择了目录,则切换目录。 |
197197
| `` ` `` | 切换文件树视图 | 在平铺部署与树布局之间切换文件视图。平铺布局在一个列表中展示所有文件路径,树布局则根据目录分组展示。 |
198+
| `` - `` | Collapse all files | Collapse all directories in the files tree |
199+
| `` = `` | Expand all files | Expand all directories in the file tree |
198200
| `` / `` | 开始搜索 | |
199201

200202
## 文件
@@ -225,6 +227,8 @@ _图例:`<c-b>` 意味着ctrl+b, `<a-b>意味着Alt+b, `B` 意味着shift+b_
225227
| `` <c-t> `` | 使用外部差异比较工具(git difftool) | |
226228
| `` M `` | 打开外部合并工具(git mergetool) | 执行 `git mergetool`. |
227229
| `` f `` | 抓取 | 从远程获取变更 |
230+
| `` - `` | Collapse all files | Collapse all directories in the files tree |
231+
| `` = `` | Expand all files | Expand all directories in the file tree |
228232
| `` / `` | 开始搜索 | |
229233

230234
## 构建补丁中

docs/keybindings/Keybindings_zh-TW.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ If you would instead like to start an interactive rebase from the selected commi
219219
| `` a `` | 切換所有檔案是否包含在補丁中 | Add/remove all commit's files to custom patch. See https://github.com/jesseduffield/lazygit#rebase-magic-custom-patches. |
220220
| `` <enter> `` | 輸入檔案以將選定的行添加至補丁(或切換目錄折疊) | If a file is selected, enter the file so that you can add/remove individual lines to the custom patch. If a directory is selected, toggle the directory. |
221221
| `` ` `` | 顯示檔案樹狀視圖 | Toggle file view between flat and tree layout. Flat layout shows all file paths in a single list, tree layout groups files by directory. |
222+
| `` - `` | Collapse all files | Collapse all directories in the files tree |
223+
| `` = `` | Expand all files | Expand all directories in the file tree |
222224
| `` / `` | 搜尋 | |
223225

224226
## 收藏 (Stash)
@@ -320,6 +322,8 @@ If you would instead like to start an interactive rebase from the selected commi
320322
| `` <c-t> `` | 開啟外部差異工具 (git difftool) | |
321323
| `` M `` | 開啟外部合併工具 | 執行 `git mergetool`|
322324
| `` f `` | 擷取 | 同步遠端異動 |
325+
| `` - `` | Collapse all files | Collapse all directories in the files tree |
326+
| `` = `` | Expand all files | Expand all directories in the file tree |
323327
| `` / `` | 搜尋 | |
324328

325329
## 狀態

pkg/config/user_config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,8 @@ type KeybindingFilesConfig struct {
456456
OpenMergeTool string `yaml:"openMergeTool"`
457457
OpenStatusFilter string `yaml:"openStatusFilter"`
458458
CopyFileInfoToClipboard string `yaml:"copyFileInfoToClipboard"`
459+
CollapseAll string `yaml:"collapseAll"`
460+
ExpandAll string `yaml:"expandAll"`
459461
}
460462

461463
type KeybindingBranchesConfig struct {
@@ -898,6 +900,8 @@ func GetDefaultConfig() *UserConfig {
898900
OpenStatusFilter: "<c-b>",
899901
ConfirmDiscard: "x",
900902
CopyFileInfoToClipboard: "y",
903+
CollapseAll: "-",
904+
ExpandAll: "=",
901905
},
902906
Branches: KeybindingBranchesConfig{
903907
CopyPullRequestURL: "<c-y>",

0 commit comments

Comments
 (0)