diff --git a/docs/decisions.md b/docs/decisions.md index acee918..c3e5f69 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -63,7 +63,7 @@ do **not** mark the parent itself as `changed`. **Decision.** Only the first level is visible. `→` expands and enters the first child, `←` collapses and goes to the parent, `space` toggles, -`ctrl+→/←` expand/collapse all (see [ux-guide.md](ux-guide.md#navigation)). +`L`/`H` (or `ctrl+→/←`) expand/collapse all (see [ux-guide.md](ux-guide.md#navigation)). `←` on an expanded node collapses it in place, so a node can be closed without leaving it. Remembered expansion is kept on collapse, but reset by "collapse all". diff --git a/docs/ux-guide.md b/docs/ux-guide.md index 2d4238f..74c9130 100644 --- a/docs/ux-guide.md +++ b/docs/ux-guide.md @@ -183,8 +183,8 @@ colors in components. | `space` | Toggle expand/collapse of the selected submodule | | `→` / `l` | Collapsed with children: expand and select the first child. Expanded: select the first child. Leaf: nothing | | `←` / `h` | Expanded: collapse it (stays selected). Otherwise: collapse the parent and select it. Top level: nothing | -| `ctrl+→` | Expand all; then follow the first child from the selection down to a submodule without children | -| `ctrl+←` | Collapse all (resets remembered expansion); select the top-level ancestor | +| `L` / `ctrl+→` | Expand all; then follow the first child from the selection down to a submodule without children | +| `H` / `ctrl+←` | Collapse all (resets remembered expansion); select the top-level ancestor | | `home` / `g`, `end` / `G` | First / last submodule | | `pgup`, `pgdn` | Move by one screen | | `?` | Toggle full help | @@ -209,5 +209,6 @@ is selected, headers above it are shown too. ## Accessibility and terminals - `SUBMARINE_ASCII=1`: ASCII symbols (`^ v > v . *`) instead of Unicode. -- Some terminals or multiplexers capture `ctrl+←/→`; letter aliases can be - added if needed. +- Many setups capture `ctrl+←/→` (macOS Mission Control, some terminals and + multiplexers), so expand/collapse all also work as `L` / `H`, the shifted + vim keys for `→` / `←`. diff --git a/internal/tui/keys.go b/internal/tui/keys.go index 3d0382f..578ce45 100644 --- a/internal/tui/keys.go +++ b/internal/tui/keys.go @@ -17,8 +17,8 @@ func defaultKeys() keyMap { Left: key.NewBinding(key.WithKeys("left", "h"), key.WithHelp("←/→", "collapse/expand")), Right: key.NewBinding(key.WithKeys("right", "l"), key.WithHelp("→/l", "expand, first child")), Toggle: key.NewBinding(key.WithKeys(" "), key.WithHelp("space", "toggle")), - CollapseAll: key.NewBinding(key.WithKeys("ctrl+left"), key.WithHelp("ctrl+←", "collapse all")), - ExpandAll: key.NewBinding(key.WithKeys("ctrl+right"), key.WithHelp("ctrl+→", "expand all")), + CollapseAll: key.NewBinding(key.WithKeys("ctrl+left", "H"), key.WithHelp("H/ctrl+←", "collapse all")), + ExpandAll: key.NewBinding(key.WithKeys("ctrl+right", "L"), key.WithHelp("L/ctrl+→", "expand all")), Home: key.NewBinding(key.WithKeys("home", "g"), key.WithHelp("home/g", "first")), End: key.NewBinding(key.WithKeys("end", "G"), key.WithHelp("end/G", "last")), PageUp: key.NewBinding(key.WithKeys("pgup"), key.WithHelp("pgup", "page up")),